├── .gitignore
├── Makefile
├── README.md
├── index.html
├── lib
└── server.js
├── manifest.appcache
├── models
└── OldTelevisionSet01
│ ├── doc.kml
│ ├── images
│ ├── texture0.jpg
│ ├── texture1.jpg
│ ├── texture2.jpg
│ ├── texture3.jpg
│ ├── texture4.jpg
│ ├── texture5.jpg
│ ├── texture6.jpg
│ ├── texture7.jpg
│ ├── texture8.jpg
│ └── texture9.jpg
│ ├── models
│ └── Old Television Set 01.dae
│ └── textures.txt
├── package.json
└── vendor
└── tquery
├── build
├── tquery-bundle-require.js
├── tquery-bundle-require.min.js
├── tquery-bundle.js
├── tquery-bundle.min.js
├── tquery.js
└── tquery.min.js
├── plugins
├── checkerboard
│ ├── examples
│ │ └── index.html
│ └── tquery.checkerboard.js
├── fog
│ ├── examples
│ │ └── index.html
│ └── tquery.world.createfog.js
├── loaders
│ ├── examples
│ │ └── index.html
│ └── tquery.loaders.js
├── pproc
│ ├── examples
│ │ ├── index.html
│ │ └── tmp
│ │ │ ├── raw.html
│ │ │ ├── webgl_lines_colors.html
│ │ │ ├── webgl_materials_cubemap_dynamic.html
│ │ │ ├── webgl_postprocessing.html
│ │ │ └── webgl_postprocessing_dof.html
│ └── tquery.effectcomposer.js
├── requirejs
│ ├── Makefile
│ ├── README.md
│ ├── TODO
│ ├── bin
│ │ └── tomainconfigfile.js
│ ├── build
│ │ ├── all.confrequire.js
│ │ └── main-prod.js
│ ├── confrequire
│ │ ├── cannonjs.confrequire.js
│ │ ├── car.confrequire.js
│ │ ├── car.initrequire.js
│ │ ├── checkerboard.confrequire.js
│ │ ├── colornames.confrequire.js
│ │ ├── controls.confrequire.js
│ │ ├── csg.confrequire.js
│ │ ├── datguituner.confrequire.js
│ │ ├── deviceorientation.confrequire.js
│ │ ├── domevent.confrequire.js
│ │ ├── fireball.confrequire.js
│ │ ├── fog.confrequire.js
│ │ ├── grassground.confrequire.js
│ │ ├── grassground.initrequire.js
│ │ ├── gsvpano.confrequire.js
│ │ ├── headtrackr.confrequire.js
│ │ ├── keyboard.confrequire.js
│ │ ├── lavamaterial.confrequire.js
│ │ ├── lavamaterial.initrequire.js
│ │ ├── lensflare.confrequire.js
│ │ ├── lensflare.initrequire.js
│ │ ├── light.confrequire.js
│ │ ├── lightsaber.confrequire.js
│ │ ├── linkify.confrequire.js
│ │ ├── loaders.confrequire.js
│ │ ├── md2character.confrequire.js
│ │ ├── md2character.initrequire.js
│ │ ├── minecraft.confrequire.js
│ │ ├── minecraft.initrequire.js
│ │ ├── modifiers.confrequire.js
│ │ ├── montainarena.confrequire.js
│ │ ├── objectcoord.confrequire.js
│ │ ├── physics.confrequire.js
│ │ ├── planets.confrequire.js
│ │ ├── planets.initrequire.js
│ │ ├── playerinput.confrequire.js
│ │ ├── poolball.confrequire.js
│ │ ├── pproc.confrequire.js
│ │ ├── shadowmap.confrequire.js
│ │ ├── shape.confrequire.js
│ │ ├── simplemaze.confrequire.js
│ │ ├── skymap.confrequire.js
│ │ ├── statplus.confrequire.js
│ │ ├── text.confrequire.js
│ │ ├── textureutils.confrequire.js
│ │ ├── tweenjs.confrequire.js
│ │ ├── vertexanimation.confrequire.js
│ │ ├── videos.confrequire.js
│ │ ├── virtualjoystick.confrequire.js
│ │ ├── webaudio.confrequire.js
│ │ ├── webaudio.initrequire.js
│ │ ├── webglinspector.confrequire.js
│ │ ├── webglinspector.initrequire.js
│ │ ├── webrtcio.confrequire.js
│ │ ├── whammy.confrequire.js
│ │ └── whammy.initrequire.js
│ ├── examples
│ │ ├── index-dev.html
│ │ ├── index-manual.html
│ │ ├── index-planets.html
│ │ ├── index-prod.html
│ │ ├── main-dev.js
│ │ ├── manual_minimalpage.html
│ │ ├── manual_modwithbaseurl.html
│ │ ├── manual_namealias.html
│ │ └── minimal.html
│ ├── footer.js
│ ├── head.confrequire.js
│ └── vendor
│ │ ├── domReady.js
│ │ └── require.js
├── shadowmap
│ ├── examples
│ │ ├── demo.html
│ │ ├── index.html
│ │ ├── test-cascadeshadowmap.html
│ │ └── test-hemispherelight.html
│ ├── tquery.light.shadowmap.js
│ └── tquery.world.shadowmap.js
├── videos
│ ├── examples
│ │ ├── audiovideotexture.html
│ │ ├── images
│ │ │ └── youtube_32x32.png
│ │ ├── index.html
│ │ └── videobrowser.html
│ ├── readme.md
│ ├── tquery.audiovideotexture.js
│ ├── tquery.createtvsnowtexture.js
│ ├── tquery.createvideotexture.js
│ └── tquery.createwebcamtexture.js
└── webrtcio
│ ├── examples
│ ├── demotv.html
│ └── index.html
│ ├── olddemo
│ ├── images
│ │ ├── cubemap_mars
│ │ │ ├── mars_negative_x.jpg
│ │ │ ├── mars_negative_x_180.jpg
│ │ │ ├── mars_negative_y.jpg
│ │ │ ├── mars_negative_y_180.jpg
│ │ │ ├── mars_negative_z.jpg
│ │ │ ├── mars_negative_z_180.jpg
│ │ │ ├── mars_positive_x.jpg
│ │ │ ├── mars_positive_x_180.jpg
│ │ │ ├── mars_positive_y.jpg
│ │ │ ├── mars_positive_y_180.jpg
│ │ │ ├── mars_positive_z.jpg
│ │ │ ├── mars_positive_z_180.jpg
│ │ │ └── orientation_convention.png
│ │ └── webrtc_black_20p.png
│ ├── index.html
│ ├── models
│ │ └── OldTelevisionSet01
│ │ │ ├── doc.kml
│ │ │ ├── images
│ │ │ ├── texture0.jpg
│ │ │ ├── texture1.jpg
│ │ │ ├── texture2.jpg
│ │ │ ├── texture3.jpg
│ │ │ ├── texture4.jpg
│ │ │ ├── texture5.jpg
│ │ │ ├── texture6.jpg
│ │ │ ├── texture7.jpg
│ │ │ ├── texture8.jpg
│ │ │ └── texture9.jpg
│ │ │ ├── models
│ │ │ └── Old Television Set 01.dae
│ │ │ └── textures.txt
│ └── vendor
│ │ └── ColladaLoader.js
│ ├── readme.md
│ └── vendor
│ └── webrtc.io-client
│ └── webrtc.io.js
└── vendor
├── es5-shim.js
├── require.js
├── three.js
├── build
│ ├── three.js
│ └── three.min.js
└── examples
│ └── js
│ ├── Detector.js
│ ├── ImprovedNoise.js
│ ├── ShaderDeferred.js
│ ├── ShaderGodRays.js
│ ├── ShaderSkin.js
│ ├── ShaderTerrain.js
│ ├── ShaderToon.js
│ ├── controls
│ ├── FirstPersonControls.js
│ ├── FlyControls.js
│ ├── OrbitControls.js
│ ├── PathControls.js
│ ├── PointerLockControls.js
│ ├── RollControls.js
│ └── TrackballControls.js
│ ├── libs
│ └── stats.min.js
│ ├── loaders
│ ├── BinaryLoader.js
│ ├── ColladaLoader.js
│ ├── MTLLoader.js
│ ├── OBJLoader.js
│ ├── OBJMTLLoader.js
│ ├── PDBLoader.js
│ ├── STLLoader.js
│ ├── SceneLoader2.js
│ ├── UTF8Loader.js
│ ├── VTKLoader.js
│ └── ctm
│ │ ├── CTMLoader.js
│ │ ├── CTMWorker.js
│ │ ├── ctm.js
│ │ ├── license
│ │ ├── OpenCTM.txt
│ │ ├── js-lzma.txt
│ │ └── js-openctm.txt
│ │ └── lzma.js
│ ├── modifiers
│ ├── ExplodeModifier.js
│ ├── SubdivisionModifier.js
│ └── TessellateModifier.js
│ ├── postprocessing
│ ├── BloomPass.js
│ ├── DotScreenPass.js
│ ├── EffectComposer.js
│ ├── FilmPass.js
│ ├── MaskPass.js
│ ├── RenderPass.js
│ ├── SavePass.js
│ ├── ShaderPass.js
│ └── TexturePass.js
│ ├── renderers
│ ├── CSS3DRenderer.js
│ ├── SVGRenderer.js
│ ├── SoftwareRenderer.js
│ └── WebGLDeferredRenderer.js
│ └── shaders
│ ├── BasicShader.js
│ ├── BleachBypassShader.js
│ ├── BlendShader.js
│ ├── BokehShader.js
│ ├── BrightnessContrastShader.js
│ ├── ColorCorrectionShader.js
│ ├── ColorifyShader.js
│ ├── ConvolutionShader.js
│ ├── CopyShader.js
│ ├── DOFMipMapShader.js
│ ├── DotScreenShader.js
│ ├── EdgeShader.js
│ ├── EdgeShader2.js
│ ├── FXAAShader.js
│ ├── FilmShader.js
│ ├── FocusShader.js
│ ├── FresnelShader.js
│ ├── HorizontalBlurShader.js
│ ├── HorizontalTiltShiftShader.js
│ ├── HueSaturationShader.js
│ ├── KaleidoShader.js
│ ├── LuminosityShader.js
│ ├── MirrorShader.js
│ ├── NormalMapShader.js
│ ├── RGBShiftShader.js
│ ├── SSAOShader.js
│ ├── SepiaShader.js
│ ├── TriangleBlurShader.js
│ ├── UnpackDepthRGBAShader.js
│ ├── VerticalBlurShader.js
│ ├── VerticalTiltShiftShader.js
│ └── VignetteShader.js
├── threex.dragpancontrols.js
└── threex
├── Makefile
├── README.md
├── THREEx.CelShader.js
├── THREEx.DeviceOrientationState.js
├── THREEx.FullScreen.js
├── THREEx.GeometryUtils.js
├── THREEx.GeometryWobble.js
├── THREEx.KeyboardState.js
├── THREEx.LogoTurtle.js
├── THREEx.PlasmaShader.js
├── THREEx.SkyMap.js
├── THREEx.WindowResize.js
├── THREEx.glCapability.js
├── THREEx.requestAnimationFrame.js
├── THREEx.screenshot.js
├── docs
├── THREEx.CelShader.html
├── THREEx.CubeMap.html
├── THREEx.DeviceOrientationState.html
├── THREEx.FullScreen.html
├── THREEx.GeometryUtils.html
├── THREEx.GeometryWobble.html
├── THREEx.KeyboardState.html
├── THREEx.LogoTurtle.html
├── THREEx.PlasmaShader.html
├── THREEx.SkyMap.html
├── THREEx.WindowResize.html
├── THREEx.glCapability.html
├── THREEx.requestAnimationFrame.html
├── THREEx.screenshot.html
└── docco.css
├── examples
├── THREEx.DeviceOrientationState.html
├── THREEx.KeyboardState.html
├── threex.domevent
│ ├── MIT-LICENSE.txt
│ ├── Makefile
│ ├── README.md
│ ├── REVISION
│ ├── css
│ │ └── main.css
│ ├── images
│ │ └── .gitignore
│ ├── index.html
│ ├── js
│ │ └── .gitignore
│ ├── models
│ │ └── teapot.js
│ ├── sounds
│ │ ├── bing.wav
│ │ ├── boom.wav
│ │ └── dong.wav
│ ├── tmp
│ │ ├── index.orig.html
│ │ ├── index.orig2.html
│ │ └── webgl_interactive_cubes.html
│ └── vendor
│ │ ├── three.js
│ │ ├── Detector.js
│ │ ├── RequestAnimationFrame.js
│ │ ├── Stats.js
│ │ └── Three.js
│ │ ├── threex.dragpancontrols.js
│ │ ├── threex
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── THREEx.CelShader.js
│ │ ├── THREEx.DeviceOrientationState.js
│ │ ├── THREEx.FullScreen.js
│ │ ├── THREEx.GeometryUtils.js
│ │ ├── THREEx.GeometryWobble.js
│ │ ├── THREEx.KeyboardState.js
│ │ ├── THREEx.LogoTurtle.js
│ │ ├── THREEx.PlasmaShader.js
│ │ ├── THREEx.SkyMap.js
│ │ ├── THREEx.WindowResize.js
│ │ ├── THREEx.glCapability.js
│ │ ├── THREEx.requestAnimationFrame.js
│ │ ├── THREEx.screenshot.js
│ │ ├── docs
│ │ │ ├── THREEx.CelShader.html
│ │ │ ├── THREEx.CubeMap.html
│ │ │ ├── THREEx.DeviceOrientationState.html
│ │ │ ├── THREEx.FullScreen.html
│ │ │ ├── THREEx.GeometryUtils.html
│ │ │ ├── THREEx.GeometryWobble.html
│ │ │ ├── THREEx.KeyboardState.html
│ │ │ ├── THREEx.LogoTurtle.html
│ │ │ ├── THREEx.PlasmaShader.html
│ │ │ ├── THREEx.SkyMap.html
│ │ │ ├── THREEx.WindowResize.html
│ │ │ ├── THREEx.glCapability.html
│ │ │ ├── THREEx.requestAnimationFrame.html
│ │ │ ├── THREEx.screenshot.html
│ │ │ └── docco.css
│ │ ├── examples
│ │ │ ├── THREEx.DeviceOrientationState.html
│ │ │ ├── THREEx.KeyboardState.html
│ │ │ ├── threex.embedded
│ │ │ │ ├── noshield-host.html
│ │ │ │ ├── noshield-iframe.html
│ │ │ │ ├── withshield-host.html
│ │ │ │ └── withshield-iframe.html
│ │ │ └── threex.fullscreen.html
│ │ ├── threex.chromeWebStoreInstall.js
│ │ ├── threex.embedded.js
│ │ ├── threex.sparks.js
│ │ └── threex.texturePoolBall.js
│ │ └── tween.js
│ │ └── Tween.js
├── threex.embedded
│ ├── noshield-host.html
│ ├── noshield-iframe.html
│ ├── withshield-host.html
│ └── withshield-iframe.html
└── threex.fullscreen.html
├── threex.chromeWebStoreInstall.js
├── threex.domevent.js
├── threex.embedded.js
├── threex.sparks.js
└── threex.texturePoolBall.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # makefile to automatize simple operations
2 |
3 | server:
4 | forever -w --watchDirectory lib lib/server.js
5 |
6 | serverProd:
7 | npm start
8 |
9 | deploy:
10 | jitsu -c deploy
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | WebGL Video Chat
2 | ================
3 |
4 | A Video Chat in WebGL
5 |
6 | ## TODO
7 | * cut out the model feet in blender
8 | * then stack the tvsets intead of putting them in line
--------------------------------------------------------------------------------
/lib/server.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var app = express()
3 | var server = require('http').createServer(app);
4 | var webRTC = require('webrtc.io').listen(server);
5 |
6 | var port = process.env.PORT || 8000;
7 | server.listen(port);
8 | console.log('listen on http://0.0.0.0:8000')
9 |
10 |
11 | // export static files
12 | app.use('/', express.static(__dirname + '/../'));
13 |
14 | app.get('/rooms', function(req, res) {
15 | var rooms = webRTC.rtc.rooms
16 | res.send(rooms)
17 | })
18 |
19 | app.get('/rouletteRoomName', function(req, res) {
20 | var rooms = webRTC.rtc.rooms
21 | var roomNames = Object.keys(rooms).filter(function(roomName){
22 | return roomName.match(/^lette-/);
23 | });
24 | // try to find a room with only one participant
25 | for(var i = 0; i < roomNames.length; i++){
26 | var roomName = roomNames[i]
27 | var room = rooms[roomName]
28 | if( room.length === 1 ){
29 | res.send({roomName:roomName})
30 | return;
31 | }
32 | }
33 | // pick a random name
34 | var roomName = 'lette-' + Math.floor((Math.random()) * 0x10000).toString(16);
35 | res.send({roomName:roomName})
36 | });
37 |
38 | webRTC.rtc.on('connect', function(rtc) {
39 | //Client connected
40 | });
41 |
42 | webRTC.rtc.on('send answer', function(rtc) {
43 | //answer sent
44 | });
45 |
46 | webRTC.rtc.on('disconnect', function(rtc) {
47 | //Client disconnect
48 | });
49 |
50 | webRTC.rtc.on('chat_msg', function(data, socket) {
51 | var roomList = webRTC.rtc.rooms[data.room] || [];
52 |
53 | for (var i = 0; i < roomList.length; i++) {
54 | var socketId = roomList[i];
55 |
56 | if (socketId !== socket.id) {
57 | var soc = webRTC.rtc.getSocket(socketId);
58 |
59 | if (soc) {
60 | soc.send(JSON.stringify({
61 | "eventName": "receive_chat_msg",
62 | "data": {
63 | "messages": data.messages,
64 | "color": data.color
65 | }
66 | }), function(error) {
67 | if (error) {
68 | console.log(error);
69 | }
70 | });
71 | }
72 | }
73 | }
74 | });
75 |
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/doc.kml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Old Television Set 01
5 | Google SketchUp 7.0.8657]]>
6 | SketchUp
7 | 1
8 |
9 | 29.5425
10 | 69.5454
11 | 53.48298719662231
12 | -2.250012226700597
13 | 2.834899368965995
14 | 1.034892153507135
15 |
16 |
17 | Tour
18 |
19 |
20 | 1
21 |
22 | 29.5425
23 | 69.5454
24 | 53.48298719662231
25 | -2.250012226700597
26 | 2.834899368965995
27 | 1.034892153507135
28 |
29 |
30 |
31 |
32 | Model
33 |
34 |
36 |
37 | relativeToGround
38 |
39 | -2.250000000000
40 | 53.483000000000
41 | 0.000000000000
42 |
43 |
44 | 0
45 | 0
46 | 0
47 |
48 |
49 | 1.0
50 | 1.0
51 | 1.0
52 |
53 |
54 | models/Old Television Set 01.dae
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture0.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture1.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture2.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture3.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture4.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture5.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture6.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture7.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture8.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/images/texture9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/models/OldTelevisionSet01/images/texture9.jpg
--------------------------------------------------------------------------------
/models/OldTelevisionSet01/textures.txt:
--------------------------------------------------------------------------------
1 | <../images/texture0.jpg> <../images/texture0.jpg>
2 | <../images/texture1.jpg> <../images/texture1.jpg>
3 | <../images/texture2.jpg> <../images/texture2.jpg>
4 | <../images/texture3.jpg> <../images/texture3.jpg>
5 | <../images/texture4.jpg> <../images/texture4.jpg>
6 | <../images/texture5.jpg> <../images/texture5.jpg>
7 | <../images/texture6.jpg> <../images/texture6.jpg>
8 | <../images/texture7.jpg> <../images/texture7.jpg>
9 | <../images/texture8.jpg> <../images/texture8.jpg>
10 | <../images/texture9.jpg> <../images/texture9.jpg>
11 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webglvideochat",
3 | "version": "0.0.0-5",
4 | "description": "a video chat in WebGL with WebRTC",
5 | "main": "lib/server.js",
6 | "dependencies": {
7 | "webrtc.io": "latest",
8 | "webrtc.io-client": "latest",
9 | "express": "3.1.0",
10 | "ws": "latest"
11 | },
12 | "devDependencies": {},
13 | "scripts": {
14 | "test": "echo \"Error: no test specified\" && exit 1",
15 | "start": "node lib/server.js"
16 | },
17 | "repository": {
18 | "type": "git",
19 | "url": "git://github.com/jeromeetienne/webglvideochat.git"
20 | },
21 | "keywords": [
22 | "webrtc",
23 | "webgl",
24 | "video",
25 | "chat",
26 | "conference"
27 | ],
28 | "author": "jerome.etienne@gmail.com",
29 | "license": "MIT",
30 | "subdomain": "webglvideochat",
31 | "engines": {
32 | "node": "0.8.x"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/tquery/build/tquery-bundle-require.min.js:
--------------------------------------------------------------------------------
1 | // tquery.js - https://github.com/jeromeetienne/tquery - MIT License
2 |
3 |
--------------------------------------------------------------------------------
/vendor/tquery/build/tquery-bundle.min.js:
--------------------------------------------------------------------------------
1 | // tquery.js - https://github.com/jeromeetienne/tquery - MIT License
2 |
3 |
--------------------------------------------------------------------------------
/vendor/tquery/build/tquery.min.js:
--------------------------------------------------------------------------------
1 | // tquery.js - https://github.com/jeromeetienne/tquery - MIT License
2 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/checkerboard/examples/index.html:
--------------------------------------------------------------------------------
1 |
Minimal tQuery Page
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/checkerboard/tquery.checkerboard.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Create a checkerboard tQuery.Mesh
3 | */
4 | tQuery.registerStatic('createCheckerboard', function(opts){
5 | // handle parameters
6 | opts = tQuery.extend(opts, {
7 | width : 1,
8 | height : 1,
9 | segmentsW : 8,
10 | segmentsH : 8,
11 | materialEven : new THREE.MeshBasicMaterial({ color: 0xcccccc }),
12 | materialOdd : new THREE.MeshBasicMaterial({ color: 0x444444 })
13 | });
14 | // handle polymorphism
15 | if( opts.materialEven instanceof tQuery.Material ) opts.materialEven= opts.materialEven.get(0)
16 | if( opts.materialOdd instanceof tQuery.Material ) opts.materialOdd = opts.materialOdd.get(0)
17 | // create the geometry
18 | var geometry = new THREE.PlaneGeometry( opts.width, opts.height, opts.segmentsW, opts.segmentsH );
19 | // set materials per faces
20 | geometry.faces.forEach(function(face, idx){
21 | var y = Math.floor(idx / opts.segmentsW);
22 | var x = idx - (y*opts.segmentsW);
23 | face.materialIndex = (y % 2 + x%2 ) %2;
24 | });
25 | // create the mesh
26 | var material = new THREE.MeshFaceMaterial([opts.materialEven, opts.materialOdd]);
27 | var mesh = new THREE.Mesh(geometry, material);
28 | mesh.rotation.x = -Math.PI/2;
29 | // return the tQuery
30 | return tQuery(mesh);
31 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/fog/examples/index.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/fog/tquery.world.createfog.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @fileOverview Methods to add/remove fog in tQuery.World
3 | *
4 | * - removeFog isnt done as some wiki pages claim it is impossible
5 | * https://github.com/mrdoob/three.js/wiki/Updates
6 | */
7 |
8 | /**
9 | * add a THREE.FogExp2 to this world.scene()
10 | *
11 | * @param opts the options
12 | * @param opts.colorHex the hexa value of the fog color
13 | * @param opts.density the density of the fog
14 | */
15 | tQuery.World.registerInstance('addFogExp2', function(opts){
16 | // handle parameter
17 | opts = tQuery.extend(opts, {
18 | colorHex : this.tRenderer().getClearColor().getHex(),
19 | density : 0.1
20 | });
21 | // set the fog
22 | this.tScene().fog = new THREE.FogExp2(opts.colorHex, opts.density );
23 | // for chained API
24 | return this;
25 | });
26 |
27 | /**
28 | * add a THREE.Fog to this world.scene()
29 | *
30 | * @param opts the options
31 | * @param opts.colorHex the hexa value of the fog color
32 | * @param opts.near how far away from camera, the fog starts
33 | * @param opts.far how far away from camera, the fog ends
34 | */
35 | tQuery.World.registerInstance('addFog', function(opts){
36 | // handle parameter
37 | opts = tQuery.extend(opts, {
38 | colorHex : this.tRenderer().getClearColor().getHex(),
39 | near : 1,
40 | far : 20
41 | });
42 | // set the fog
43 | this.tScene().fog = new THREE.Fog(opts.colorHex, opts.near, opts.far);
44 | // for chained API
45 | return this;
46 | });
47 |
48 |
49 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/loaders/examples/index.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
4 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/loaders/tquery.loaders.js:
--------------------------------------------------------------------------------
1 | // this file is left empty on purpose.
2 | // It acts as a placeholder for require.js inclusion.
3 | // in production, r.js will automatically remove it.
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/Makefile:
--------------------------------------------------------------------------------
1 | compile:
2 | /usr/local/bin/node bin/tomainconfigfile.js > build/all.confrequire.js
3 |
4 | build: compile
5 | cd examples && r.js -o name=main-dev.js out=../build/main-prod.js \
6 | mainConfigFile=../build/all.confrequire.js \
7 | baseUrl=.
8 |
9 | .PHONY: build
10 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/README.md:
--------------------------------------------------------------------------------
1 | #### NOTES taken on including require.js modules
2 | * plugins/requirejs/confrequire : folder with all plugins configuration for require.js
3 | * [pluginname].confrequire.js is the ```requirejs.config()``` call for each plugin
4 | * [pluginname].initrequire.js is a fake module which is solely intended to update the plugins.baseURL
5 | * usefull for the plugins which need to read/write assets
6 | * for r.js, all plugins/requirejs/confrequire/*.confrequire.js are concatenated in a single file
7 | called ```build/all.confrequire.js```
8 | * this is done by a tools ```bin/tomainconfigfile.js```
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/TODO:
--------------------------------------------------------------------------------
1 | #### TODO
2 | * add more confrequire files
3 | * DONE merge that in tquery-bundle-require
4 | * see how to change directory depth
5 | * from require.js config pov. rewrite rules build/plugins/threex ?
6 | * see baseUrl case
7 | * test it in playground
8 | * no r.js there
9 | * what about url relocation
10 | * i want both to be nice on source and in playground without notification
11 | * it is possible with same level of hierachy for both ?
12 | * testable now with same code as index-dev
13 | * use requirejs.config({baseUrl:'./'})
14 |
15 | tQuery minimal page
16 |
17 |
18 |
19 |
30 |
31 |
32 | #### TODO threejstool
33 | * find a way to test this require.js stuff in a threejstool project
34 | * do the
35 | threejs init [threejs, tquery] default to tquery
36 | threejs library install
37 | threejs library update
38 | threejs plugin install keyboard
39 | threejs plugin list
40 | threejs plugin uninstall keyboard
41 | threejs build
42 |
43 | #### DONE
44 | * DONE tomainconfig.js is a step for r.js
45 | * it is currently mixed in makefile and node.js
46 | * all that will end up in threejstool
47 | * so put it all in node.js
48 | * DONE put require.js in /vendor
49 | * DONE put all.confrequire.js in /build
50 | * DONE put allmerged.confrequire.js /build
51 | * DONE put tomainconfigfile.js in /bin
52 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/bin/tomainconfigfile.js:
--------------------------------------------------------------------------------
1 | // declare a fake requirejs.config() function to merge all calls in a single options object
2 | var output = {}
3 | var requirejs = {};
4 | requirejs.config = function(opts){
5 | // merge opts in output with deep copy
6 | deepExtend(output, opts)
7 |
8 | // from http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/
9 | function deepExtend(dst, src){
10 | for (var property in src) {
11 | if (src[property] && src[property].constructor && src[property].constructor === Object) {
12 | dst[property] = dst[property] || {};
13 | arguments.callee(dst[property], src[property]);
14 | } else {
15 | dst[property] = src[property];
16 | }
17 | }
18 | return dst;
19 | };
20 | }
21 |
22 | // get all filenames in confrequire/*.conrequire.js
23 | var filenames = require('fs').readdirSync('confrequire').filter(function(filename){
24 | return filename.match(/\.confrequire\.js$/)
25 | });
26 | // concat head.confrequire.js and all confrequire/*.configrequire.js
27 | var content = require('fs').readFileSync('head.confrequire.js', 'utf8')
28 | filenames.forEach(function(filename){
29 | content += require('fs').readFileSync('confrequire/'+filename, 'utf8')
30 | })
31 |
32 | // eval every *.confrequire.js config
33 | eval(content)
34 | // output the merged options object for requirejs.config()
35 | console.log('requirejs.config('+JSON.stringify(output, null, '\t')+');')
36 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/cannonjs.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.cannonjs' : 'plugins/cannonjs/tquery.object3d.cannonjs',
5 | }
6 | },
7 | shim : {
8 | 'plugins/cannonjs/tquery.object3d.cannonjs' : [
9 | 'plugins/cannonjs/tquery.world.cannonjs',
10 | 'plugins/cannonjs/vendor/cannon.js/build/cannon'
11 | ]
12 | }
13 | });
14 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/car.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.car' : 'plugins/requirejs/confrequire/car.initrequire',
5 | }
6 | },
7 | shim : {
8 | 'plugins/requirejs/confrequire/car.initrequire' : [
9 | 'plugins/car/tquery.car',
10 | 'plugins/car/Car',
11 | 'plugins/car/tquery.car.keyboard',
12 | 'plugins/car/tquery.car.cameracontrols',
13 | 'plugins/car/tquery.car.deviceorientation',
14 | ],
15 | 'plugins/car/tquery.car.deviceorientation' : [
16 | 'plugins/car/tquery.car'
17 | ],
18 | 'plugins/car/tquery.car.cameracontrols' : [
19 | 'plugins/car/tquery.car'
20 | ],
21 | 'plugins/car/tquery.car.keyboard' : [
22 | 'plugins/car/tquery.car'
23 | ],
24 | }
25 | });
26 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/car.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'plugins/car/tquery.car'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.Car.baseUrl = module.uri+'/../../../car/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/checkerboard.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.checkerboard' : 'plugins/checkerboard/tquery.checkerboard',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/colornames.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.colornames' : 'plugins/colornames/tquery.colornames',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/controls.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.controls' : 'plugins/controls/tquery.controlstween',
5 | }
6 | },
7 | shim : {
8 | 'plugins/controls/tquery.controlstween' : [
9 | 'plugins/controls/tquery.controlswrapper',
10 | 'three.js/examples/js/controls/FirstPersonControls',
11 | 'three.js/examples/js/controls/OrbitControls',
12 | 'three.js/examples/js/controls/PointerLockControls',
13 | 'three.js/examples/js/controls/TrackballControls',
14 | 'three.js/examples/js/controls/FlyControls',
15 | 'three.js/examples/js/controls/PathControls',
16 | 'three.js/examples/js/controls/RollControls',
17 | ]
18 | }
19 | });
20 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/csg.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.csg' : 'plugins/csg/tquery.geometry.csg',
5 | }
6 | },
7 | shim : {
8 | // fake dependancy here
9 | 'plugins/csg/tquery.geometry.csg' : [
10 | 'plugins/csg/csg',
11 | 'plugins/csg/ThreeCSG',
12 | 'plugins/csg/tquery.object3d.csg',
13 | ]
14 | }
15 | });
16 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/datguituner.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.datguituner' : 'plugins/datguituner/tquery.datguituner',
5 | }
6 | },
7 | shim : {
8 | 'plugins/datguituner/tquery.datguituner' : [
9 | 'plugins/assets/vendor/dat.gui/dat.gui',
10 | 'plugins/assets/vendor/dat.gui/dat.color'
11 | ]
12 | }
13 | });
14 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/deviceorientation.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.deviceorientation' : 'plugins/deviceorientation/tquery.deviceorientation',
5 | }
6 | },
7 | shim : {
8 | 'plugins/deviceorientation/tquery.deviceorientation' : [
9 | 'threex/THREEx.DeviceOrientationState',
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/domevent.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.domevent' : 'plugins/domevent/tquery.domevent',
5 | }
6 | },
7 | shim : {
8 | 'plugins/domevent/tquery.domevent' : [
9 | 'plugins/domevent/threex.domevent',
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/fireball.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.fireball' : 'plugins/fireball/tquery.fireballmaterial',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/fog.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.fog' : 'plugins/fog/tquery.world.createfog',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/grassground.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.grassground' : 'plugins/requirejs/confrequire/grassground.initrequire',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/grassground.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'plugins/grassground/tquery.grassground'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.createGrassGround.baseUrl = module.uri+'/../../../grassground/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/gsvpano.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.gsvpano' : 'plugins/gsvpano/tquery.gsvpano',
5 | }
6 | },
7 | shim : {
8 | 'plugins/gsvpano/tquery.gsvpano' : [
9 | // MUST be included manually 'http://maps.google.com/maps/api/js?sensor=false',
10 | 'plugins/gsvpano/vendor/GSVPano'
11 | ]
12 | }
13 | });
14 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/headtrackr.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.headtrackr' : 'plugins/headtrackr/tquery.headtrackr',
5 | }
6 | },
7 | shim : {
8 | 'plugins/headtrackr/tquery.headtrackr' : [
9 | 'plugins/headtrackr/vendor/headtrackr'
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/keyboard.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.keyboard' : 'plugins/keyboard/tquery.keyboard',
5 | }
6 | },
7 | shim : {
8 | 'plugins/keyboard/tquery.keyboard' : [
9 | 'threex/THREEx.KeyboardState',
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/lavamaterial.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.lavamaterial' : 'plugins/requirejs/confrequire/lavamaterial.initrequire',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/lavamaterial.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'plugins/lavamaterial/tquery.lavamaterial'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.Object3D.prototype.setLavaMaterial.baseUrl = module.url+'/../../../lavamaterial/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/lensflare.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.lensflare' : 'plugins/requirejs/confrequire/lensflare.initrequire',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/lensflare.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'plugins/lensflare/tquery.lensflare'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.createLensFlare.baseUrl = module.uri+'/../../../lensflare/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/light.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.shadowmap' : 'plugins/light/tquery.light.shadow',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/lightsaber.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.lightsaber' : 'plugins/lightsaber/tquery.lightsaber',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/linkify.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.linkify' : 'plugins/linkify/tquery.mesh.linkify',
5 | }
6 | },
7 | shim : {
8 | 'plugins/linkify/tquery.mesh.linkify' : [
9 | 'tquery.domevent',
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/loaders.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.loaders' : 'plugins/loaders/tquery.loaders',
5 | }
6 | },
7 | shim : {
8 | 'plugins/loaders/tquery.loaders' : [
9 | 'three.js/examples/js/loaders/BinaryLoader',
10 | 'three.js/examples/js/loaders/MTLLoader',
11 | 'three.js/examples/js/loaders/OBJMTLLoader',
12 | 'three.js/examples/js/loaders/STLLoader',
13 | 'three.js/examples/js/loaders/VTKLoader',
14 | 'three.js/examples/js/loaders/ColladaLoader',
15 | 'three.js/examples/js/loaders/OBJLoader',
16 | 'three.js/examples/js/loaders/PDBLoader',
17 | 'three.js/examples/js/loaders/UTF8Loader'
18 | ]
19 | }
20 | });
21 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/md2character.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.md2character' : 'plugins/requirejs/confrequire/md2character.initrequire',
5 | }
6 | },
7 | shim : {
8 | 'plugins/requirejs/confrequire/md2character.initrequire' : [
9 | 'plugins/md2character/tquery.md2character',
10 | 'plugins/md2character/tquery.md2character.cameracontrols',
11 | 'plugins/md2character/tquery.md2character.ratamahatta',
12 | 'plugins/md2character/tquery.md2character.ratamahatta.keyboard',
13 | ],
14 | 'plugins/md2character/tquery.md2character.cameracontrols' : [
15 | 'plugins/md2character/tquery.md2character'
16 | ],
17 | 'plugins/md2character/tquery.md2character.ratamahatta' : [
18 | 'plugins/md2character/tquery.md2character'
19 | ],
20 | 'plugins/md2character/tquery.md2character.ratamahatta.keyboard' : [
21 | 'plugins/md2character/tquery.md2character.ratamahatta'
22 | ],
23 | }
24 | });
25 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/md2character.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'plugins/md2character/tquery.md2character.ratamahatta'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.RatamahattaMD2Character.baseUrl = module.uri+'/../../../md2character/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/minecraft.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.minecraft' : 'plugins/requirejs/confrequire/minecraft.initrequire',
5 | }
6 | },
7 | shim : {
8 | 'plugins/requirejs/confrequire/minecraft.initrequire' : [
9 | 'plugins/minecraft/tquery.midikeytween',
10 |
11 | // this is all obsoleted by tquery.minecraftcharcontrols
12 | 'plugins/minecraft/tquery.minecraftchar',
13 | 'plugins/minecraft/tquery.minecraftchar.keyboard2',
14 | 'tquery.keyboard',
15 |
16 | 'plugins/minecraft/tquery.minecraftcharcontrols',
17 |
18 |
19 | 'plugins/minecraft/tquery.camerafpscontrols',
20 |
21 |
22 | 'plugins/minecraft/tquery.spritesheet',
23 | 'plugins/minecraft/tquery.minecraftcharanimations',
24 | 'plugins/minecraft/tquery.minecraftcharheadanimations',
25 | ],
26 | 'plugins/minecraft/tquery.minecraftcharanimations' : [
27 | 'plugins/minecraft/tquery.animations'
28 | ],
29 | 'plugins/minecraft/tquery.minecraftcharheadanimations' : [
30 | 'plugins/minecraft/tquery.animations'
31 | ],
32 | 'plugins/minecraft/tquery.animations' : [
33 | 'plugins/minecraft/tquery.animation',
34 | ]
35 | }
36 | });
37 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/minecraft.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.MinecraftChar.baseUrl = module.uri+'/../../../minecraft/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/modifiers.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.modifiers' : 'plugins/modifiers/tquery.geometry.smooth',
5 | }
6 | },
7 | shim : {
8 | 'plugins/modifiers/tquery.geometry.smooth' : [
9 | 'three.js/examples/js/modifiers/ExplodeModifier',
10 | 'three.js/examples/js/modifiers/SubdivisionModifier',
11 | 'three.js/examples/js/modifiers/TessellateModifier',
12 | ]
13 | }
14 | });
15 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/montainarena.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.montainarena' : 'plugins/montainarena/tquery.montainarena',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/objectcoord.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.objectcoord' : 'plugins/objectcoord/tquery.object3d.coordinate',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/physics.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.physics' : 'plugins/physics/tquery.physijs',
5 | }
6 | },
7 | shim : {
8 | 'plugins/physics/tquery.physijs' : [
9 | 'plugins/physics/vendor/physijs/physi'
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/planets.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.planets' : 'plugins/requirejs/confrequire/planets.initrequire',
5 | }
6 | },
7 | shim : {
8 | 'plugins/requirejs/confrequire/planets.initrequire' : [
9 | 'plugins/planets/tquery.createplanet'
10 | ]
11 | }
12 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/planets.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'plugins/planets/tquery.createplanet'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.createPlanet.baseUrl = module.uri+'/../../../planets/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/playerinput.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.playerinput' : 'plugins/playerinput/tquery.playerinput.keyboard',
5 | }
6 | },
7 | shim : {
8 | 'plugins/playerinput/tquery.playerinput.keyboard' : [
9 | 'tquery.keyboard',
10 | 'plugins/playerinput/tquery.playerinput',
11 | // not really needed, just to chain the load
12 | 'plugins/playerinput/tquery.playerinput.virtualjoystick',
13 | ],
14 | 'plugins/playerinput/tquery.playerinput.virtualjoystick': [
15 | 'tquery.virtualjoystick',
16 | 'plugins/playerinput/tquery.playerinput'
17 | ]
18 | }
19 | });
20 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/poolball.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.poolball' : 'plugins/poolball/tquery.poolball',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/pproc.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.pproc' : 'plugins/pproc/tquery.effectcomposer',
5 | }
6 | },
7 | shim : {
8 | 'plugins/pproc/tquery.effectcomposer' : [
9 | 'three.js/examples/js/shaders/BleachBypassShader' ,
10 | 'three.js/examples/js/shaders/BlendShader' ,
11 | 'three.js/examples/js/shaders/CopyShader' ,
12 | 'three.js/examples/js/shaders/ColorifyShader' ,
13 | 'three.js/examples/js/shaders/ConvolutionShader' ,
14 | 'three.js/examples/js/shaders/FilmShader' ,
15 | 'three.js/examples/js/shaders/FXAAShader' ,
16 | 'three.js/examples/js/shaders/HorizontalBlurShader' ,
17 | 'three.js/examples/js/shaders/SepiaShader' ,
18 | 'three.js/examples/js/shaders/VerticalBlurShader' ,
19 | 'three.js/examples/js/shaders/VignetteShader' ,
20 |
21 | 'three.js/examples/js/postprocessing/EffectComposer' ,
22 | 'three.js/examples/js/postprocessing/BloomPass' ,
23 | 'three.js/examples/js/postprocessing/DotScreenPass' ,
24 | 'three.js/examples/js/postprocessing/FilmPass' ,
25 | 'three.js/examples/js/postprocessing/MaskPass' ,
26 | 'three.js/examples/js/postprocessing/RenderPass' ,
27 | 'three.js/examples/js/postprocessing/SavePass' ,
28 | 'three.js/examples/js/postprocessing/ShaderPass' ,
29 | 'three.js/examples/js/postprocessing/TexturePass'
30 | ]
31 | }
32 | });
33 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/shadowmap.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.shadowmap' : 'plugins/shadowmap/tquery.light.shadowmap',
5 | }
6 | },
7 | shim : {
8 | 'plugins/shadowmap/tquery.light.shadowmap' : [
9 | 'plugins/shadowmap/tquery.world.shadowmap',
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/shape.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.shape' : 'plugins/shape/tquery.shape',
5 | }
6 | },
7 | shim : {
8 | 'plugins/shape/tquery.shape' : [
9 | 'plugins/shape/tquery.shape.create'
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/simplemaze.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.simplemaze' : 'plugins/simplemaze/tquery.simplemaze',
5 | }
6 | },
7 | shim : {
8 | 'plugins/simplemaze/tquery.simplemaze' : [
9 | 'plugins/simplemaze/tquery.simplemaze.pathfinding',
10 | 'plugins/simplemaze/vendor/pathfinding-browser',
11 | ]
12 | }
13 | });
14 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/skymap.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.skymap' : 'plugins/skymap/tquery.skymap',
5 | }
6 | },
7 | shim : {
8 | 'plugins/skymap/tquery.skymap' : [
9 | 'plugins/skymap/tquery.cubetexture'
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/statplus.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.statsplus' : 'plugins/statsplus/tquery.statsplus',
5 | }
6 | },
7 | shim : {
8 | 'plugins/statsplus/tquery.statsplus' : [
9 | 'plugins/statsplus/statsdelay',
10 | 'plugins/statsplus/statsmemory',
11 | 'plugins/statsplus/statsthreejswebgl'
12 | ]
13 | }
14 | });
15 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/text.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.text' : 'plugins/text/tquery.text',
5 | }
6 | },
7 | shim : {
8 | 'plugins/text/tquery.text' : [
9 | // load a font by default
10 | 'plugins/text/fonts/droid/droid_serif_bold.typeface'
11 | ]
12 | }
13 | });
14 |
15 | requirejs.config({
16 | map : {
17 | "*" : {
18 | 'tquery.text.allfonts' : 'plugins/text/fonts/droid/droid_serif_regular.typeface',
19 | }
20 | },
21 | shim : {
22 | 'plugins/text/fonts/droid/droid_serif_regular.typeface' : [
23 | 'plugins/text/fonts/gentilis_bold.typeface',
24 | 'plugins/text/fonts/gentilis_regular.typeface',
25 | 'plugins/text/fonts/optimer_bold.typeface',
26 | 'plugins/text/fonts/optimer_regular.typeface',
27 | 'plugins/text/fonts/helvetiker_bold.typeface',
28 | 'plugins/text/fonts/helvetiker_regular.typeface',
29 | 'plugins/text/fonts/droid/droid_sans_regular.typeface',
30 | 'plugins/text/fonts/droid/droid_sans_bold.typeface',
31 | 'plugins/text/fonts/droid/droid_serif_bold.typeface',
32 | ]
33 | }
34 | });
35 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/textureutils.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.textureutils' : 'plugins/textureutils/tquery.textureutils',
5 | }
6 | },
7 | shim : {
8 | 'plugins/textureutils/tquery.textureutils' : [
9 | 'plugins/textureutils/tquery.material.texturescrolling'
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/tweenjs.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.tweenjs' : 'plugins/tweenjs/tquery.tween',
5 | }
6 | },
7 | shim : {
8 | 'plugins/tweenjs/tquery.tween' : [
9 | 'plugins/tweenjs/vendor/Tween'
10 | ]
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/vertexanimation.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.vertexanimation' : 'plugins/vertexanimation/tquery.geometry.vertexanimation',
5 | }
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/videos.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.videos' : 'plugins/videos/tquery.createvideotexture',
5 | }
6 | },
7 | shim : {
8 | 'plugins/videos/tquery.createvideotexture' : [
9 | 'plugins/videos/tquery.audiovideotexture',
10 | 'plugins/videos/tquery.createwebcamtexture',
11 | 'plugins/videos/tquery.createtvsnowtexture'
12 | ]
13 | }
14 | });
15 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/virtualjoystick.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.virtualjoystick' : 'plugins/virtualjoystick/vendor/virtualjoystick',
5 | }
6 | }
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/webaudio.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.webaudio' : 'plugins/requirejs/confrequire/webaudio.initrequire',
5 | }
6 | },
7 | shim : {
8 | 'plugins/requirejs/confrequire/webaudio.initrequire' : [
9 | 'plugins/webaudio/vendor/webaudio-bundle',
10 | 'plugins/webaudio/vendor/webaudio.sound.jsfx',
11 | 'plugins/webaudio/vendor/jsfx/jsfx',
12 | 'plugins/webaudio/vendor/jsfx/jsfxlib'
13 | ],
14 | 'plugins/webaudio/vendor/webaudio.sound.jsfx' : [
15 | 'plugins/webaudio/vendor/webaudio-bundle'
16 | ],
17 | 'plugins/webaudio/vendor/jsfx/jsfx' : [
18 | 'plugins/webaudio/vendor/jsfx/audio'
19 | ],
20 | 'plugins/webaudio/vendor/jsfx/jsfxlib' : [
21 | 'plugins/webaudio/vendor/jsfx/jsfx'
22 | ],
23 | }
24 | });
25 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/webaudio.initrequire.js:
--------------------------------------------------------------------------------
1 | define([], function(){
2 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/webglinspector.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | // NOTE: require(['webgl-inspector', 'domReady!'], function(){})
4 | // - the 'domReady!' wait for the dom to be ready, it is required by webgl-inspector
5 | // TODO: is that possible to make 'domReady!' as a kind of dependancy
6 | // - i tried and failed up to know
7 | "*" : {
8 | 'webgl-inspector' : 'plugins/requirejs/confrequire/webglinspector.initrequire',
9 | 'domReady' : 'plugins/requirejs/vendor/domReady',
10 | }
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/webglinspector.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module', 'http://benvanik.github.com/WebGL-Inspector/core/embed.js',
2 | 'domReady!'], function(module){
3 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/webrtcio.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.webrtcio' : 'plugins/webrtcio/vendor/webrtc.io-client/webrtc.io',
5 | }
6 | }
7 | });
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/whammy.confrequire.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | map : {
3 | "*" : {
4 | 'tquery.whammy' : 'plugins/requirejs/confrequire/whammy.initrequire',
5 | }
6 | },
7 | shim : {
8 | 'plugins/requirejs/confrequire/whammy.initrequire' : [
9 | 'plugins/whammy/vendor/whammy',
10 | 'plugins/whammy/tquery.whammy',
11 | 'plugins/whammy/tquery.whammy.bindkeyboard',
12 | 'plugins/whammy/tquery.whammyUI',
13 | ],
14 | 'plugins/whammy/tquery.whammy.bindkeyboard' : [
15 | 'plugins/whammy/tquery.whammy'
16 | ],
17 | }
18 | });
19 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/confrequire/whammy.initrequire.js:
--------------------------------------------------------------------------------
1 | define(['module'], function(module){
2 | // set baseUrl for this plugin
3 | tQuery.Whammy.baseUrl = module.uri+'/../../../whammy/';
4 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/index-manual.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/index-planets.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/index-prod.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/main-dev.js:
--------------------------------------------------------------------------------
1 | require(['tquery.planets'], function(){
2 |
3 | var world = tQuery.createWorld().boilerplate().start();
4 | var planet = tQuery.createPlanet().id('obj').addTo(world);
5 |
6 | // setup light
7 | tQuery.createDirectionalLight().addTo(world).position(1,1,1);
8 | tQuery.createDirectionalLight().addTo(world).position(-1,1,1);
9 | tQuery.createAmbientLight().addTo(world).color(0xFFFFFF);
10 |
11 | // make the object rotate
12 | world.hook(function(delta, now){
13 | var angle = 0.05 * now * Math.PI * 2;
14 | planet.get(0).rotation.y = angle;
15 | });
16 |
17 | });
18 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/manual_minimalpage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/manual_modwithbaseurl.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/manual_namealias.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
39 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/examples/minimal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/footer.js:
--------------------------------------------------------------------------------
1 | (function(){
2 |
3 | return; // FIXME this fails on jsfiddle + corsproxy
4 | // find something compatible
5 |
6 |
7 | // get the script dom element which included the library
8 | var scripts = document.getElementsByTagName('script');
9 | var scriptEl = scripts[scripts.length-1];
10 | var url = scriptEl.src;
11 | var suffix = '/build/tquery-bundle-require.js';
12 | // if the element url DOES NOT endup with suffix, do nothing
13 | if(url.indexOf(suffix, url.length - suffix.length) === -1) return;
14 | // get the baseURL
15 | var baseURL = url.substr(0, url.length - suffix.length)
16 | // configure require.js using this baseUrl
17 | requirejs.config({
18 | paths : {
19 | "build" : baseURL+'/build',
20 | "plugins" : baseURL+'/plugins',
21 | "threex" : baseURL+'/vendor/threex',
22 | "three.js" : baseURL+'/vendor/three.js',
23 | },
24 | });
25 | })();
26 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/requirejs/head.confrequire.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @fileoverview this is the initial requirejs.config(). the one which establish the
3 | * path of each parts of the project.
4 | * TODO is it generic enought ? could it be using baseURL ?
5 | */
6 | requirejs.config({
7 | paths : {
8 | "build" : "../../../build",
9 | "plugins" : "../../../plugins",
10 | "threex" : '../../../vendor/threex',
11 | "three.js" : '../../../vendor/three.js',
12 | },
13 | });
14 |
15 |
16 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/shadowmap/examples/index.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
17 |
18 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/shadowmap/examples/test-cascadeshadowmap.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/shadowmap/examples/test-hemispherelight.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
22 |
23 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/shadowmap/tquery.light.shadowmap.js:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////////////
2 | // comment //
3 | //////////////////////////////////////////////////////////////////////////////////
4 |
5 | /**
6 | * little helper to set the width and height of the shadowMap
7 | */
8 | tQuery.DirectionalLight.registerInstance('shadowMap', function(width, height){
9 | return this.shadowMapWidth(width).shadowMapHeight(height);
10 | });
11 |
12 | /**
13 | * little helper to set all shadowCamera params
14 | */
15 | tQuery.DirectionalLight.registerInstance('shadowCamera', function(right, left, top, bottom, near, far){
16 | if( near !== undefined && far !== undefined ){
17 | this.shadowCameraNear(near).shadowCameraFar(far);
18 | }
19 | return this.shadowCameraRight(right)
20 | .shadowCameraLeft(left)
21 | .shadowCameraTop(top)
22 | .shadowCameraBottom(bottom);
23 | });
24 |
25 | //////////////////////////////////////////////////////////////////////////////////
26 | // comment //
27 | //////////////////////////////////////////////////////////////////////////////////
28 |
29 | tQuery.SpotLight.registerInstance('shadowMap', function(width, height){
30 | return this.shadowMapWidth(width).shadowMapHeight(height);
31 | });
32 |
33 | /**
34 | * little helper to set all shadowCamera params
35 | */
36 | tQuery.SpotLight.registerInstance('shadowCamera', function(right, left, top, bottom, near, far){
37 | if( near !== undefined && far !== undefined ){
38 | this.shadowCameraNear(near).shadowCameraFar(far);
39 | }
40 | return this.shadowCameraRight(right)
41 | .shadowCameraLeft(left)
42 | .shadowCameraTop(top)
43 | .shadowCameraBottom(bottom);
44 | });
45 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/shadowmap/tquery.world.shadowmap.js:
--------------------------------------------------------------------------------
1 | tQuery.World.registerInstance('shadowMapEnabled', function(value){
2 | this.tRenderer().shadowMapEnabled = value;
3 | return this;
4 | });
5 |
6 | tQuery.World.registerInstance('shadowMapSoft', function(value){
7 | this.tRenderer().shadowMapSoft = value;
8 | return this;
9 | });
10 |
11 | tQuery.World.registerInstance('shadowMapDebug', function(value){
12 | this.tRenderer().shadowMapSoft = value;
13 | return this;
14 | });
15 |
16 | tQuery.World.registerInstance('shadowMapCascade', function(value){
17 | this.tRenderer().shadowMapCascade = value;
18 | return this;
19 | });
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/examples/audiovideotexture.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/examples/images/youtube_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/videos/examples/images/youtube_32x32.png
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/examples/index.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/readme.md:
--------------------------------------------------------------------------------
1 | # tQuery.videos
2 |
3 | It is a plugin to handle videos.
4 |
5 |
6 | ## API
7 |
8 | to create a snow texture, use
9 | ```
10 | tQuery.createTVSnowTexture()
11 | ```
12 |
13 | to create a texture from a video, use
14 | ```
15 | var tTexture = tQuery.createVideoTexture(url);
16 | // here tTexture.image is the video element being played
17 | ```
18 |
19 | to create a texture from a webcam, use
20 | ```
21 | var tTexture = tQuery.createWebcamTexture();
22 | ```
23 |
24 | to create a audio/video texture from a video, use
25 | ```
26 | // create the texture
27 | var url = '../../assets/videos/sintel.ogv';
28 | var avTexture = tQuery.createAudioVideoTexture(url);
29 | // set it as material
30 | object3D.setBasicMaterial()
31 | .map(avTexture.tTexture()) // To get the video
32 | .back()
33 | // make the sound follow the object
34 | avTexture.addEventListener('soundReady', function(){
35 | avTexture.sound().follow(object3D)
36 | })
37 | ```
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/tquery.audiovideotexture.js:
--------------------------------------------------------------------------------
1 | tQuery.registerStatic('createAudioVideoTexture', function(opts){
2 | return new tQuery.AudioVideoTexture(opts)
3 | })
4 |
5 |
6 | tQuery.registerStatic('AudioVideoTexture', function(opts){
7 | // handle arguments polymorphism
8 | if( arguments.length === 1 && typeof opts === 'string' ){
9 | opts = { url : arguments[0] };
10 | }
11 | // handle default arguments
12 | opts = tQuery.extend(opts, {
13 | world : tQuery.world
14 | });
15 | // arguments sanity check
16 | console.assert( opts.url, "url MUST be specified" )
17 |
18 | this._world = opts.world;
19 |
20 | // create the video element
21 | var video = document.createElement('video');
22 | video.width = 320;
23 | video.height = 240;
24 | video.autoplay = true;
25 | video.loop = true;
26 | video.src = opts.url;
27 | this._video = video
28 |
29 | // create the texture
30 | this._tTexture = new THREE.Texture( video );
31 | // hook a function to update the texture
32 | this._callback = this._world.hook(function(){
33 | if( video.readyState !== video.HAVE_ENOUGH_DATA ) return;
34 | this._tTexture.needsUpdate = true;
35 | }.bind(this));
36 |
37 |
38 | // wait until the vid is loaded
39 | this._video.addEventListener('canplaythrough', function(event){
40 | var webaudio = this._world.getWebAudio();
41 | // creating custom nodeChain
42 | var nodesChain = WebAudio.NodeChainBuilder.create(webaudio.context())
43 | .mediaElementSource(this._video)
44 | .gainNode().analyser().panner()
45 | // creating the sound itself
46 | this._sound = tQuery.createSound(this._world, nodesChain);
47 | // trigger the event
48 | this.dispatchEvent('soundReady')
49 | }.bind(this));
50 | });
51 |
52 | tQuery.AudioVideoTexture.prototype.destroy = function() {
53 | world.unhook(this._callback)
54 | };
55 |
56 | // make it eventable
57 | tQuery.MicroeventMixin(tQuery.AudioVideoTexture.prototype)
58 |
59 | //////////////////////////////////////////////////////////////////////////////////
60 | // //
61 | //////////////////////////////////////////////////////////////////////////////////
62 |
63 | tQuery.AudioVideoTexture.prototype.video = function() {
64 | return this._video;
65 | };
66 |
67 | tQuery.AudioVideoTexture.prototype.tTexture = function() {
68 | return this._tTexture;
69 | };
70 |
71 | tQuery.AudioVideoTexture.prototype.sound = function() {
72 | return this._sound;
73 | };
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/tquery.createtvsnowtexture.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Create tQuery.Scene.
3 | *
4 | * TODO to optim with a sprite sheet. currently it push a change the canvas
5 | * at every frame. a spritesheet will allow to only change the UV
6 | */
7 | tQuery.registerStatic('createTVSnowTexture', function(opts){
8 | // handle parameters
9 | opts = tQuery.extend(opts, {
10 | loop : tQuery.world.loop(),
11 | width : 256,
12 | height : 256,
13 | nCanvases : 10
14 | });
15 | /**
16 | * Create a canvas with tv-like snow.
17 | *
18 | * May be better with some aliasing
19 | */
20 | var createSnowCanvas = function(width, height){
21 | var canvas = document.createElement('canvas');
22 | var context = canvas.getContext('2d');
23 | canvas.width = width;
24 | canvas.height = height;
25 |
26 | var imageData = context.createImageData(canvas.width, canvas.height);
27 | var pix = imageData.data;
28 | // Loop over each pixel and set a transparent red.
29 | for(var i = 0; i < pix.length; i += 4){
30 | var intensity = Math.floor(Math.random() * 256);
31 | pix[i ] = intensity;
32 | pix[i+1] = intensity;
33 | pix[i+2] = intensity;
34 | pix[i+3] = 255;
35 | }
36 | context.putImageData(imageData, 0,0);
37 | return canvas;
38 | }
39 | // create all the snows canvases
40 | var canvases = [];
41 | for( var i = 0; i < opts.nCanvases; i++ ){
42 | var canvas = createSnowCanvas(opts.width, opts.height);
43 | canvases.push(canvas)
44 | }
45 |
46 | // create destination canvas
47 | var canvas = document.createElement('canvas');
48 | var context = canvas.getContext('2d');
49 | canvas.width = opts.width;
50 | canvas.height = opts.height;
51 |
52 | // create the texture
53 | var texture = new THREE.Texture(canvas)
54 | // make the canvases loop
55 | var canvasIdx = 0;
56 | opts.loop.hook(function(){
57 | context.drawImage(canvases[canvasIdx], 0, 0);
58 | canvasIdx = (canvasIdx+1) % canvases.length;
59 | texture.needsUpdate = true;
60 | })
61 | // return the texture
62 | return texture;
63 | });
64 |
65 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/tquery.createvideotexture.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Create tQuery.Scene
3 | */
4 | tQuery.registerStatic('createVideoTexture', function(opts){
5 | // arguments polymorphism
6 | if( arguments.length === 1 && typeof opts === 'string' ){
7 | opts = { url : arguments[0] };
8 | }
9 | // arguments default values
10 | opts = tQuery.extend(opts, {
11 | world : tQuery.world
12 | });
13 | // argument sanity check
14 | console.assert( opts.url, "url MUST be specified" )
15 |
16 | // create the video element
17 | var video = document.createElement('video');
18 | video.width = 320;
19 | video.height = 240;
20 | video.autoplay = true;
21 | video.loop = true;
22 | video.src = opts.url;
23 |
24 | // create the texture
25 | var texture = new THREE.Texture( video );
26 |
27 | // how do i stop that ?
28 | var callback = opts.world.hook(function(){
29 | if( video.readyState === video.HAVE_ENOUGH_DATA ){
30 | texture.needsUpdate = true;
31 | }
32 | });
33 |
34 | // FIXME this is a poorly coded
35 | texture.poorlyCodedClose = function(){
36 | opts.world.unhook(callback)
37 | }
38 |
39 | return texture;
40 | });
41 |
42 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/videos/tquery.createwebcamtexture.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Create tQuery.Scene
3 | */
4 | tQuery.registerStatic('createWebcamTexture', function(opts){
5 | // handle parameters
6 | opts = tQuery.extend(opts, {
7 | loop : tQuery.world.loop()
8 | });
9 |
10 | var video = document.createElement('video');
11 | video.width = 320;
12 | video.height = 240;
13 | video.autoplay = true;
14 | video.loop = true;
15 |
16 | var hasUserMedia = navigator.webkitGetUserMedia ? true : false;
17 | console.log("UserMedia is detected", hasUserMedia);
18 |
19 | var texture;
20 |
21 | if( hasUserMedia ){
22 | navigator.webkitGetUserMedia({video:true}, function(stream){
23 | video.src = webkitURL.createObjectURL(stream);
24 | console.log("pseudo object URL", video.src);
25 | }, function(error){
26 | alert('you got no WebRTC webcam');
27 | });
28 | texture = new THREE.Texture( video );
29 | }
30 |
31 | opts.loop.hook(function(){
32 | if( video.readyState === video.HAVE_ENOUGH_DATA ){
33 | texture.needsUpdate = true;
34 | }
35 | });
36 |
37 | return texture;
38 | });
39 |
40 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/examples/index.html:
--------------------------------------------------------------------------------
1 | Minimal tQuery Page
2 |
3 |
4 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_x.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_x_180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_x_180.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_y.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_y.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_y_180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_y_180.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_z.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_z.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_z_180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_negative_z_180.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_x.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_x_180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_x_180.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_y.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_y.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_y_180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_y_180.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_z.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_z.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_z_180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/mars_positive_z_180.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/orientation_convention.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/cubemap_mars/orientation_convention.png
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/images/webrtc_black_20p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/images/webrtc_black_20p.png
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/doc.kml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Old Television Set 01
5 | Google SketchUp 7.0.8657]]>
6 | SketchUp
7 | 1
8 |
9 | 29.5425
10 | 69.5454
11 | 53.48298719662231
12 | -2.250012226700597
13 | 2.834899368965995
14 | 1.034892153507135
15 |
16 |
17 | Tour
18 |
19 |
20 | 1
21 |
22 | 29.5425
23 | 69.5454
24 | 53.48298719662231
25 | -2.250012226700597
26 | 2.834899368965995
27 | 1.034892153507135
28 |
29 |
30 |
31 |
32 | Model
33 |
34 |
36 |
37 | relativeToGround
38 |
39 | -2.250000000000
40 | 53.483000000000
41 | 0.000000000000
42 |
43 |
44 | 0
45 | 0
46 | 0
47 |
48 |
49 | 1.0
50 | 1.0
51 | 1.0
52 |
53 |
54 | models/Old Television Set 01.dae
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture0.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture1.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture2.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture3.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture4.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture5.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture6.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture7.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture8.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/images/texture9.jpg
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/olddemo/models/OldTelevisionSet01/textures.txt:
--------------------------------------------------------------------------------
1 | <../images/texture0.jpg> <../images/texture0.jpg>
2 | <../images/texture1.jpg> <../images/texture1.jpg>
3 | <../images/texture2.jpg> <../images/texture2.jpg>
4 | <../images/texture3.jpg> <../images/texture3.jpg>
5 | <../images/texture4.jpg> <../images/texture4.jpg>
6 | <../images/texture5.jpg> <../images/texture5.jpg>
7 | <../images/texture6.jpg> <../images/texture6.jpg>
8 | <../images/texture7.jpg> <../images/texture7.jpg>
9 | <../images/texture8.jpg> <../images/texture8.jpg>
10 | <../images/texture9.jpg> <../images/texture9.jpg>
11 |
--------------------------------------------------------------------------------
/vendor/tquery/plugins/webrtcio/readme.md:
--------------------------------------------------------------------------------
1 | # tquery.webrtcio
2 |
3 | tquery.webrtcio is a plugin for
4 | [webrtc.io](https://github.com/webRTC/webRTC.io).
5 | A library to easily handle webrtc.
6 | there is a
7 | [client](https://github.com/webRTC/webrtc.io-client)
8 | and a
9 | [server](https://github.com/webRTC/webRTC.io).
10 | You can see their
11 | [demo online](http://webrtc.dennis.is/)
12 |
13 | ## API
14 |
15 | It is basically a way to include webrtc.io client in tQuery require.js.
16 | no new api is provided
17 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/Detector.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | * @author mr.doob / http://mrdoob.com/
4 | */
5 |
6 | var Detector = {
7 |
8 | canvas: !! window.CanvasRenderingContext2D,
9 | webgl: ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
10 | workers: !! window.Worker,
11 | fileapi: window.File && window.FileReader && window.FileList && window.Blob,
12 |
13 | getWebGLErrorMessage: function () {
14 |
15 | var element = document.createElement( 'div' );
16 | element.id = 'webgl-error-message';
17 | element.style.fontFamily = 'monospace';
18 | element.style.fontSize = '13px';
19 | element.style.fontWeight = 'normal';
20 | element.style.textAlign = 'center';
21 | element.style.background = '#fff';
22 | element.style.color = '#000';
23 | element.style.padding = '1.5em';
24 | element.style.width = '400px';
25 | element.style.margin = '5em auto 0';
26 |
27 | if ( ! this.webgl ) {
28 |
29 | element.innerHTML = window.WebGLRenderingContext ? [
30 | 'Your graphics card does not seem to support WebGL.
',
31 | 'Find out how to get it here.'
32 | ].join( '\n' ) : [
33 | 'Your browser does not seem to support WebGL.
',
34 | 'Find out how to get it here.'
35 | ].join( '\n' );
36 |
37 | }
38 |
39 | return element;
40 |
41 | },
42 |
43 | addGetWebGLMessage: function ( parameters ) {
44 |
45 | var parent, id, element;
46 |
47 | parameters = parameters || {};
48 |
49 | parent = parameters.parent !== undefined ? parameters.parent : document.body;
50 | id = parameters.id !== undefined ? parameters.id : 'oldie';
51 |
52 | element = Detector.getWebGLErrorMessage();
53 | element.id = id;
54 |
55 | parent.appendChild( element );
56 |
57 | }
58 |
59 | };
60 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/ImprovedNoise.js:
--------------------------------------------------------------------------------
1 | // http://mrl.nyu.edu/~perlin/noise/
2 |
3 | var ImprovedNoise = function () {
4 |
5 | var p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,
6 | 23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,
7 | 174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,
8 | 133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,
9 | 89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,
10 | 202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,
11 | 248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,
12 | 178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,
13 | 14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,
14 | 93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];
15 |
16 | for (var i=0; i < 256 ; i++) {
17 |
18 | p[256+i] = p[i];
19 |
20 | }
21 |
22 | function fade(t) {
23 |
24 | return t * t * t * (t * (t * 6 - 15) + 10);
25 |
26 | }
27 |
28 | function lerp(t, a, b) {
29 |
30 | return a + t * (b - a);
31 |
32 | }
33 |
34 | function grad(hash, x, y, z) {
35 |
36 | var h = hash & 15;
37 | var u = h < 8 ? x : y, v = h < 4 ? y : h == 12 || h == 14 ? x : z;
38 | return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v);
39 |
40 | }
41 |
42 | return {
43 |
44 | noise: function (x, y, z) {
45 |
46 | var floorX = ~~x, floorY = ~~y, floorZ = ~~z;
47 |
48 | var X = floorX & 255, Y = floorY & 255, Z = floorZ & 255;
49 |
50 | x -= floorX;
51 | y -= floorY;
52 | z -= floorZ;
53 |
54 | var xMinus1 = x -1, yMinus1 = y - 1, zMinus1 = z - 1;
55 |
56 | var u = fade(x), v = fade(y), w = fade(z);
57 |
58 | var A = p[X]+Y, AA = p[A]+Z, AB = p[A+1]+Z, B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z;
59 |
60 | return lerp(w, lerp(v, lerp(u, grad(p[AA], x, y, z),
61 | grad(p[BA], xMinus1, y, z)),
62 | lerp(u, grad(p[AB], x, yMinus1, z),
63 | grad(p[BB], xMinus1, yMinus1, z))),
64 | lerp(v, lerp(u, grad(p[AA+1], x, y, zMinus1),
65 | grad(p[BA+1], xMinus1, y, z-1)),
66 | lerp(u, grad(p[AB+1], x, yMinus1, zMinus1),
67 | grad(p[BB+1], xMinus1, yMinus1, zMinus1))));
68 |
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/libs/stats.min.js:
--------------------------------------------------------------------------------
1 | // stats.js - http://github.com/mrdoob/stats.js
2 | var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";
3 | i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div");
4 | k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display=
5 | "block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:11,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height=
6 | a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};
7 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/loaders/SceneLoader2.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author mrdoob / http://mrdoob.com/
3 | */
4 |
5 | THREE.SceneLoader2 = function () {
6 |
7 | THREE.EventDispatcher.call( this );
8 |
9 | };
10 |
11 | THREE.SceneLoader2.prototype = {
12 |
13 | constructor: THREE.SceneExporter2,
14 |
15 | load: function ( url ) {
16 |
17 | var scope = this;
18 | var request = new XMLHttpRequest();
19 |
20 | request.addEventListener( 'load', function ( event ) {
21 |
22 | var response = scope.parse( JSON.parse( event.target.responseText ) );
23 |
24 | scope.dispatchEvent( { type: 'load', content: response } );
25 |
26 | }, false );
27 |
28 | request.addEventListener( 'progress', function ( event ) {
29 |
30 | scope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );
31 |
32 | }, false );
33 |
34 | request.addEventListener( 'error', function () {
35 |
36 | scope.dispatchEvent( { type: 'error', message: 'Couldn\'t load URL [' + url + ']' } );
37 |
38 | }, false );
39 |
40 | request.open( 'GET', url, true );
41 | request.send( null );
42 |
43 | },
44 |
45 | parse: function ( json ) {
46 |
47 | console.log( json );
48 |
49 | var geometries = [];
50 | var loader = new THREE.JSONLoader();
51 |
52 | for ( var i = 0, l = json.geometries.length; i < l; i ++ ) {
53 |
54 | console.log( json.geometries[ i ] );
55 |
56 | geometries.push( loader.createModel( json.geometries[ i ] ) );
57 |
58 | }
59 |
60 | console.log( geometries );
61 |
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/loaders/ctm/CTMWorker.js:
--------------------------------------------------------------------------------
1 | importScripts( "lzma.js", "ctm.js" );
2 |
3 | self.onmessage = function( event ) {
4 |
5 | var files = [];
6 |
7 | for ( var i = 0; i < event.data.offsets.length; i ++ ) {
8 |
9 | var stream = new CTM.Stream( event.data.data );
10 | stream.offset = event.data.offsets[ i ];
11 |
12 | files[ i ] = new CTM.File( stream );
13 |
14 | }
15 |
16 | self.postMessage( files );
17 | self.close();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/loaders/ctm/license/OpenCTM.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009-2010 Marcus Geelnard
2 |
3 | This software is provided 'as-is', without any express or implied
4 | warranty. In no event will the authors be held liable for any damages
5 | arising from the use of this software.
6 |
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 |
11 | 1. The origin of this software must not be misrepresented; you must not
12 | claim that you wrote the original software. If you use this software
13 | in a product, an acknowledgment in the product documentation would be
14 | appreciated but is not required.
15 |
16 | 2. Altered source versions must be plainly marked as such, and must not
17 | be misrepresented as being the original software.
18 |
19 | 3. This notice may not be removed or altered from any source
20 | distribution.
21 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/loaders/ctm/license/js-lzma.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Juan Mellado
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/loaders/ctm/license/js-openctm.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Juan Mellado
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/modifiers/ExplodeModifier.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Make all faces use unique vertices
3 | * so that each face can be separated from others
4 | *
5 | * @author alteredq / http://alteredqualia.com/
6 | */
7 |
8 | THREE.ExplodeModifier = function () {
9 |
10 | };
11 |
12 | THREE.ExplodeModifier.prototype.modify = function ( geometry ) {
13 |
14 | var vertices = [];
15 |
16 | for ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {
17 |
18 | var n = vertices.length;
19 |
20 | var face = geometry.faces[ i ];
21 |
22 | if ( face instanceof THREE.Face4 ) {
23 |
24 | var a = face.a;
25 | var b = face.b;
26 | var c = face.c;
27 | var d = face.d;
28 |
29 | var va = geometry.vertices[ a ];
30 | var vb = geometry.vertices[ b ];
31 | var vc = geometry.vertices[ c ];
32 | var vd = geometry.vertices[ d ];
33 |
34 | vertices.push( va.clone() );
35 | vertices.push( vb.clone() );
36 | vertices.push( vc.clone() );
37 | vertices.push( vd.clone() );
38 |
39 | face.a = n;
40 | face.b = n + 1;
41 | face.c = n + 2;
42 | face.d = n + 3;
43 |
44 | } else {
45 |
46 | var a = face.a;
47 | var b = face.b;
48 | var c = face.c;
49 |
50 | var va = geometry.vertices[ a ];
51 | var vb = geometry.vertices[ b ];
52 | var vc = geometry.vertices[ c ];
53 |
54 | vertices.push( va.clone() );
55 | vertices.push( vb.clone() );
56 | vertices.push( vc.clone() );
57 |
58 | face.a = n;
59 | face.b = n + 1;
60 | face.c = n + 2;
61 |
62 | }
63 |
64 | }
65 |
66 | geometry.vertices = vertices;
67 | delete geometry.__tmpVertices;
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/DotScreenPass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.DotScreenPass = function ( center, angle, scale ) {
6 |
7 | if ( THREE.DotScreenShader === undefined )
8 | console.error( "THREE.DotScreenPass relies on THREE.DotScreenShader" );
9 |
10 | var shader = THREE.DotScreenShader;
11 |
12 | this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
13 |
14 | if ( center !== undefined ) this.uniforms[ "center" ].value.copy( center );
15 | if ( angle !== undefined ) this.uniforms[ "angle"].value = angle;
16 | if ( scale !== undefined ) this.uniforms[ "scale"].value = scale;
17 |
18 | this.material = new THREE.ShaderMaterial( {
19 |
20 | uniforms: this.uniforms,
21 | vertexShader: shader.vertexShader,
22 | fragmentShader: shader.fragmentShader
23 |
24 | } );
25 |
26 | this.enabled = true;
27 | this.renderToScreen = false;
28 | this.needsSwap = true;
29 |
30 | };
31 |
32 | THREE.DotScreenPass.prototype = {
33 |
34 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
35 |
36 | this.uniforms[ "tDiffuse" ].value = readBuffer;
37 | this.uniforms[ "tSize" ].value.set( readBuffer.width, readBuffer.height );
38 |
39 | THREE.EffectComposer.quad.material = this.material;
40 |
41 | if ( this.renderToScreen ) {
42 |
43 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
44 |
45 | } else {
46 |
47 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, writeBuffer, false );
48 |
49 | }
50 |
51 | }
52 |
53 | };
54 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/FilmPass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount, grayscale ) {
6 |
7 | if ( THREE.FilmShader === undefined )
8 | console.error( "THREE.FilmPass relies on THREE.FilmShader" );
9 |
10 | var shader = THREE.FilmShader;
11 |
12 | this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
13 |
14 | this.material = new THREE.ShaderMaterial( {
15 |
16 | uniforms: this.uniforms,
17 | vertexShader: shader.vertexShader,
18 | fragmentShader: shader.fragmentShader
19 |
20 | } );
21 |
22 | if ( grayscale !== undefined ) this.uniforms.grayscale.value = grayscale;
23 | if ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity;
24 | if ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity;
25 | if ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount;
26 |
27 | this.enabled = true;
28 | this.renderToScreen = false;
29 | this.needsSwap = true;
30 |
31 | };
32 |
33 | THREE.FilmPass.prototype = {
34 |
35 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
36 |
37 | this.uniforms[ "tDiffuse" ].value = readBuffer;
38 | this.uniforms[ "time" ].value += delta;
39 |
40 | THREE.EffectComposer.quad.material = this.material;
41 |
42 | if ( this.renderToScreen ) {
43 |
44 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
45 |
46 | } else {
47 |
48 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, writeBuffer, false );
49 |
50 | }
51 |
52 | }
53 |
54 | };
55 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/MaskPass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.MaskPass = function ( scene, camera ) {
6 |
7 | this.scene = scene;
8 | this.camera = camera;
9 |
10 | this.enabled = true;
11 | this.clear = true;
12 | this.needsSwap = false;
13 |
14 | this.inverse = false;
15 |
16 | };
17 |
18 | THREE.MaskPass.prototype = {
19 |
20 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
21 |
22 | var context = renderer.context;
23 |
24 | // don't update color or depth
25 |
26 | context.colorMask( false, false, false, false );
27 | context.depthMask( false );
28 |
29 | // set up stencil
30 |
31 | var writeValue, clearValue;
32 |
33 | if ( this.inverse ) {
34 |
35 | writeValue = 0;
36 | clearValue = 1;
37 |
38 | } else {
39 |
40 | writeValue = 1;
41 | clearValue = 0;
42 |
43 | }
44 |
45 | context.enable( context.STENCIL_TEST );
46 | context.stencilOp( context.REPLACE, context.REPLACE, context.REPLACE );
47 | context.stencilFunc( context.ALWAYS, writeValue, 0xffffffff );
48 | context.clearStencil( clearValue );
49 |
50 | // draw into the stencil buffer
51 |
52 | renderer.render( this.scene, this.camera, readBuffer, this.clear );
53 | renderer.render( this.scene, this.camera, writeBuffer, this.clear );
54 |
55 | // re-enable update of color and depth
56 |
57 | context.colorMask( true, true, true, true );
58 | context.depthMask( true );
59 |
60 | // only render where stencil is set to 1
61 |
62 | context.stencilFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1
63 | context.stencilOp( context.KEEP, context.KEEP, context.KEEP );
64 |
65 | }
66 |
67 | };
68 |
69 |
70 | THREE.ClearMaskPass = function () {
71 |
72 | this.enabled = true;
73 |
74 | };
75 |
76 | THREE.ClearMaskPass.prototype = {
77 |
78 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
79 |
80 | var context = renderer.context;
81 |
82 | context.disable( context.STENCIL_TEST );
83 |
84 | }
85 |
86 | };
87 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/RenderPass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
6 |
7 | this.scene = scene;
8 | this.camera = camera;
9 |
10 | this.overrideMaterial = overrideMaterial;
11 |
12 | this.clearColor = clearColor;
13 | this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 1;
14 |
15 | this.oldClearColor = new THREE.Color();
16 | this.oldClearAlpha = 1;
17 |
18 | this.enabled = true;
19 | this.clear = true;
20 | this.needsSwap = false;
21 |
22 | };
23 |
24 | THREE.RenderPass.prototype = {
25 |
26 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
27 |
28 | this.scene.overrideMaterial = this.overrideMaterial;
29 |
30 | if ( this.clearColor ) {
31 |
32 | this.oldClearColor.copy( renderer.getClearColor() );
33 | this.oldClearAlpha = renderer.getClearAlpha();
34 |
35 | renderer.setClearColor( this.clearColor, this.clearAlpha );
36 |
37 | }
38 |
39 | renderer.render( this.scene, this.camera, readBuffer, this.clear );
40 |
41 | if ( this.clearColor ) {
42 |
43 | renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
44 |
45 | }
46 |
47 | this.scene.overrideMaterial = null;
48 |
49 | }
50 |
51 | };
52 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/SavePass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.SavePass = function ( renderTarget ) {
6 |
7 | if ( THREE.CopyShader === undefined )
8 | console.error( "THREE.SavePass relies on THREE.CopyShader" );
9 |
10 | var shader = THREE.CopyShader;
11 |
12 | this.textureID = "tDiffuse";
13 |
14 | this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
15 |
16 | this.material = new THREE.ShaderMaterial( {
17 |
18 | uniforms: this.uniforms,
19 | vertexShader: shader.vertexShader,
20 | fragmentShader: shader.fragmentShader
21 |
22 | } );
23 |
24 | this.renderTarget = renderTarget;
25 |
26 | if ( this.renderTarget === undefined ) {
27 |
28 | this.renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };
29 | this.renderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, this.renderTargetParameters );
30 |
31 | }
32 |
33 | this.enabled = true;
34 | this.needsSwap = false;
35 | this.clear = false;
36 |
37 | };
38 |
39 | THREE.SavePass.prototype = {
40 |
41 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
42 |
43 | if ( this.uniforms[ this.textureID ] ) {
44 |
45 | this.uniforms[ this.textureID ].value = readBuffer;
46 |
47 | }
48 |
49 | THREE.EffectComposer.quad.material = this.material;
50 |
51 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTarget, this.clear );
52 |
53 | }
54 |
55 | };
56 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/ShaderPass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.ShaderPass = function ( shader, textureID ) {
6 |
7 | this.textureID = ( textureID !== undefined ) ? textureID : "tDiffuse";
8 |
9 | this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
10 |
11 | this.material = new THREE.ShaderMaterial( {
12 |
13 | uniforms: this.uniforms,
14 | vertexShader: shader.vertexShader,
15 | fragmentShader: shader.fragmentShader
16 |
17 | } );
18 |
19 | this.renderToScreen = false;
20 |
21 | this.enabled = true;
22 | this.needsSwap = true;
23 | this.clear = false;
24 |
25 | };
26 |
27 | THREE.ShaderPass.prototype = {
28 |
29 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
30 |
31 | if ( this.uniforms[ this.textureID ] ) {
32 |
33 | this.uniforms[ this.textureID ].value = readBuffer;
34 |
35 | }
36 |
37 | THREE.EffectComposer.quad.material = this.material;
38 |
39 | if ( this.renderToScreen ) {
40 |
41 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera );
42 |
43 | } else {
44 |
45 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, writeBuffer, this.clear );
46 |
47 | }
48 |
49 | }
50 |
51 | };
52 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/postprocessing/TexturePass.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | */
4 |
5 | THREE.TexturePass = function ( texture, opacity ) {
6 |
7 | if ( THREE.CopyShader === undefined )
8 | console.error( "THREE.TexturePass relies on THREE.CopyShader" );
9 |
10 | var shader = THREE.CopyShader;
11 |
12 | this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
13 |
14 | this.uniforms[ "opacity" ].value = ( opacity !== undefined ) ? opacity : 1.0;
15 | this.uniforms[ "tDiffuse" ].value = texture;
16 |
17 | this.material = new THREE.ShaderMaterial( {
18 |
19 | uniforms: this.uniforms,
20 | vertexShader: shader.vertexShader,
21 | fragmentShader: shader.fragmentShader
22 |
23 | } );
24 |
25 | this.enabled = true;
26 | this.needsSwap = false;
27 |
28 | };
29 |
30 | THREE.TexturePass.prototype = {
31 |
32 | render: function ( renderer, writeBuffer, readBuffer, delta ) {
33 |
34 | THREE.EffectComposer.quad.material = this.material;
35 |
36 | renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, readBuffer );
37 |
38 | }
39 |
40 | };
41 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/BasicShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author mrdoob / http://www.mrdoob.com
3 | *
4 | * Simple test shader
5 | */
6 |
7 | THREE.BasicShader = {
8 |
9 | uniforms: {},
10 |
11 | vertexShader: [
12 |
13 | "void main() {",
14 |
15 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
16 |
17 | "}"
18 |
19 | ].join("\n"),
20 |
21 | fragmentShader: [
22 |
23 | "void main() {",
24 |
25 | "gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );",
26 |
27 | "}"
28 |
29 | ].join("\n")
30 |
31 | };
32 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/BleachBypassShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass]
5 | * - based on Nvidia example
6 | * http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass
7 | */
8 |
9 | THREE.BleachBypassShader = {
10 |
11 | uniforms: {
12 |
13 | "tDiffuse": { type: "t", value: null },
14 | "opacity": { type: "f", value: 1.0 }
15 |
16 | },
17 |
18 | vertexShader: [
19 |
20 | "varying vec2 vUv;",
21 |
22 | "void main() {",
23 |
24 | "vUv = uv;",
25 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
26 |
27 | "}"
28 |
29 | ].join("\n"),
30 |
31 | fragmentShader: [
32 |
33 | "uniform float opacity;",
34 |
35 | "uniform sampler2D tDiffuse;",
36 |
37 | "varying vec2 vUv;",
38 |
39 | "void main() {",
40 |
41 | "vec4 base = texture2D( tDiffuse, vUv );",
42 |
43 | "vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );",
44 | "float lum = dot( lumCoeff, base.rgb );",
45 | "vec3 blend = vec3( lum );",
46 |
47 | "float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );",
48 |
49 | "vec3 result1 = 2.0 * base.rgb * blend;",
50 | "vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );",
51 |
52 | "vec3 newColor = mix( result1, result2, L );",
53 |
54 | "float A2 = opacity * base.a;",
55 | "vec3 mixRGB = A2 * newColor.rgb;",
56 | "mixRGB += ( ( 1.0 - A2 ) * base.rgb );",
57 |
58 | "gl_FragColor = vec4( mixRGB, base.a );",
59 |
60 | "}"
61 |
62 | ].join("\n")
63 |
64 | };
65 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/BlendShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Blend two textures
5 | */
6 |
7 | THREE.BlendShader = {
8 |
9 | uniforms: {
10 |
11 | "tDiffuse1": { type: "t", value: null },
12 | "tDiffuse2": { type: "t", value: null },
13 | "mixRatio": { type: "f", value: 0.5 },
14 | "opacity": { type: "f", value: 1.0 }
15 |
16 | },
17 |
18 | vertexShader: [
19 |
20 | "varying vec2 vUv;",
21 |
22 | "void main() {",
23 |
24 | "vUv = uv;",
25 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
26 |
27 | "}"
28 |
29 | ].join("\n"),
30 |
31 | fragmentShader: [
32 |
33 | "uniform float opacity;",
34 | "uniform float mixRatio;",
35 |
36 | "uniform sampler2D tDiffuse1;",
37 | "uniform sampler2D tDiffuse2;",
38 |
39 | "varying vec2 vUv;",
40 |
41 | "void main() {",
42 |
43 | "vec4 texel1 = texture2D( tDiffuse1, vUv );",
44 | "vec4 texel2 = texture2D( tDiffuse2, vUv );",
45 | "gl_FragColor = opacity * mix( texel1, texel2, mixRatio );",
46 |
47 | "}"
48 |
49 | ].join("\n")
50 |
51 | };
52 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/BrightnessContrastShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author tapio / http://tapio.github.com/
3 | *
4 | * Brightness and contrast adjustment
5 | * https://github.com/evanw/glfx.js
6 | * brightness: -1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white)
7 | * contrast: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)
8 | */
9 |
10 | THREE.BrightnessContrastShader = {
11 |
12 | uniforms: {
13 |
14 | "tDiffuse": { type: "t", value: null },
15 | "brightness": { type: "f", value: 0 },
16 | "contrast": { type: "f", value: 0 }
17 |
18 | },
19 |
20 | vertexShader: [
21 |
22 | "varying vec2 vUv;",
23 |
24 | "void main() {",
25 |
26 | "vUv = uv;",
27 |
28 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
29 |
30 | "}"
31 |
32 | ].join("\n"),
33 |
34 | fragmentShader: [
35 |
36 | "uniform sampler2D tDiffuse;",
37 | "uniform float brightness;",
38 | "uniform float contrast;",
39 |
40 | "varying vec2 vUv;",
41 |
42 | "void main() {",
43 |
44 | "gl_FragColor = texture2D( tDiffuse, vUv );",
45 |
46 | "gl_FragColor.rgb += brightness;",
47 |
48 | "if (contrast > 0.0) {",
49 | "gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;",
50 | "} else {",
51 | "gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;",
52 | "}",
53 |
54 | "}"
55 |
56 | ].join("\n")
57 |
58 | };
59 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/ColorCorrectionShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Color correction
5 | */
6 |
7 | THREE.ColorCorrectionShader = {
8 |
9 | uniforms: {
10 |
11 | "tDiffuse": { type: "t", value: null },
12 | "powRGB": { type: "v3", value: new THREE.Vector3( 2, 2, 2 ) },
13 | "mulRGB": { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) }
14 |
15 | },
16 |
17 | vertexShader: [
18 |
19 | "varying vec2 vUv;",
20 |
21 | "void main() {",
22 |
23 | "vUv = uv;",
24 |
25 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
26 |
27 | "}"
28 |
29 | ].join("\n"),
30 |
31 | fragmentShader: [
32 |
33 | "uniform sampler2D tDiffuse;",
34 | "uniform vec3 powRGB;",
35 | "uniform vec3 mulRGB;",
36 |
37 | "varying vec2 vUv;",
38 |
39 | "void main() {",
40 |
41 | "gl_FragColor = texture2D( tDiffuse, vUv );",
42 | "gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );",
43 |
44 | "}"
45 |
46 | ].join("\n")
47 |
48 | };
49 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/ColorifyShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Colorify shader
5 | */
6 |
7 | THREE.ColorifyShader = {
8 |
9 | uniforms: {
10 |
11 | "tDiffuse": { type: "t", value: null },
12 | "color": { type: "c", value: new THREE.Color( 0xffffff ) }
13 |
14 | },
15 |
16 | vertexShader: [
17 |
18 | "varying vec2 vUv;",
19 |
20 | "void main() {",
21 |
22 | "vUv = uv;",
23 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
24 |
25 | "}"
26 |
27 | ].join("\n"),
28 |
29 | fragmentShader: [
30 |
31 | "uniform vec3 color;",
32 | "uniform sampler2D tDiffuse;",
33 |
34 | "varying vec2 vUv;",
35 |
36 | "void main() {",
37 |
38 | "vec4 texel = texture2D( tDiffuse, vUv );",
39 |
40 | "vec3 luma = vec3( 0.299, 0.587, 0.114 );",
41 | "float v = dot( texel.xyz, luma );",
42 |
43 | "gl_FragColor = vec4( v * color, texel.w );",
44 |
45 | "}"
46 |
47 | ].join("\n")
48 |
49 | };
50 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/ConvolutionShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Convolution shader
5 | * ported from o3d sample to WebGL / GLSL
6 | * http://o3d.googlecode.com/svn/trunk/samples/convolution.html
7 | */
8 |
9 | THREE.ConvolutionShader = {
10 |
11 | defines: {
12 |
13 | "KERNEL_SIZE_FLOAT": "25.0",
14 | "KERNEL_SIZE_INT": "25",
15 |
16 | },
17 |
18 | uniforms: {
19 |
20 | "tDiffuse": { type: "t", value: null },
21 | "uImageIncrement": { type: "v2", value: new THREE.Vector2( 0.001953125, 0.0 ) },
22 | "cKernel": { type: "fv1", value: [] }
23 |
24 | },
25 |
26 | vertexShader: [
27 |
28 | "uniform vec2 uImageIncrement;",
29 |
30 | "varying vec2 vUv;",
31 |
32 | "void main() {",
33 |
34 | "vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
35 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
36 |
37 | "}"
38 |
39 | ].join("\n"),
40 |
41 | fragmentShader: [
42 |
43 | "uniform float cKernel[ KERNEL_SIZE_INT ];",
44 |
45 | "uniform sampler2D tDiffuse;",
46 | "uniform vec2 uImageIncrement;",
47 |
48 | "varying vec2 vUv;",
49 |
50 | "void main() {",
51 |
52 | "vec2 imageCoord = vUv;",
53 | "vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
54 |
55 | "for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
56 |
57 | "sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
58 | "imageCoord += uImageIncrement;",
59 |
60 | "}",
61 |
62 | "gl_FragColor = sum;",
63 |
64 | "}"
65 |
66 |
67 | ].join("\n"),
68 |
69 | buildKernel: function ( sigma ) {
70 |
71 | // We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway.
72 |
73 | function gauss( x, sigma ) {
74 |
75 | return Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) );
76 |
77 | }
78 |
79 | var i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1;
80 |
81 | if ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize;
82 | halfWidth = ( kernelSize - 1 ) * 0.5;
83 |
84 | values = new Array( kernelSize );
85 | sum = 0.0;
86 | for ( i = 0; i < kernelSize; ++i ) {
87 |
88 | values[ i ] = gauss( i - halfWidth, sigma );
89 | sum += values[ i ];
90 |
91 | }
92 |
93 | // normalize the kernel
94 |
95 | for ( i = 0; i < kernelSize; ++i ) values[ i ] /= sum;
96 |
97 | return values;
98 |
99 | }
100 |
101 | };
102 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/CopyShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Full-screen textured quad shader
5 | */
6 |
7 | THREE.CopyShader = {
8 |
9 | uniforms: {
10 |
11 | "tDiffuse": { type: "t", value: null },
12 | "opacity": { type: "f", value: 1.0 }
13 |
14 | },
15 |
16 | vertexShader: [
17 |
18 | "varying vec2 vUv;",
19 |
20 | "void main() {",
21 |
22 | "vUv = uv;",
23 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
24 |
25 | "}"
26 |
27 | ].join("\n"),
28 |
29 | fragmentShader: [
30 |
31 | "uniform float opacity;",
32 |
33 | "uniform sampler2D tDiffuse;",
34 |
35 | "varying vec2 vUv;",
36 |
37 | "void main() {",
38 |
39 | "vec4 texel = texture2D( tDiffuse, vUv );",
40 | "gl_FragColor = opacity * texel;",
41 |
42 | "}"
43 |
44 | ].join("\n")
45 |
46 | };
47 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/DOFMipMapShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Depth-of-field shader using mipmaps
5 | * - from Matt Handley @applmak
6 | * - requires power-of-2 sized render target with enabled mipmaps
7 | */
8 |
9 | THREE.DOFMipMapShader = {
10 |
11 | uniforms: {
12 |
13 | "tColor": { type: "t", value: null },
14 | "tDepth": { type: "t", value: null },
15 | "focus": { type: "f", value: 1.0 },
16 | "maxblur": { type: "f", value: 1.0 }
17 |
18 | },
19 |
20 | vertexShader: [
21 |
22 | "varying vec2 vUv;",
23 |
24 | "void main() {",
25 |
26 | "vUv = uv;",
27 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
28 |
29 | "}"
30 |
31 | ].join("\n"),
32 |
33 | fragmentShader: [
34 |
35 | "uniform float focus;",
36 | "uniform float maxblur;",
37 |
38 | "uniform sampler2D tColor;",
39 | "uniform sampler2D tDepth;",
40 |
41 | "varying vec2 vUv;",
42 |
43 | "void main() {",
44 |
45 | "vec4 depth = texture2D( tDepth, vUv );",
46 |
47 | "float factor = depth.x - focus;",
48 |
49 | "vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );",
50 |
51 | "gl_FragColor = col;",
52 | "gl_FragColor.a = 1.0;",
53 |
54 | "}"
55 |
56 | ].join("\n")
57 |
58 | };
59 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/DotScreenShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Dot screen shader
5 | * based on glfx.js sepia shader
6 | * https://github.com/evanw/glfx.js
7 | */
8 |
9 | THREE.DotScreenShader = {
10 |
11 | uniforms: {
12 |
13 | "tDiffuse": { type: "t", value: null },
14 | "tSize": { type: "v2", value: new THREE.Vector2( 256, 256 ) },
15 | "center": { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) },
16 | "angle": { type: "f", value: 1.57 },
17 | "scale": { type: "f", value: 1.0 }
18 |
19 | },
20 |
21 | vertexShader: [
22 |
23 | "varying vec2 vUv;",
24 |
25 | "void main() {",
26 |
27 | "vUv = uv;",
28 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
29 |
30 | "}"
31 |
32 | ].join("\n"),
33 |
34 | fragmentShader: [
35 |
36 | "uniform vec2 center;",
37 | "uniform float angle;",
38 | "uniform float scale;",
39 | "uniform vec2 tSize;",
40 |
41 | "uniform sampler2D tDiffuse;",
42 |
43 | "varying vec2 vUv;",
44 |
45 | "float pattern() {",
46 |
47 | "float s = sin( angle ), c = cos( angle );",
48 |
49 | "vec2 tex = vUv * tSize - center;",
50 | "vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",
51 |
52 | "return ( sin( point.x ) * sin( point.y ) ) * 4.0;",
53 |
54 | "}",
55 |
56 | "void main() {",
57 |
58 | "vec4 color = texture2D( tDiffuse, vUv );",
59 |
60 | "float average = ( color.r + color.g + color.b ) / 3.0;",
61 |
62 | "gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",
63 |
64 | "}"
65 |
66 | ].join("\n")
67 |
68 | };
69 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/EdgeShader2.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog
3 | *
4 | * Edge Detection Shader using Sobel filter
5 | * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector
6 | *
7 | * aspect: vec2 of (1/width, 1/height)
8 | */
9 |
10 | THREE.EdgeShader2 = {
11 |
12 | uniforms: {
13 |
14 | "tDiffuse": { type: "t", value: null },
15 | "aspect": { type: "v2", value: new THREE.Vector2( 512, 512 ) },
16 | },
17 |
18 | vertexShader: [
19 |
20 | "varying vec2 vUv;",
21 |
22 | "void main() {",
23 |
24 | "vUv = uv;",
25 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
26 |
27 | "}"
28 |
29 | ].join("\n"),
30 |
31 | fragmentShader: [
32 |
33 | "uniform sampler2D tDiffuse;",
34 | "varying vec2 vUv;",
35 | "uniform vec2 aspect;",
36 |
37 |
38 | "vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);",
39 |
40 | "mat3 G[2];",
41 |
42 | "const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );",
43 | "const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );",
44 |
45 |
46 | "void main(void)",
47 | "{",
48 | "mat3 I;",
49 | "float cnv[2];",
50 | "vec3 sample;",
51 |
52 | "G[0] = g0;",
53 | "G[1] = g1;",
54 |
55 | /* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */
56 | "for (float i=0.0; i<3.0; i++)",
57 | "for (float j=0.0; j<3.0; j++) {",
58 | "sample = texture2D( tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;",
59 | "I[int(i)][int(j)] = length(sample);",
60 | "}",
61 |
62 | /* calculate the convolution values for all the masks */
63 | "for (int i=0; i<2; i++) {",
64 | "float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);",
65 | "cnv[i] = dp3 * dp3; ",
66 | "}",
67 |
68 | "gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));",
69 | "} ",
70 |
71 | ].join("\n")
72 |
73 | };
74 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/FresnelShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Based on Nvidia Cg tutorial
5 | */
6 |
7 | THREE.FresnelShader = {
8 |
9 | uniforms: {
10 |
11 | "mRefractionRatio": { type: "f", value: 1.02 },
12 | "mFresnelBias": { type: "f", value: 0.1 },
13 | "mFresnelPower": { type: "f", value: 2.0 },
14 | "mFresnelScale": { type: "f", value: 1.0 },
15 | "tCube": { type: "t", value: null }
16 |
17 | },
18 |
19 | vertexShader: [
20 |
21 | "uniform float mRefractionRatio;",
22 | "uniform float mFresnelBias;",
23 | "uniform float mFresnelScale;",
24 | "uniform float mFresnelPower;",
25 |
26 | "varying vec3 vReflect;",
27 | "varying vec3 vRefract[3];",
28 | "varying float vReflectionFactor;",
29 |
30 | "void main() {",
31 |
32 | "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
33 | "vec4 worldPosition = modelMatrix * vec4( position, 1.0 );",
34 |
35 | "vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );",
36 |
37 | "vec3 I = worldPosition.xyz - cameraPosition;",
38 |
39 | "vReflect = reflect( I, worldNormal );",
40 | "vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );",
41 | "vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );",
42 | "vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );",
43 | "vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );",
44 |
45 | "gl_Position = projectionMatrix * mvPosition;",
46 |
47 | "}"
48 |
49 | ].join("\n"),
50 |
51 | fragmentShader: [
52 |
53 | "uniform samplerCube tCube;",
54 |
55 | "varying vec3 vReflect;",
56 | "varying vec3 vRefract[3];",
57 | "varying float vReflectionFactor;",
58 |
59 | "void main() {",
60 |
61 | "vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );",
62 | "vec4 refractedColor = vec4( 1.0 );",
63 |
64 | "refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;",
65 | "refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;",
66 | "refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;",
67 |
68 | "gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );",
69 |
70 | "}"
71 |
72 | ].join("\n")
73 |
74 | };
75 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/HorizontalBlurShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author zz85 / http://www.lab4games.net/zz85/blog
3 | *
4 | * Two pass Gaussian blur filter (horizontal and vertical blur shaders)
5 | * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/
6 | * and used in http://www.cake23.de/traveling-wavefronts-lit-up.html
7 | *
8 | * - 9 samples per pass
9 | * - standard deviation 2.7
10 | * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
11 | */
12 |
13 | THREE.HorizontalBlurShader = {
14 |
15 | uniforms: {
16 |
17 | "tDiffuse": { type: "t", value: null },
18 | "h": { type: "f", value: 1.0 / 512.0 }
19 |
20 | },
21 |
22 | vertexShader: [
23 |
24 | "varying vec2 vUv;",
25 |
26 | "void main() {",
27 |
28 | "vUv = uv;",
29 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
30 |
31 | "}"
32 |
33 | ].join("\n"),
34 |
35 | fragmentShader: [
36 |
37 | "uniform sampler2D tDiffuse;",
38 | "uniform float h;",
39 |
40 | "varying vec2 vUv;",
41 |
42 | "void main() {",
43 |
44 | "vec4 sum = vec4( 0.0 );",
45 |
46 | "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;",
47 | "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;",
48 | "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;",
49 | "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;",
50 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
51 | "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;",
52 | "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;",
53 | "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;",
54 | "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;",
55 |
56 | "gl_FragColor = sum;",
57 |
58 | "}"
59 |
60 | ].join("\n")
61 |
62 | };
63 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/HorizontalTiltShiftShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position
5 | *
6 | * - 9 samples per pass
7 | * - standard deviation 2.7
8 | * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
9 | * - "r" parameter control where "focused" horizontal line lies
10 | */
11 |
12 | THREE.HorizontalTiltShiftShader = {
13 |
14 | uniforms: {
15 |
16 | "tDiffuse": { type: "t", value: null },
17 | "h": { type: "f", value: 1.0 / 512.0 },
18 | "r": { type: "f", value: 0.35 }
19 |
20 | },
21 |
22 | vertexShader: [
23 |
24 | "varying vec2 vUv;",
25 |
26 | "void main() {",
27 |
28 | "vUv = uv;",
29 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
30 |
31 | "}"
32 |
33 | ].join("\n"),
34 |
35 | fragmentShader: [
36 |
37 | "uniform sampler2D tDiffuse;",
38 | "uniform float h;",
39 | "uniform float r;",
40 |
41 | "varying vec2 vUv;",
42 |
43 | "void main() {",
44 |
45 | "vec4 sum = vec4( 0.0 );",
46 |
47 | "float hh = h * abs( r - vUv.y );",
48 |
49 | "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;",
50 | "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;",
51 | "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;",
52 | "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;",
53 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
54 | "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;",
55 | "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;",
56 | "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;",
57 | "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;",
58 |
59 | "gl_FragColor = sum;",
60 |
61 | "}"
62 |
63 | ].join("\n")
64 |
65 | };
66 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/HueSaturationShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author tapio / http://tapio.github.com/
3 | *
4 | * Hue and saturation adjustment
5 | * https://github.com/evanw/glfx.js
6 | * hue: -1 to 1 (-1 is 180 degrees in the negative direction, 0 is no change, etc.
7 | * saturation: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)
8 | */
9 |
10 | THREE.HueSaturationShader = {
11 |
12 | uniforms: {
13 |
14 | "tDiffuse": { type: "t", value: null },
15 | "hue": { type: "f", value: 0 },
16 | "saturation": { type: "f", value: 0 }
17 |
18 | },
19 |
20 | vertexShader: [
21 |
22 | "varying vec2 vUv;",
23 |
24 | "void main() {",
25 |
26 | "vUv = uv;",
27 |
28 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
29 |
30 | "}"
31 |
32 | ].join("\n"),
33 |
34 | fragmentShader: [
35 |
36 | "uniform sampler2D tDiffuse;",
37 | "uniform float hue;",
38 | "uniform float saturation;",
39 |
40 | "varying vec2 vUv;",
41 |
42 | "void main() {",
43 |
44 | "gl_FragColor = texture2D( tDiffuse, vUv );",
45 |
46 | // hue
47 | "float angle = hue * 3.14159265;",
48 | "float s = sin(angle), c = cos(angle);",
49 | "vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;",
50 | "float len = length(gl_FragColor.rgb);",
51 | "gl_FragColor.rgb = vec3(",
52 | "dot(gl_FragColor.rgb, weights.xyz),",
53 | "dot(gl_FragColor.rgb, weights.zxy),",
54 | "dot(gl_FragColor.rgb, weights.yzx)",
55 | ");",
56 |
57 | // saturation
58 | "float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;",
59 | "if (saturation > 0.0) {",
60 | "gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));",
61 | "} else {",
62 | "gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);",
63 | "}",
64 |
65 | "}"
66 |
67 | ].join("\n")
68 |
69 | };
70 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/KaleidoShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author felixturner / http://airtight.cc/
3 | *
4 | * Kaleidoscope Shader
5 | * Radial reflection around center point
6 | * Ported from: http://pixelshaders.com/editor/
7 | * by Toby Schachman / http://tobyschachman.com/
8 | *
9 | * sides: number of reflections
10 | * angle: initial angle in radians
11 | */
12 |
13 | THREE.KaleidoShader = {
14 |
15 | uniforms: {
16 |
17 | "tDiffuse": { type: "t", value: null },
18 | "sides": { type: "f", value: 6.0 },
19 | "angle": { type: "f", value: 0.0 }
20 |
21 | },
22 |
23 | vertexShader: [
24 |
25 | "varying vec2 vUv;",
26 |
27 | "void main() {",
28 |
29 | "vUv = uv;",
30 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
31 |
32 | "}"
33 |
34 | ].join("\n"),
35 |
36 | fragmentShader: [
37 |
38 | "uniform sampler2D tDiffuse;",
39 | "uniform float sides;",
40 | "uniform float angle;",
41 |
42 | "varying vec2 vUv;",
43 |
44 | "void main() {",
45 |
46 | "vec2 p = vUv - 0.5;",
47 | "float r = length(p);",
48 | "float a = atan(p.y, p.x) + angle;",
49 | "float tau = 2. * 3.1416 ;",
50 | "a = mod(a, tau/sides);",
51 | "a = abs(a - tau/sides/2.) ;",
52 | "p = r * vec2(cos(a), sin(a));",
53 | "vec4 color = texture2D(tDiffuse, p + 0.5);",
54 | "gl_FragColor = color;",
55 |
56 | "}"
57 |
58 | ].join("\n")
59 |
60 | };
61 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/LuminosityShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Luminosity
5 | * http://en.wikipedia.org/wiki/Luminosity
6 | */
7 |
8 | THREE.LuminosityShader = {
9 |
10 | uniforms: {
11 |
12 | "tDiffuse": { type: "t", value: null }
13 |
14 | },
15 |
16 | vertexShader: [
17 |
18 | "varying vec2 vUv;",
19 |
20 | "void main() {",
21 |
22 | "vUv = uv;",
23 |
24 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
25 |
26 | "}"
27 |
28 | ].join("\n"),
29 |
30 | fragmentShader: [
31 |
32 | "uniform sampler2D tDiffuse;",
33 |
34 | "varying vec2 vUv;",
35 |
36 | "void main() {",
37 |
38 | "vec4 texel = texture2D( tDiffuse, vUv );",
39 |
40 | "vec3 luma = vec3( 0.299, 0.587, 0.114 );",
41 |
42 | "float v = dot( texel.xyz, luma );",
43 |
44 | "gl_FragColor = vec4( v, v, v, texel.w );",
45 |
46 | "}"
47 |
48 | ].join("\n")
49 |
50 | };
51 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/MirrorShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author felixturner / http://airtight.cc/
3 | *
4 | * Mirror Shader
5 | * Copies half the input to the other half
6 | *
7 | * side: side of input to mirror (0 = left, 1 = right, 2 = top, 3 = bottom)
8 | */
9 |
10 | THREE.MirrorShader = {
11 |
12 | uniforms: {
13 |
14 | "tDiffuse": { type: "t", value: null },
15 | "side": { type: "i", value: 1 }
16 |
17 | },
18 |
19 | vertexShader: [
20 |
21 | "varying vec2 vUv;",
22 |
23 | "void main() {",
24 |
25 | "vUv = uv;",
26 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
27 |
28 | "}"
29 |
30 | ].join("\n"),
31 |
32 | fragmentShader: [
33 |
34 | "uniform sampler2D tDiffuse;",
35 | "uniform int side;",
36 |
37 | "varying vec2 vUv;",
38 |
39 | "void main() {",
40 |
41 | "vec2 p = vUv;",
42 | "if (side == 0){",
43 | "if (p.x > 0.5) p.x = 1.0 - p.x;",
44 | "}else if (side == 1){",
45 | "if (p.x < 0.5) p.x = 1.0 - p.x;",
46 | "}else if (side == 2){",
47 | "if (p.y < 0.5) p.y = 1.0 - p.y;",
48 | "}else if (side == 3){",
49 | "if (p.y > 0.5) p.y = 1.0 - p.y;",
50 | "} ",
51 | "vec4 color = texture2D(tDiffuse, p);",
52 | "gl_FragColor = color;",
53 |
54 | "}"
55 |
56 | ].join("\n")
57 |
58 | };
59 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/NormalMapShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Normal map shader
5 | * - compute normals from heightmap
6 | */
7 |
8 | THREE.NormalMapShader = {
9 |
10 | uniforms: {
11 |
12 | "heightMap": { type: "t", value: null },
13 | "resolution": { type: "v2", value: new THREE.Vector2( 512, 512 ) },
14 | "scale": { type: "v2", value: new THREE.Vector2( 1, 1 ) },
15 | "height": { type: "f", value: 0.05 }
16 |
17 | },
18 |
19 | vertexShader: [
20 |
21 | "varying vec2 vUv;",
22 |
23 | "void main() {",
24 |
25 | "vUv = uv;",
26 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
27 |
28 | "}"
29 |
30 | ].join("\n"),
31 |
32 | fragmentShader: [
33 |
34 | "uniform float height;",
35 | "uniform vec2 resolution;",
36 | "uniform sampler2D heightMap;",
37 |
38 | "varying vec2 vUv;",
39 |
40 | "void main() {",
41 |
42 | "float val = texture2D( heightMap, vUv ).x;",
43 |
44 | "float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;",
45 | "float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;",
46 |
47 | "gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );",
48 |
49 | "}"
50 |
51 | ].join("\n")
52 |
53 | };
54 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/RGBShiftShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author felixturner / http://airtight.cc/
3 | *
4 | * RGB Shift Shader
5 | * Shifts red and blue channels from center in opposite directions
6 | * Ported from http://kriss.cx/tom/2009/05/rgb-shift/
7 | * by Tom Butterworth / http://kriss.cx/tom/
8 | *
9 | * amount: shift distance (1 is width of input)
10 | * angle: shift angle in radians
11 | */
12 |
13 | THREE.RGBShiftShader = {
14 |
15 | uniforms: {
16 |
17 | "tDiffuse": { type: "t", value: null },
18 | "amount": { type: "f", value: 0.005 },
19 | "angle": { type: "f", value: 0.0 }
20 |
21 | },
22 |
23 | vertexShader: [
24 |
25 | "varying vec2 vUv;",
26 |
27 | "void main() {",
28 |
29 | "vUv = uv;",
30 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
31 |
32 | "}"
33 |
34 | ].join("\n"),
35 |
36 | fragmentShader: [
37 |
38 | "uniform sampler2D tDiffuse;",
39 | "uniform float amount;",
40 | "uniform float angle;",
41 |
42 | "varying vec2 vUv;",
43 |
44 | "void main() {",
45 |
46 | "vec2 offset = amount * vec2( cos(angle), sin(angle));",
47 | "vec4 cr = texture2D(tDiffuse, vUv + offset);",
48 | "vec4 cga = texture2D(tDiffuse, vUv);",
49 | "vec4 cb = texture2D(tDiffuse, vUv - offset);",
50 | "gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);",
51 |
52 | "}"
53 |
54 | ].join("\n")
55 |
56 | };
57 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/SepiaShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Sepia tone shader
5 | * based on glfx.js sepia shader
6 | * https://github.com/evanw/glfx.js
7 | */
8 |
9 | THREE.SepiaShader = {
10 |
11 | uniforms: {
12 |
13 | "tDiffuse": { type: "t", value: null },
14 | "amount": { type: "f", value: 1.0 }
15 |
16 | },
17 |
18 | vertexShader: [
19 |
20 | "varying vec2 vUv;",
21 |
22 | "void main() {",
23 |
24 | "vUv = uv;",
25 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
26 |
27 | "}"
28 |
29 | ].join("\n"),
30 |
31 | fragmentShader: [
32 |
33 | "uniform float amount;",
34 |
35 | "uniform sampler2D tDiffuse;",
36 |
37 | "varying vec2 vUv;",
38 |
39 | "void main() {",
40 |
41 | "vec4 color = texture2D( tDiffuse, vUv );",
42 | "vec3 c = color.rgb;",
43 |
44 | "color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );",
45 | "color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );",
46 | "color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );",
47 |
48 | "gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );",
49 |
50 | "}"
51 |
52 | ].join("\n")
53 |
54 | };
55 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/TriangleBlurShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author zz85 / http://www.lab4games.net/zz85/blog
3 | *
4 | * Triangle blur shader
5 | * based on glfx.js triangle blur shader
6 | * https://github.com/evanw/glfx.js
7 | *
8 | * A basic blur filter, which convolves the image with a
9 | * pyramid filter. The pyramid filter is separable and is applied as two
10 | * perpendicular triangle filters.
11 | */
12 |
13 | THREE.TriangleBlurShader = {
14 |
15 | uniforms : {
16 |
17 | "texture": { type: "t", value: null },
18 | "delta": { type: "v2", value:new THREE.Vector2( 1, 1 ) }
19 |
20 | },
21 |
22 | vertexShader: [
23 |
24 | "varying vec2 vUv;",
25 |
26 | "void main() {",
27 |
28 | "vUv = uv;",
29 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
30 |
31 | "}"
32 |
33 | ].join("\n"),
34 |
35 | fragmentShader: [
36 |
37 | "#define ITERATIONS 10.0",
38 |
39 | "uniform sampler2D texture;",
40 | "uniform vec2 delta;",
41 |
42 | "varying vec2 vUv;",
43 |
44 | "float random( vec3 scale, float seed ) {",
45 |
46 | // use the fragment position for a different seed per-pixel
47 |
48 | "return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );",
49 |
50 | "}",
51 |
52 | "void main() {",
53 |
54 | "vec4 color = vec4( 0.0 );",
55 |
56 | "float total = 0.0;",
57 |
58 | // randomize the lookup values to hide the fixed number of samples
59 |
60 | "float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );",
61 |
62 | "for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {",
63 |
64 | "float percent = ( t + offset - 0.5 ) / ITERATIONS;",
65 | "float weight = 1.0 - abs( percent );",
66 |
67 | "color += texture2D( texture, vUv + delta * percent ) * weight;",
68 | "total += weight;",
69 |
70 | "}",
71 |
72 | "gl_FragColor = color / total;",
73 |
74 | "}"
75 |
76 | ].join("\n")
77 |
78 | };
79 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/UnpackDepthRGBAShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Unpack RGBA depth shader
5 | * - show RGBA encoded depth as monochrome color
6 | */
7 |
8 | THREE.UnpackDepthRGBAShader = {
9 |
10 | uniforms: {
11 |
12 | "tDiffuse": { type: "t", value: null },
13 | "opacity": { type: "f", value: 1.0 }
14 |
15 | },
16 |
17 | vertexShader: [
18 |
19 | "varying vec2 vUv;",
20 |
21 | "void main() {",
22 |
23 | "vUv = uv;",
24 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
25 |
26 | "}"
27 |
28 | ].join("\n"),
29 |
30 | fragmentShader: [
31 |
32 | "uniform float opacity;",
33 |
34 | "uniform sampler2D tDiffuse;",
35 |
36 | "varying vec2 vUv;",
37 |
38 | // RGBA depth
39 |
40 | "float unpackDepth( const in vec4 rgba_depth ) {",
41 |
42 | "const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );",
43 | "float depth = dot( rgba_depth, bit_shift );",
44 | "return depth;",
45 |
46 | "}",
47 |
48 | "void main() {",
49 |
50 | "float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );",
51 | "gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );",
52 |
53 | "}"
54 |
55 | ].join("\n")
56 |
57 | };
58 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/VerticalBlurShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author zz85 / http://www.lab4games.net/zz85/blog
3 | *
4 | * Two pass Gaussian blur filter (horizontal and vertical blur shaders)
5 | * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/
6 | * and used in http://www.cake23.de/traveling-wavefronts-lit-up.html
7 | *
8 | * - 9 samples per pass
9 | * - standard deviation 2.7
10 | * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
11 | */
12 |
13 | THREE.VerticalBlurShader = {
14 |
15 | uniforms: {
16 |
17 | "tDiffuse": { type: "t", value: null },
18 | "v": { type: "f", value: 1.0 / 512.0 }
19 |
20 | },
21 |
22 | vertexShader: [
23 |
24 | "varying vec2 vUv;",
25 |
26 | "void main() {",
27 |
28 | "vUv = uv;",
29 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
30 |
31 | "}"
32 |
33 | ].join("\n"),
34 |
35 | fragmentShader: [
36 |
37 | "uniform sampler2D tDiffuse;",
38 | "uniform float v;",
39 |
40 | "varying vec2 vUv;",
41 |
42 | "void main() {",
43 |
44 | "vec4 sum = vec4( 0.0 );",
45 |
46 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;",
47 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;",
48 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;",
49 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;",
50 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
51 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;",
52 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;",
53 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;",
54 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;",
55 |
56 | "gl_FragColor = sum;",
57 |
58 | "}"
59 |
60 | ].join("\n")
61 |
62 | };
63 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/VerticalTiltShiftShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position
5 | *
6 | * - 9 samples per pass
7 | * - standard deviation 2.7
8 | * - "h" and "v" parameters should be set to "1 / width" and "1 / height"
9 | * - "r" parameter control where "focused" horizontal line lies
10 | */
11 |
12 | THREE.VerticalTiltShiftShader = {
13 |
14 | uniforms: {
15 |
16 | "tDiffuse": { type: "t", value: null },
17 | "v": { type: "f", value: 1.0 / 512.0 },
18 | "r": { type: "f", value: 0.35 }
19 |
20 | },
21 |
22 | vertexShader: [
23 |
24 | "varying vec2 vUv;",
25 |
26 | "void main() {",
27 |
28 | "vUv = uv;",
29 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
30 |
31 | "}"
32 |
33 | ].join("\n"),
34 |
35 | fragmentShader: [
36 |
37 | "uniform sampler2D tDiffuse;",
38 | "uniform float v;",
39 | "uniform float r;",
40 |
41 | "varying vec2 vUv;",
42 |
43 | "void main() {",
44 |
45 | "vec4 sum = vec4( 0.0 );",
46 |
47 | "float vv = v * abs( r - vUv.y );",
48 |
49 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;",
50 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;",
51 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;",
52 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;",
53 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
54 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;",
55 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;",
56 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;",
57 | "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;",
58 |
59 | "gl_FragColor = sum;",
60 |
61 | "}"
62 |
63 | ].join("\n")
64 |
65 | };
66 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/three.js/examples/js/shaders/VignetteShader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | *
4 | * Vignette shader
5 | * based on PaintEffect postprocess from ro.me
6 | * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
7 | */
8 |
9 | THREE.VignetteShader = {
10 |
11 | uniforms: {
12 |
13 | "tDiffuse": { type: "t", value: null },
14 | "offset": { type: "f", value: 1.0 },
15 | "darkness": { type: "f", value: 1.0 }
16 |
17 | },
18 |
19 | vertexShader: [
20 |
21 | "varying vec2 vUv;",
22 |
23 | "void main() {",
24 |
25 | "vUv = uv;",
26 | "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
27 |
28 | "}"
29 |
30 | ].join("\n"),
31 |
32 | fragmentShader: [
33 |
34 | "uniform float offset;",
35 | "uniform float darkness;",
36 |
37 | "uniform sampler2D tDiffuse;",
38 |
39 | "varying vec2 vUv;",
40 |
41 | "void main() {",
42 |
43 | // Eskil's vignette
44 |
45 | "vec4 texel = texture2D( tDiffuse, vUv );",
46 | "vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );",
47 | "gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );",
48 |
49 | /*
50 | // alternative version from glfx.js
51 | // this one makes more "dusty" look (as opposed to "burned")
52 |
53 | "vec4 color = texture2D( tDiffuse, vUv );",
54 | "float dist = distance( vUv, vec2( 0.5 ) );",
55 | "color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );",
56 | "gl_FragColor = color;",
57 | */
58 |
59 | "}"
60 |
61 | ].join("\n")
62 |
63 | };
64 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex.dragpancontrols.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 |
4 | THREEx.DragPanControls = function(object, domElement)
5 | {
6 | this._object = object;
7 | this._domElement= domElement || document;
8 |
9 | // parameters that you can change after initialisation
10 | this.target = new THREE.Vector3(0, 0, 0);
11 | this.speedX = 0.03;
12 | this.speedY = 0.03;
13 | this.rangeX = -40;
14 | this.rangeY = +40;
15 |
16 | // private variables
17 | this._mouseX = 0;
18 | this._mouseY = 0;
19 |
20 | var _this = this;
21 | this._$onMouseMove = function(){ _this._onMouseMove.apply(_this, arguments); };
22 | this._$onTouchStart = function(){ _this._onTouchStart.apply(_this, arguments); };
23 | this._$onTouchMove = function(){ _this._onTouchMove.apply(_this, arguments); };
24 |
25 | this._domElement.addEventListener( 'mousemove', this._$onMouseMove, false );
26 | this._domElement.addEventListener( 'touchstart', this._$onTouchStart,false );
27 | this._domElement.addEventListener( 'touchmove', this._$onTouchMove, false );
28 | }
29 |
30 | THREEx.DragPanControls.prototype.destroy = function()
31 | {
32 | this._domElement.removeEventListener( 'mousemove', this._$onMouseMove, false );
33 | this._domElement.removeEventListener( 'touchstart', this._$onTouchStart,false );
34 | this._domElement.removeEventListener( 'touchmove', this._$onTouchMove, false );
35 | }
36 |
37 | THREEx.DragPanControls.prototype.update = function()
38 | {
39 | this._object.position.x += ( this._mouseX * this.rangeX - this._object.position.x ) * this.speedX;
40 | this._object.position.y += ( this._mouseY * this.rangeY - this._object.position.y ) * this.speedY;
41 | this._object.lookAt( this.target );
42 | }
43 |
44 | THREEx.DragPanControls.prototype._onMouseMove = function(event)
45 | {
46 | this._mouseX = ( event.clientX / window.innerWidth ) - 0.5;
47 | this._mouseY = ( event.clientY / window.innerHeight) - 0.5;
48 | }
49 |
50 | THREEx.DragPanControls.prototype._onTouchStart = function(event)
51 | {
52 | if( event.touches.length != 1 ) return;
53 |
54 | // no preventDefault to get click event on ios
55 |
56 | this._mouseX = ( event.touches[ 0 ].pageX / window.innerWidth ) - 0.5;
57 | this._mouseY = ( event.touches[ 0 ].pageY / window.innerHeight) - 0.5;
58 | }
59 |
60 | THREEx.DragPanControls.prototype._onTouchMove = function(event)
61 | {
62 | if( event.touches.length != 1 ) return;
63 |
64 | event.preventDefault();
65 |
66 | this._mouseX = ( event.touches[ 0 ].pageX / window.innerWidth ) - 0.5;
67 | this._mouseY = ( event.touches[ 0 ].pageY / window.innerHeight) - 0.5;
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/Makefile:
--------------------------------------------------------------------------------
1 | # simple makefile to avoid repeatitive tasks
2 |
3 | buildDoc:
4 | docco *.js
5 |
6 | monitorDoc: build
7 | (while inotifywait -r -e modify,attrib,create . ; do make build; done)
8 |
9 | server:
10 | python -m SimpleHTTPServer
11 |
12 | deploy:
13 | # assume there is something to commit
14 | # use "git diff --exit-code HEAD" to know if there is something to commit
15 | # so two lines: one if no commit, one if something to commit
16 | git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~
17 |
18 |
19 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/README.md:
--------------------------------------------------------------------------------
1 | * This should be the root of a git repository but i dunno how to handle submodule
2 |
3 | # TODO
4 | * document those
5 | * you write a lot of code but not a lot of doc
6 | * all that could go in learningthreejs
7 | * what about anotated source.
8 | * easy to write.
9 | * how to present it in the blog
10 | * currently anotated source is isnt too embedable
11 | * should it be a blocker ?
12 | * likely not
13 | * make a super simple post for each
14 | * they need example and all
15 | * how to handle this ?
16 | * an examples directory like three.js ?
17 | * why not ?
18 | * how to handle the maturity of it ?
19 | * many arent too finished
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.CelShader.js:
--------------------------------------------------------------------------------
1 | // define namespaces
2 | var THREEx = THREEx || {};
3 | THREEx.ShaderLib = THREEx.ShaderLib || {};
4 | THREEx.UniformsLib = THREEx.UniformsLib || {};
5 |
6 | // cel shader from ro.me - http://www.ro.me/tech/cel-shader - Apache License 2.0
7 | THREEx.UniformsLib['cel'] = {
8 | "uDirLightPos" : { type: "v3", value: new THREE.Vector3(1,0,0) },
9 | "uDirLightColor" : { type: "c" , value: new THREE.Color( 0xeeeeee ) },
10 | "uAmbientLightColor" : { type: "c" , value: new THREE.Color( 0x050505 ) },
11 | "uBaseColor" : { type: "c" , value: new THREE.Color( 0xff0000 ) }
12 | };
13 |
14 | THREEx.ShaderLib['cel'] = {
15 | vertexShader: [
16 | "varying vec3 vNormal;",
17 | "varying vec3 vRefract;",
18 |
19 | "void main() {",
20 |
21 | "vec4 mPosition = objectMatrix * vec4( position, 1.0 );",
22 | "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
23 | "vec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );",
24 |
25 | "vNormal = normalize( normalMatrix * normal );",
26 |
27 | "vec3 I = mPosition.xyz - cameraPosition;",
28 | "vRefract = refract( normalize( I ), nWorld, 1.02 );",
29 |
30 | "gl_Position = projectionMatrix * mvPosition;",
31 |
32 | "}"
33 | ].join( "\n" ),
34 | fragmentShader: [
35 | "uniform vec3 uBaseColor;",
36 |
37 | "uniform vec3 uDirLightPos;",
38 | "uniform vec3 uDirLightColor;",
39 |
40 | "uniform vec3 uAmbientLightColor;",
41 |
42 | "varying vec3 vNormal;",
43 |
44 | "varying vec3 vRefract;",
45 |
46 | "void main() {",
47 |
48 | "float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);",
49 | "vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;",
50 |
51 | "float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );",
52 | "intensity += length(lightWeighting) * 0.2;",
53 |
54 | "float cameraWeighting = dot( normalize( vNormal ), vRefract );",
55 | "intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );",
56 | "intensity = intensity * 0.2 + 0.3;",
57 |
58 | "if ( intensity < 0.50 ) {",
59 |
60 | "gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );",
61 |
62 | "} else {",
63 |
64 | "gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );",
65 |
66 | "}",
67 |
68 | "}"
69 | ].join( "\n" )
70 | };
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.DeviceOrientationState.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 |
4 | THREEx.DeviceOrientationState = function()
5 | {
6 | // to store the current state
7 | this._state = { x: 0, y: 0, z: 0 };
8 |
9 | this._$callback = function(event){
10 | this._onDeviceOrientation(event);
11 | }.bind(this);
12 |
13 | // bind events
14 | // - spec http://dev.w3.org/geo/api/spec-source-orientation.html
15 | window.addEventListener('deviceorientation', this._$callback);
16 | }
17 |
18 | /**
19 | * To stop listening of the keyboard events
20 | */
21 | THREEx.DeviceOrientationState.prototype.destroy = function()
22 | {
23 | // unbind events
24 | window.removeEventListener('deviceorientation', this._$callback);
25 | }
26 |
27 | //////////////////////////////////////////////////////////////////////////////////
28 | // //
29 | //////////////////////////////////////////////////////////////////////////////////
30 |
31 | /**
32 | * to process the keyboard dom event
33 | */
34 | THREEx.DeviceOrientationState.prototype._onDeviceOrientation = function(event)
35 | {
36 | this._state.x = (!event.alpha ? 0 : event.alpha) * Math.PI / 180;
37 | this._state.y = (!event.beta ? 0 : event.beta ) * Math.PI / 180;
38 | this._state.z = (!event.gamma ? 0 : event.gamma) * Math.PI / 180;
39 | }
40 |
41 |
42 | THREEx.DeviceOrientationState.prototype.angleX = function()
43 | {
44 | return this._state.x;
45 | }
46 |
47 | THREEx.DeviceOrientationState.prototype.angleY = function()
48 | {
49 | return this._state.y;
50 | }
51 |
52 | THREEx.DeviceOrientationState.prototype.angleZ = function()
53 | {
54 | return this._state.z;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.GeometryWobble.js:
--------------------------------------------------------------------------------
1 | var THREEx = THREEx || {};
2 |
3 | THREEx.GeometryWobble = {};
4 |
5 | // Geometry Wobble
6 | // based on paul lewis / areotwist - http://lab.aerotwist.com/webgl/undulating-monkey/
7 |
8 |
9 | THREEx.GeometryWobble.init = function(geometry)
10 | {
11 | for(var i = 0; i < geometry.vertices.length; i++){
12 | var vertex = geometry.vertices[i];
13 | vertex.originalPosition = vertex.clone();
14 | vertex.dirVector = vertex.clone().normalize();
15 | }
16 | geometry.dynamic = true;
17 |
18 | this.cpuAxis(geometry, 'y');
19 | }
20 |
21 | THREEx.GeometryWobble.cpuAxis = function(geometry, type, factor)
22 | {
23 | if( type === undefined ) type = 'x';
24 | if( factor === undefined ) factor = 0.2;
25 |
26 | for(var i = 0; i < geometry.vertices.length; i++) {
27 | var vertex = geometry.vertices[i];
28 | // Note: may need more axis ?
29 | if( type === 'x' ) vertex.axisValue = vertex.originalPosition.x * factor;
30 | else if( type === 'y' ) vertex.axisValue = vertex.originalPosition.y * factor;
31 | else if( type === 'z' ) vertex.axisValue = vertex.originalPosition.z * factor;
32 | else console.assert(false);
33 | }
34 | }
35 |
36 | THREEx.GeometryWobble.Animate = function(geometry, phase, magnitude)
37 | {
38 | if( phase === undefined ) phase = 0;
39 | if( magnitude === undefined ) magnitude = 0.2;
40 |
41 | if( typeof magnitude === "number" ) magnitude = new THREE.Vector3(magnitude, magnitude, magnitude)
42 |
43 |
44 | for(var i = 0; i < geometry.vertices.length; i++) {
45 | var vertex = geometry.vertices[i];
46 | var vertexPhase = Math.cos(phase + vertex.axisValue);
47 |
48 | vertex.x = vertex.originalPosition.x + vertexPhase * vertex.dirVector.x * magnitude.x;
49 | vertex.y = vertex.originalPosition.y + vertexPhase * vertex.dirVector.y * magnitude.y;
50 | vertex.z = vertex.originalPosition.z + vertexPhase * vertex.dirVector.z * magnitude.z;
51 | }
52 | geometry.verticesNeedUpdate = true;
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.LogoTurtle.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 |
4 | // TODO should those relative polar coord function be INSIDE path already ?
5 |
6 | THREEx.LogoTurtle = function()
7 | {
8 | this._penX = 0;
9 | this._penY = 0;
10 | this._angle = 0;
11 | this._vectors = [];
12 | }
13 |
14 | THREEx.LogoTurtle.create = function()
15 | {
16 | return new THREEx.LogoTurtle()
17 | }
18 |
19 | THREEx.LogoTurtle.prototype.turn = function(rotation)
20 | {
21 | this._angle += rotation;
22 | return this;
23 | }
24 |
25 | THREEx.LogoTurtle.prototype.moveTo = function(x, y)
26 | {
27 | this._penX = x * Math.cos(this._angle) - y * Math.sin(this._angle);
28 | this._penY = x * Math.sin(this._angle) + y * Math.cos(this._angle);
29 | this._vectors.push( new THREE.Vector2(this._penX, this._penY) );
30 | return this;
31 | }
32 |
33 | THREEx.LogoTurtle.prototype.forward = function(distance)
34 | {
35 | this._penX += Math.cos(this._angle) * distance;
36 | this._penY += Math.sin(this._angle) * distance;
37 |
38 | this._vectors.push( new THREE.Vector2(this._penX, this._penY) );
39 |
40 | return this;
41 | }
42 |
43 | THREEx.LogoTurtle.prototype.points = function()
44 | {
45 | return this._vectors;
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.SkyMap.js:
--------------------------------------------------------------------------------
1 | var THREEx = THREEx || {};
2 |
3 | THREEx.SkyMap = {};
4 |
5 | THREEx.SkyMap.buildMesh = function(urls, opts)
6 | {
7 | // get parameters
8 | opts = opts || {}
9 | var cubeSize = opts.cubeSize !== undefined ? opts.cubeSize : 100000;
10 |
11 | // load the cube textures
12 | var texture = THREE.ImageUtils.loadTextureCube( urls );
13 |
14 | // init the cube shadder
15 | var shader = THREE.ShaderUtils.lib["cube"];
16 | var uniforms = THREE.UniformsUtils.clone( shader.uniforms );
17 | uniforms['tCube'].texture= textureCube;
18 | var material = new THREE.MeshShaderMaterial({
19 | fragmentShader : shader.fragmentShader,
20 | vertexShader : shader.vertexShader,
21 | uniforms : uniforms
22 | });
23 |
24 | // build the geometry
25 | var geometry = new THREE.CubeGeometry( cubeSize, cubeSize, cubeSize, 1, 1, 1, null, true );
26 |
27 | // build the skybox Mesh
28 | var mesh = new THREE.Mesh( geometry, material );
29 | return mesh;
30 | }
31 |
32 | /**
33 | * Build the urls array for THREEx.SkyMap.buildMesh()
34 | */
35 | THREEx.SkyMap.UrlsPosx = function(prefix, extension)
36 | {
37 | return [
38 | prefix + "posx" + extension,
39 | prefix + "negx" + extension,
40 | prefix + "posy" + extension,
41 | prefix + "negy" + extension,
42 | prefix + "posz" + extension,
43 | prefix + "negz" + extension
44 | ];
45 | return urls;
46 | }
47 |
48 | /**
49 | * Build the urls array for THREEx.SkyMap.buildMesh()
50 | */
51 | THREEx.SkyMap.UrlsPx = function(prefix, extension)
52 | {
53 | return [
54 | prefix + "px" + extension,
55 | prefix + "nx" + extension,
56 | prefix + "py" + extension,
57 | prefix + "ny" + extension,
58 | prefix + "pz" + extension,
59 | prefix + "nz" + extension
60 | ];
61 | return urls;
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.WindowResize.js:
--------------------------------------------------------------------------------
1 | // This THREEx helper makes it easy to handle window resize.
2 | // It will update renderer and camera when window is resized.
3 | //
4 | // # Usage
5 | //
6 | // **Step 1**: Start updating renderer and camera
7 | //
8 | // ```var windowResize = THREEx.WindowResize(aRenderer, aCamera)```
9 | //
10 | // **Step 2**: Start updating renderer and camera
11 | //
12 | // ```windowResize.stop()```
13 | // # Code
14 |
15 | //
16 |
17 | /** @namespace */
18 | var THREEx = THREEx || {};
19 |
20 | /**
21 | * Update renderer and camera when the window is resized
22 | *
23 | * @param {Object} renderer the renderer to update
24 | * @param {Object} Camera the camera to update
25 | */
26 | THREEx.WindowResize = function(renderer, camera){
27 | var callback = function(){
28 | var renderW = window.innerWidth;
29 | var renderH = window.innerHeight;
30 | // notify the renderer of the size change
31 | renderer.setSize( renderW, renderH );
32 | // update the camera
33 | camera.aspect = renderW / renderH;
34 | camera.updateProjectionMatrix();
35 | }
36 | // bind the resize event
37 | window.addEventListener('resize', callback, false);
38 | // return .stop() the function to stop watching window resize
39 | return {
40 | /**
41 | * Stop watching window resize
42 | */
43 | stop : function(){
44 | window.removeEventListener('resize', callback);
45 | },
46 | /**
47 | * to manually trigger a resize
48 | * @type {[type]}
49 | */
50 | trigger : function(){
51 | callback();
52 | },
53 | };
54 | }
55 |
56 | THREEx.WindowResize.bind = function(renderer, camera){
57 | return THREEx.WindowResize(renderer, camera);
58 | }
59 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.glCapability.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Define namespace
3 | */
4 | if(typeof THREEx === "undefined") var THREEx = {};
5 |
6 |
7 | /**
8 | * return the capability of a WebGl context
9 | *
10 | * TODO to rewrite
11 | * - heavily wased on webglreport on sourceforge
12 | * - is there other/better properties
13 | * - should i get a more readable output ?
14 | * - another function ?
15 | *
16 | * @param {WebGLRenderingContext} webgl context
17 | * @returns {Object} capabilities
18 | */
19 | THREEx.glCapability = function(gl)
20 | {
21 | // sanity check - gl context MUST BE WebGLRenderingContext
22 | console.assert(gl instanceof WebGLRenderingContext)
23 | // TODO find better names
24 | var prout = ['VERSION', 'SHADING_LANGUAGE_VERSION', 'VENDOR', 'RENDERER'];
25 | var pixDepth = ['RED_BITS', 'GREEN_BITS', 'BLUE_BITS', 'ALPHA_BITS', 'DEPTH_BITS', 'STENCIL_BITS'];
26 | var slota = ['MAX_RENDERBUFFER_SIZE', 'MAX_COMBINED_TEXTURE_IMAGE_UNITS', 'MAX_CUBE_MAP_TEXTURE_SIZE'
27 | , 'MAX_FRAGMENT_UNIFORM_VECTORS', 'MAX_TEXTURE_IMAGE_UNITS'
28 | , 'MAX_TEXTURE_SIZE', 'MAX_VERTEX_ATTRIBS'
29 | , 'MAX_VERTEX_ATTRIBS', 'MAX_VERTEX_TEXTURE_IMAGE_UNITS'
30 | , 'MAX_VERTEX_UNIFORM_VECTORS'];
31 | var sloti = ['ALIASED_LINE_WIDTH_RANGE', 'ALIASED_POINT_SIZE_RANGE', 'MAX_VIEWPORT_DIMS'];
32 |
33 | var info = {};
34 | var collect = function(arr){
35 | arr.forEach(function(parameter){
36 | //console.log('parameter', parameter)
37 | info[parameter] = gl.getParameter(gl[parameter])
38 | })
39 | }
40 |
41 | collect(prout);
42 | collect(pixDepth);
43 | collect(slota);
44 | collect(sloti)
45 |
46 | // special case to get the extensions
47 | info['SUPPORTED_EXTENSIONS'] = gl.getSupportedExtensions()
48 |
49 | //console.log("info");
50 | //console.dir(info)
51 | return info;
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/THREEx.requestAnimationFrame.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides requestAnimationFrame/cancelRequestAnimation in a cross browser way.
3 | * from paul irish + jerome etienne
4 | * - http://paulirish.com/2011/requestanimationframe-for-smart-animating/
5 | * - http://notes.jetienne.com/2011/05/18/cancelRequestAnimFrame-for-paul-irish-requestAnimFrame.html
6 | */
7 |
8 | if ( !window.requestAnimationFrame ) {
9 |
10 | window.requestAnimationFrame = ( function() {
11 |
12 | return window.webkitRequestAnimationFrame ||
13 | window.mozRequestAnimationFrame ||
14 | window.oRequestAnimationFrame ||
15 | window.msRequestAnimationFrame ||
16 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
17 |
18 | return window.setTimeout( callback, 1000 / 60 );
19 |
20 | };
21 |
22 | } )();
23 |
24 | }
25 |
26 | if ( !window.cancelRequestAnimationFrame ) {
27 |
28 | window.cancelRequestAnimationFrame = ( function() {
29 |
30 | return window.webkitCancelRequestAnimationFrame ||
31 | window.mozCancelRequestAnimationFrame ||
32 | window.oCancelRequestAnimationFrame ||
33 | window.msCancelRequestAnimationFrame ||
34 | clearTimeout
35 |
36 | } )();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/THREEx.DeviceOrientationState.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | angleX:
4 | angleY:
5 | angleZ:
6 |
7 |
18 |
19 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/THREEx.KeyboardState.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Jerome Etienne, http://jetienne.com
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/Makefile:
--------------------------------------------------------------------------------
1 | # makefile to automatize simple operations
2 |
3 | server:
4 | python -m SimpleHTTPServer
5 |
6 | deploy:
7 | # assume there is something to commit
8 | # use "git diff --exit-code HEAD" to know if there is something to commit
9 | # so two lines: one if no commit, one if something to commit
10 | git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~
11 |
12 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/README.md:
--------------------------------------------------------------------------------
1 | [boilerplate for three.js](https://github.com/jeromeetienne/threejsboilerplate)
2 | is a template to get you started. You download it and modify it until it fits your needs.
3 | It is a fast way to start a clean project with [three.js](https://github.com/mrdoob/three.js/).
4 | It avoids repetitive tasks, following DRY principles.
5 | It includes various good practices and compatibilities features.
6 | More details [here](http://learningthreejs.com/blog/2011/12/20/boilerplate-for-three-js/).
7 |
8 | # Get Started
9 | ```
10 | git clone https://github.com/jeromeetienne/threejsboilerplate.git
11 | ```
12 |
13 | And start updating ```index.html``` until it fits yours need.
14 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/REVISION:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/css/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | overflow : hidden;
3 | padding : 0;
4 | margin : 0;
5 |
6 | color : #222;
7 | background-color: #BBB;
8 | font-family : arial;
9 | font-size : 100%;
10 | }
11 | #info a {
12 | color : #66F;
13 | text-decoration : none;
14 | }
15 | #info a:hover {
16 | text-decoration : underline;
17 | }
18 |
19 | #info {
20 | padding : 5px;
21 | }
22 | #info .top {
23 | position : absolute;
24 | top : 0px;
25 | }
26 | #info .middle {
27 | width : 100%;
28 | text-align : center;
29 | }
30 | #info .bottom {
31 | position : absolute;
32 | bottom : 0px;
33 | padding : 5px;
34 | }
35 | #info .right {
36 | position : absolute;
37 | right : 5px;
38 | }
39 |
40 | #codeSample {
41 | font-size : 300%;
42 | }
43 | @media all and (max-width: 640px) {
44 | #codeSample { font-size: 150%; }
45 | }
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/images/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/vendor/threex/examples/threex.domevent/images/.gitignore
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/js/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/vendor/threex/examples/threex.domevent/js/.gitignore
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/sounds/bing.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/vendor/threex/examples/threex.domevent/sounds/bing.wav
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/sounds/boom.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/vendor/threex/examples/threex.domevent/sounds/boom.wav
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/sounds/dong.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeromeetienne/webglvideochat/aa112e7973c31256853abf6b63790d11a7b5eceb/vendor/tquery/vendor/threex/examples/threex.domevent/sounds/dong.wav
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/three.js/Detector.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @author alteredq / http://alteredqualia.com/
3 | * @author mr.doob / http://mrdoob.com/
4 | */
5 |
6 | Detector = {
7 |
8 | canvas : !! window.CanvasRenderingContext2D,
9 | webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
10 | workers : !! window.Worker,
11 | fileapi : window.File && window.FileReader && window.FileList && window.Blob,
12 |
13 | getWebGLErrorMessage : function () {
14 |
15 | var domElement = document.createElement( 'div' );
16 |
17 | domElement.style.fontFamily = 'monospace';
18 | domElement.style.fontSize = '13px';
19 | domElement.style.textAlign = 'center';
20 | domElement.style.background = '#eee';
21 | domElement.style.color = '#000';
22 | domElement.style.padding = '1em';
23 | domElement.style.width = '475px';
24 | domElement.style.margin = '5em auto 0';
25 |
26 | if ( ! this.webgl ) {
27 |
28 | domElement.innerHTML = window.WebGLRenderingContext ? [
29 | 'Your graphics card does not seem to support WebGL.
',
30 | 'Find out how to get it here.'
31 | ].join( '\n' ) : [
32 | 'Your browser does not seem to support WebGL.
',
33 | 'Find out how to get it here.'
34 | ].join( '\n' );
35 |
36 | }
37 |
38 | return domElement;
39 |
40 | },
41 |
42 | addGetWebGLMessage : function ( parameters ) {
43 |
44 | var parent, id, domElement;
45 |
46 | parameters = parameters || {};
47 |
48 | parent = parameters.parent !== undefined ? parameters.parent : document.body;
49 | id = parameters.id !== undefined ? parameters.id : 'oldie';
50 |
51 | domElement = Detector.getWebGLErrorMessage();
52 | domElement.id = id;
53 |
54 | parent.appendChild( domElement );
55 |
56 | }
57 |
58 | };
59 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/three.js/RequestAnimationFrame.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides requestAnimationFrame in a cross browser way.
3 | * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
4 | */
5 |
6 | if ( !window.requestAnimationFrame ) {
7 |
8 | window.requestAnimationFrame = ( function() {
9 |
10 | return window.webkitRequestAnimationFrame ||
11 | window.mozRequestAnimationFrame ||
12 | window.oRequestAnimationFrame ||
13 | window.msRequestAnimationFrame ||
14 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
15 |
16 | window.setTimeout( callback, 1000 / 60 );
17 |
18 | };
19 |
20 | } )();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/Makefile:
--------------------------------------------------------------------------------
1 | # simple makefile to avoid repeatitive tasks
2 |
3 | buildDoc:
4 | docco *.js
5 |
6 | monitorDoc: build
7 | (while inotifywait -r -e modify,attrib,create . ; do make build; done)
8 |
9 | server:
10 | python -m SimpleHTTPServer
11 |
12 | deploy:
13 | # assume there is something to commit
14 | # use "git diff --exit-code HEAD" to know if there is something to commit
15 | # so two lines: one if no commit, one if something to commit
16 | git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~
17 |
18 |
19 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/README.md:
--------------------------------------------------------------------------------
1 | * This should be the root of a git repository but i dunno how to handle submodule
2 |
3 | # TODO
4 | * document those
5 | * you write a lot of code but not a lot of doc
6 | * all that could go in learningthreejs
7 | * what about anotated source.
8 | * easy to write.
9 | * how to present it in the blog
10 | * currently anotated source is isnt too embedable
11 | * should it be a blocker ?
12 | * likely not
13 | * make a super simple post for each
14 | * they need example and all
15 | * how to handle this ?
16 | * an examples directory like three.js ?
17 | * why not ?
18 | * how to handle the maturity of it ?
19 | * many arent too finished
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.CelShader.js:
--------------------------------------------------------------------------------
1 | // define namespaces
2 | var THREEx = THREEx || {};
3 | THREEx.ShaderLib = THREEx.ShaderLib || {};
4 | THREEx.UniformsLib = THREEx.UniformsLib || {};
5 |
6 | // cel shader from ro.me - http://www.ro.me/tech/cel-shader - Apache License 2.0
7 | THREEx.UniformsLib['cel'] = {
8 | "uDirLightPos" : { type: "v3", value: new THREE.Vector3(1,0,0) },
9 | "uDirLightColor" : { type: "c" , value: new THREE.Color( 0xeeeeee ) },
10 | "uAmbientLightColor" : { type: "c" , value: new THREE.Color( 0x050505 ) },
11 | "uBaseColor" : { type: "c" , value: new THREE.Color( 0xff0000 ) }
12 | };
13 |
14 | THREEx.ShaderLib['cel'] = {
15 | vertexShader: [
16 | "varying vec3 vNormal;",
17 | "varying vec3 vRefract;",
18 |
19 | "void main() {",
20 |
21 | "vec4 mPosition = objectMatrix * vec4( position, 1.0 );",
22 | "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
23 | "vec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );",
24 |
25 | "vNormal = normalize( normalMatrix * normal );",
26 |
27 | "vec3 I = mPosition.xyz - cameraPosition;",
28 | "vRefract = refract( normalize( I ), nWorld, 1.02 );",
29 |
30 | "gl_Position = projectionMatrix * mvPosition;",
31 |
32 | "}"
33 | ].join( "\n" ),
34 | fragmentShader: [
35 | "uniform vec3 uBaseColor;",
36 |
37 | "uniform vec3 uDirLightPos;",
38 | "uniform vec3 uDirLightColor;",
39 |
40 | "uniform vec3 uAmbientLightColor;",
41 |
42 | "varying vec3 vNormal;",
43 |
44 | "varying vec3 vRefract;",
45 |
46 | "void main() {",
47 |
48 | "float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);",
49 | "vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;",
50 |
51 | "float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );",
52 | "intensity += length(lightWeighting) * 0.2;",
53 |
54 | "float cameraWeighting = dot( normalize( vNormal ), vRefract );",
55 | "intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );",
56 | "intensity = intensity * 0.2 + 0.3;",
57 |
58 | "if ( intensity < 0.50 ) {",
59 |
60 | "gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );",
61 |
62 | "} else {",
63 |
64 | "gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );",
65 |
66 | "}",
67 |
68 | "}"
69 | ].join( "\n" )
70 | };
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.DeviceOrientationState.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 |
4 | THREEx.DeviceOrientationState = function()
5 | {
6 | // to store the current state
7 | this._state = { x: 0, y: 0, z: 0 };
8 |
9 | this._$callback = function(event){ this._onDeviceOrientation(event); }.bind(this);
10 |
11 | // bind events
12 | // - spec http://dev.w3.org/geo/api/spec-source-orientation.html
13 | window.addEventListener('deviceorientation', this._$callback);
14 | }
15 |
16 | /**
17 | * To stop listening of the keyboard events
18 | */
19 | THREEx.DeviceOrientationState.prototype.destroy = function()
20 | {
21 | // unbind events
22 | window.removeEventListener('deviceorientation', this._$callback);
23 | }
24 |
25 | /**
26 | * to process the keyboard dom event
27 | */
28 | THREEx.DeviceOrientationState.prototype._onDeviceOrientation = function(event)
29 | {
30 | this._state.x = (!event.alpha ? 0 : event.alpha) * Math.PI / 180;
31 | this._state.y = (!event.beta ? 0 : event.beta ) * Math.PI / 180;
32 | this._state.z = (!event.gamma ? 0 : event.gamma) * Math.PI / 180;
33 | }
34 |
35 |
36 | THREEx.DeviceOrientationState.prototype.angleX = function()
37 | {
38 | return this._state.x;
39 | }
40 |
41 | THREEx.DeviceOrientationState.prototype.angleY = function()
42 | {
43 | return this._state.y;
44 | }
45 |
46 | THREEx.DeviceOrientationState.prototype.angleZ = function()
47 | {
48 | return this._state.z;
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.GeometryWobble.js:
--------------------------------------------------------------------------------
1 | var THREEx = THREEx || {};
2 |
3 | THREEx.GeometryWobble = {};
4 |
5 | // Geometry Wobble
6 | // based on paul lewis / areotwist - http://lab.aerotwist.com/webgl/undulating-monkey/
7 |
8 |
9 | THREEx.GeometryWobble.init = function(geometry)
10 | {
11 | for(var i = 0; i < geometry.vertices.length; i++){
12 | var vertex = geometry.vertices[i];
13 | vertex.originalPosition = vertex.position.clone();
14 | vertex.dirVector = vertex.position.clone().normalize();
15 | }
16 | geometry.dynamic = true;
17 |
18 | this.cpuAxis(geometry, 'y')
19 | }
20 |
21 | THREEx.GeometryWobble.cpuAxis = function(geometry, type, factor)
22 | {
23 | if( type === undefined ) type = 'x';
24 | if( factor === undefined ) factor = 0.2;
25 |
26 | for(var i = 0; i < geometry.vertices.length; i++) {
27 | var vertex = geometry.vertices[i];
28 | // Note: may need more axis ?
29 | if( type === 'x' ) vertex.axisValue = vertex.originalPosition.x * factor;
30 | else if( type === 'y' ) vertex.axisValue = vertex.originalPosition.y * factor;
31 | else if( type === 'z' ) vertex.axisValue = vertex.originalPosition.z * factor;
32 | else console.assert(false);
33 | }
34 | }
35 |
36 | THREEx.GeometryWobble.Animate = function(geometry, phase, magnitude)
37 | {
38 | if( phase === undefined ) phase = 0;
39 | if( magnitude === undefined ) magnitude = 0.2;
40 |
41 | if( typeof magnitude === "number" ) magnitude = new THREE.Vector3(magnitude, magnitude, magnitude)
42 |
43 |
44 | for(var i = 0; i < geometry.vertices.length; i++) {
45 | var vertex = geometry.vertices[i];
46 | var vertexPhase = Math.cos(phase + vertex.axisValue);
47 |
48 | vertex.position.x = vertex.originalPosition.x + vertexPhase * vertex.dirVector.x * magnitude.x;
49 | vertex.position.y = vertex.originalPosition.y + vertexPhase * vertex.dirVector.y * magnitude.y;
50 | vertex.position.z = vertex.originalPosition.z + vertexPhase * vertex.dirVector.z * magnitude.z;
51 | }
52 |
53 | geometry.__dirtyVertices = true;
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.LogoTurtle.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 |
4 | // TODO should those relative polar coord function be INSIDE path already ?
5 |
6 | THREEx.LogoTurtle = function()
7 | {
8 | this._penX = 0;
9 | this._penY = 0;
10 | this._angle = 0;
11 | this._vectors = [];
12 | }
13 |
14 | THREEx.LogoTurtle.create = function()
15 | {
16 | return new THREEx.LogoTurtle()
17 | }
18 |
19 | THREEx.LogoTurtle.prototype.turn = function(rotation)
20 | {
21 | this._angle += rotation;
22 | return this;
23 | }
24 |
25 | THREEx.LogoTurtle.prototype.moveTo = function(x, y)
26 | {
27 | this._penX = x * Math.cos(this._angle) - y * Math.sin(this._angle);
28 | this._penY = x * Math.sin(this._angle) + y * Math.cos(this._angle);
29 | this._vectors.push( new THREE.Vector2(this._penX, this._penY) );
30 | return this;
31 | }
32 |
33 | THREEx.LogoTurtle.prototype.forward = function(distance)
34 | {
35 | this._penX += Math.cos(this._angle) * distance;
36 | this._penY += Math.sin(this._angle) * distance;
37 |
38 | this._vectors.push( new THREE.Vector2(this._penX, this._penY) );
39 |
40 | return this;
41 | }
42 |
43 | THREEx.LogoTurtle.prototype.points = function()
44 | {
45 | return this._vectors;
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.SkyMap.js:
--------------------------------------------------------------------------------
1 | var THREEx = THREEx || {};
2 |
3 | THREEx.SkyMap = {};
4 |
5 | THREEx.SkyMap.buildMesh = function(urls, opts)
6 | {
7 | // get parameters
8 | opts = opts || {}
9 | var cubeSize = opts.cubeSize !== undefined ? opts.cubeSize : 100000;
10 |
11 | // load the cube textures
12 | var texture = THREE.ImageUtils.loadTextureCube( urls );
13 |
14 | // init the cube shadder
15 | var shader = THREE.ShaderUtils.lib["cube"];
16 | var uniforms = THREE.UniformsUtils.clone( shader.uniforms );
17 | uniforms['tCube'].texture= textureCube;
18 | var material = new THREE.MeshShaderMaterial({
19 | fragmentShader : shader.fragmentShader,
20 | vertexShader : shader.vertexShader,
21 | uniforms : uniforms
22 | });
23 |
24 | // build the geometry
25 | var geometry = new THREE.CubeGeometry( cubeSize, cubeSize, cubeSize, 1, 1, 1, null, true );
26 |
27 | // build the skybox Mesh
28 | var mesh = new THREE.Mesh( geometry, material );
29 | return mesh;
30 | }
31 |
32 | /**
33 | * Build the urls array for THREEx.SkyMap.buildMesh()
34 | */
35 | THREEx.SkyMap.UrlsPosx = function(prefix, extension)
36 | {
37 | return [
38 | prefix + "posx" + extension,
39 | prefix + "negx" + extension,
40 | prefix + "posy" + extension,
41 | prefix + "negy" + extension,
42 | prefix + "posz" + extension,
43 | prefix + "negz" + extension
44 | ];
45 | return urls;
46 | }
47 |
48 | /**
49 | * Build the urls array for THREEx.SkyMap.buildMesh()
50 | */
51 | THREEx.SkyMap.UrlsPx = function(prefix, extension)
52 | {
53 | return [
54 | prefix + "px" + extension,
55 | prefix + "nx" + extension,
56 | prefix + "py" + extension,
57 | prefix + "ny" + extension,
58 | prefix + "pz" + extension,
59 | prefix + "nz" + extension
60 | ];
61 | return urls;
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.WindowResize.js:
--------------------------------------------------------------------------------
1 | // This THREEx helper makes it easy to handle window resize.
2 | // It will update renderer and camera when window is resized.
3 | //
4 | // # Usage
5 | //
6 | // **Step 1**: Start updating renderer and camera
7 | //
8 | // ```var windowResize = THREEx.WindowResize(aRenderer, aCamera)```
9 | //
10 | // **Step 2**: Start updating renderer and camera
11 | //
12 | // ```windowResize.stop()```
13 | // # Code
14 |
15 | //
16 |
17 | /** @namespace */
18 | var THREEx = THREEx || {};
19 |
20 | /**
21 | * Update renderer and camera when the window is resized
22 | *
23 | * @param {Object} renderer the renderer to update
24 | * @param {Object} Camera the camera to update
25 | */
26 | THREEx.WindowResize = function(renderer, camera){
27 | var callback = function(){
28 | // notify the renderer of the size change
29 | renderer.setSize( window.innerWidth, window.innerHeight );
30 | // update the camera
31 | camera.aspect = window.innerWidth / window.innerHeight;
32 | camera.updateProjectionMatrix();
33 | }
34 | // bind the resize event
35 | window.addEventListener('resize', callback, false);
36 | // return .stop() the function to stop watching window resize
37 | return {
38 | /**
39 | * Stop watching window resize
40 | */
41 | stop : function(){
42 | window.removeEventListener('resize', callback);
43 | }
44 | };
45 | }
46 |
47 | THREEx.WindowResize.bind = function(renderer, camera){
48 | return THREEx.WindowResize(renderer, camera);
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.glCapability.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Define namespace
3 | */
4 | if(typeof THREEx === "undefined") var THREEx = {};
5 |
6 |
7 | /**
8 | * return the capability of a WebGl context
9 | *
10 | * TODO to rewrite
11 | * - heavily wased on webglreport on sourceforge
12 | * - is there other/better properties
13 | * - should i get a more readable output ?
14 | * - another function ?
15 | *
16 | * @param {WebGLRenderingContext} webgl context
17 | * @returns {Object} capabilities
18 | */
19 | THREEx.glCapability = function(gl)
20 | {
21 | // sanity check - gl context MUST BE WebGLRenderingContext
22 | console.assert(gl instanceof WebGLRenderingContext)
23 | // TODO find better names
24 | var prout = ['VERSION', 'SHADING_LANGUAGE_VERSION', 'VENDOR', 'RENDERER'];
25 | var pixDepth = ['RED_BITS', 'GREEN_BITS', 'BLUE_BITS', 'ALPHA_BITS', 'DEPTH_BITS', 'STENCIL_BITS'];
26 | var slota = ['MAX_RENDERBUFFER_SIZE', 'MAX_COMBINED_TEXTURE_IMAGE_UNITS', 'MAX_CUBE_MAP_TEXTURE_SIZE'
27 | , 'MAX_FRAGMENT_UNIFORM_VECTORS', 'MAX_TEXTURE_IMAGE_UNITS'
28 | , 'MAX_TEXTURE_SIZE', 'MAX_VERTEX_ATTRIBS'
29 | , 'MAX_VERTEX_ATTRIBS', 'MAX_VERTEX_TEXTURE_IMAGE_UNITS'
30 | , 'MAX_VERTEX_UNIFORM_VECTORS'];
31 | var sloti = ['ALIASED_LINE_WIDTH_RANGE', 'ALIASED_POINT_SIZE_RANGE', 'MAX_VIEWPORT_DIMS'];
32 |
33 | var info = {};
34 | var collect = function(arr){
35 | arr.forEach(function(parameter){
36 | //console.log('parameter', parameter)
37 | info[parameter] = gl.getParameter(gl[parameter])
38 | })
39 | }
40 |
41 | collect(prout);
42 | collect(pixDepth);
43 | collect(slota);
44 | collect(sloti)
45 |
46 | // special case to get the extensions
47 | info['SUPPORTED_EXTENSIONS'] = gl.getSupportedExtensions()
48 |
49 | //console.log("info");
50 | //console.dir(info)
51 | return info;
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/THREEx.requestAnimationFrame.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides requestAnimationFrame/cancelRequestAnimation in a cross browser way.
3 | * from paul irish + jerome etienne
4 | * - http://paulirish.com/2011/requestanimationframe-for-smart-animating/
5 | * - http://notes.jetienne.com/2011/05/18/cancelRequestAnimFrame-for-paul-irish-requestAnimFrame.html
6 | */
7 |
8 | if ( !window.requestAnimationFrame ) {
9 |
10 | window.requestAnimationFrame = ( function() {
11 |
12 | return window.webkitRequestAnimationFrame ||
13 | window.mozRequestAnimationFrame ||
14 | window.oRequestAnimationFrame ||
15 | window.msRequestAnimationFrame ||
16 | function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
17 |
18 | return window.setTimeout( callback, 1000 / 60 );
19 |
20 | };
21 |
22 | } )();
23 |
24 | }
25 |
26 | if ( !window.cancelRequestAnimationFrame ) {
27 |
28 | window.cancelRequestAnimationFrame = ( function() {
29 |
30 | return window.webkitCancelRequestAnimationFrame ||
31 | window.mozCancelRequestAnimationFrame ||
32 | window.oCancelRequestAnimationFrame ||
33 | window.msCancelRequestAnimationFrame ||
34 | clearTimeout
35 |
36 | } )();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/THREEx.DeviceOrientationState.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | angleX:
4 | angleY:
5 | angleZ:
6 |
7 |
18 |
19 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/THREEx.KeyboardState.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/threex.embedded/noshield-host.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | dummy div 1024px height to create a scrollable page
7 |
8 |
9 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/threex.embedded/noshield-iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 | WITHOUT shielding events
15 | Click to get focus
16 |
17 | Got Focus!
18 | Now use arrow UP/DOWN and the host page will scroll as events are not shielded.
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/threex.embedded/withshield-host.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | dummy div 1024px height to create a scrollable page
7 |
8 |
9 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/threex.embedded/withshield-iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
15 | WITH shielding events
16 |
17 | Click to get focus
18 |
19 | Got Focus!
20 | now use arrow UP/DOWN and the host page won't scroll as events are shielded.
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/examples/threex.fullscreen.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | threex.fullscreen.js demo
4 | threex.js - helpers for three.js
5 |
6 |
7 | fullscreen available ?
8 |
9 | fullscreen activated ?
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
35 |
36 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/threex.chromeWebStoreInstall.js:
--------------------------------------------------------------------------------
1 | // This THREEx helper makes it easy to handle chrome.webstore.install API.
2 | // * api description http://code.google.com/chrome/webstore/docs/inline_installation.html
3 | // * paul kinlan post on g+ https://plus.google.com/116059998563577101552/posts/c9zYiA9RdC5
4 | //
5 | // # Code
6 |
7 | //
8 |
9 |
10 | /** @namespace */
11 | var THREEx = THREEx || {};
12 | THREEx.ChromeWebStoreInstall = THREEx.ChromeWebStoreInstall || {};
13 |
14 | /**
15 | * test if the API is available
16 | * @returns {Boolean} true if the API is available, false otherwise
17 | */
18 | THREEx.ChromeWebStoreInstall.apiAvailable = function()
19 | {
20 | var available = typeof chrome !== 'undefined' && chrome.webstore && chrome.webstore.install;
21 | return available ? true : false;
22 | }
23 |
24 | /**
25 | * Test if the application is already installed
26 | *
27 | * @returns {Boolean} true if the application is installed, false otherwise
28 | */
29 | THREEx.ChromeWebStoreInstall.isInstalled = function()
30 | {
31 | if( !this.apiAvailable() ) return false;
32 | return chrome.app.isInstalled ? true : false;
33 | }
34 |
35 | /**
36 | * Trigger an installation
37 | * @param {String} url of the application (optional)
38 | * @param {Function} callback called if installation succeed
39 | * @param {Function} callback called if installation failed
40 | */
41 | THREEx.ChromeWebStoreInstall.install = function(url, successCallback, failureCallback)
42 | {
43 | console.assert( this.apiAvailable() )
44 | chrome.webstore.install(url, successCallback, failureCallback);
45 | }
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/threex.embedded.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 | THREEx.Embedded = THREEx.Embedded || {};
4 |
5 | /**
6 | * @returns {Boolean} return true if we are in a iframe, false otherwise
7 | */
8 | THREEx.Embedded.inIFrame = function()
9 | {
10 | return window != window.top ? true : false;
11 | }
12 |
13 | /**
14 | * Prevent Arrows key event from going out of the iframe
15 | */
16 | THREEx.Embedded.shieldArrowKeys = function()
17 | {
18 | document.addEventListener('keydown', function(event){
19 | // if it is keydown on a arrow, prevent default
20 | if( event.keyCode >= 37 && event.keyCode <= 40 ){
21 | event.preventDefault();
22 | }
23 | }, true);
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.domevent/vendor/threex/threex.texturePoolBall.js:
--------------------------------------------------------------------------------
1 | // NOTE: this match THREE namespace on purpose
2 | if(typeof THREEx === "undefined") var THREEx = {};
3 | if(typeof THREEx.Texture === "undefined") THREEx.Texture = {};
4 |
5 | /**
6 | */
7 | THREEx.Texture.PoolBall = {
8 | clear : function(canvas){
9 | var w = canvas.width;
10 | var ctx = canvas.getContext( '2d' );
11 | clearRect(0, 0, w, w);
12 | },
13 | /**
14 | * display the shaddow of the smiley in a texture
15 | *
16 | * @param {canvasElement} the canvas where we draw
17 | */
18 | draw : function(canvas, textData, stripped, color){
19 | var ctx = canvas.getContext( '2d' );
20 | var w = canvas.width;
21 | var h = canvas.height;
22 |
23 | // base color is white
24 | ctx.save();
25 | ctx.fillStyle = "#FFFFFF";
26 | ctx.fillRect(0,0, w, h);
27 | ctx.restore();
28 |
29 | ctx.save();
30 | ctx.translate(w/2, h/2)
31 | var rectH = stripped ? h/2 : h;
32 | ctx.fillStyle = color.getContextStyle();
33 | ctx.fillRect(-w/2,-rectH/2, w, rectH);
34 | ctx.restore();
35 |
36 | ctx.save();
37 | ctx.translate(w/2, h/2)
38 | ctx.fillStyle = "#FFFFFF";
39 | var radiusW = 0.7 * w/4;
40 | var radiusH = 1.2 * h/4;
41 | ctx.fillEllipse( -radiusW/2, -radiusH/2, radiusW, radiusH);
42 | ctx.restore();
43 |
44 | ctx.save();
45 | ctx.translate(w/2, h/2)
46 | var textH = w/4;
47 | ctx.font = "bolder "+textH+"px Arial";
48 | ctx.fillStyle = "#000000";
49 | var textW = ctx.measureText(textData).width;
50 | ctx.fillText(textData, -textW/2, 0.8*textH/2);
51 | ctx.restore();
52 | },
53 |
54 | //////////////////////////////////////////////////////////////////////////////////
55 | // texture helper //
56 | //////////////////////////////////////////////////////////////////////////////////
57 |
58 | ballTexture: function( textData, stripped, color, canvasW, mapping, callback ) {
59 | var canvasDrawer = function(canvas){
60 | THREEx.Texture.PoolBall.draw(canvas, textData, stripped, color);
61 | }
62 | return THREEx.Texture.PoolBall._buildTexture( canvasW, mapping, callback, canvasDrawer );
63 | },
64 |
65 | _buildTexture: function( canvasW, mapping, callback, canvasDrawer ) {
66 | canvasW = typeof canvasW !== 'undefined' ? canvasW : 64;
67 | var canvas = document.createElement('canvas');
68 | canvas.width = canvas.height = canvasW;
69 | var texture = new THREE.Texture(canvas, mapping);
70 |
71 | canvasDrawer(canvas);
72 |
73 | texture.needsUpdate = true;
74 | if( callback ) callback( this );
75 | return texture;
76 | },
77 |
78 | }
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.embedded/noshield-host.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | dummy div 1024px height to create a scrollable page
7 |
8 |
9 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.embedded/noshield-iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 | WITHOUT shielding events
15 | Click to get focus
16 |
17 | Got Focus!
18 | Now use arrow UP/DOWN and the host page will scroll as events are not shielded.
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.embedded/withshield-host.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | dummy div 1024px height to create a scrollable page
7 |
8 |
9 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.embedded/withshield-iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
15 | WITH shielding events
16 |
17 | Click to get focus
18 |
19 | Got Focus!
20 | now use arrow UP/DOWN and the host page won't scroll as events are shielded.
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/examples/threex.fullscreen.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | threex.fullscreen.js demo
4 | threex.js - helpers for three.js
5 |
6 |
7 | fullscreen available ?
8 |
9 | fullscreen activated ?
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
35 |
36 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/threex.chromeWebStoreInstall.js:
--------------------------------------------------------------------------------
1 | // This THREEx helper makes it easy to handle chrome.webstore.install API.
2 | // * api description http://code.google.com/chrome/webstore/docs/inline_installation.html
3 | // * paul kinlan post on g+ https://plus.google.com/116059998563577101552/posts/c9zYiA9RdC5
4 | //
5 | // # Code
6 |
7 | //
8 |
9 |
10 | /** @namespace */
11 | var THREEx = THREEx || {};
12 | THREEx.ChromeWebStoreInstall = THREEx.ChromeWebStoreInstall || {};
13 |
14 | /**
15 | * test if the API is available
16 | * @returns {Boolean} true if the API is available, false otherwise
17 | */
18 | THREEx.ChromeWebStoreInstall.apiAvailable = function()
19 | {
20 | var available = typeof chrome !== 'undefined' && chrome.webstore && chrome.webstore.install;
21 | return available ? true : false;
22 | }
23 |
24 | /**
25 | * Test if the application is already installed
26 | *
27 | * @returns {Boolean} true if the application is installed, false otherwise
28 | */
29 | THREEx.ChromeWebStoreInstall.isInstalled = function()
30 | {
31 | if( !this.apiAvailable() ) return false;
32 | return chrome.app.isInstalled ? true : false;
33 | }
34 |
35 | /**
36 | * Trigger an installation
37 | * @param {String} url of the application (optional)
38 | * @param {Function} callback called if installation succeed
39 | * @param {Function} callback called if installation failed
40 | */
41 | THREEx.ChromeWebStoreInstall.install = function(url, successCallback, failureCallback)
42 | {
43 | console.assert( this.apiAvailable() )
44 | chrome.webstore.install(url, successCallback, failureCallback);
45 | }
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/threex.embedded.js:
--------------------------------------------------------------------------------
1 | /** @namespace */
2 | var THREEx = THREEx || {};
3 | THREEx.Embedded = THREEx.Embedded || {};
4 |
5 | /**
6 | * @returns {Boolean} return true if we are in a iframe, false otherwise
7 | */
8 | THREEx.Embedded.inIFrame = function()
9 | {
10 | return window != window.top ? true : false;
11 | }
12 |
13 | /**
14 | * Prevent Arrows key event from going out of the iframe
15 | */
16 | THREEx.Embedded.shieldArrowKeys = function()
17 | {
18 | document.addEventListener('keydown', function(event){
19 | // if it is keydown on a arrow, prevent default
20 | if( event.keyCode >= 37 && event.keyCode <= 40 ){
21 | event.preventDefault();
22 | }
23 | }, true);
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/tquery/vendor/threex/threex.texturePoolBall.js:
--------------------------------------------------------------------------------
1 | // NOTE: this match THREE namespace on purpose
2 | if(typeof THREEx === "undefined") var THREEx = {};
3 | if(typeof THREEx.Texture === "undefined") THREEx.Texture = {};
4 |
5 | /**
6 | */
7 | THREEx.Texture.PoolBall = {
8 | clear : function(canvas){
9 | var w = canvas.width;
10 | var ctx = canvas.getContext( '2d' );
11 | clearRect(0, 0, w, w);
12 | },
13 | /**
14 | * display the shaddow of the smiley in a texture
15 | *
16 | * @param {canvasElement} the canvas where we draw
17 | */
18 | draw : function(canvas, textData, stripped, color){
19 | var ctx = canvas.getContext( '2d' );
20 | var w = canvas.width;
21 | var h = canvas.height;
22 |
23 | // base color is white
24 | ctx.save();
25 | ctx.fillStyle = "#FFFFFF";
26 | ctx.fillRect(0,0, w, h);
27 | ctx.restore();
28 |
29 | ctx.save();
30 | ctx.translate(w/2, h/2)
31 | var rectH = stripped ? h/2 : h;
32 | ctx.fillStyle = color.getContextStyle();
33 | ctx.fillRect(-w/2,-rectH/2, w, rectH);
34 | ctx.restore();
35 |
36 | ctx.save();
37 | ctx.translate(w/2, h/2)
38 | ctx.fillStyle = "#FFFFFF";
39 | var radiusW = 0.7 * w/4;
40 | var radiusH = 1.2 * h/4;
41 | ctx.fillEllipse( -radiusW/2, -radiusH/2, radiusW, radiusH);
42 | ctx.restore();
43 |
44 | ctx.save();
45 | ctx.translate(w/2, h/2)
46 | var textH = w/4;
47 | ctx.font = "bolder "+textH+"px Arial";
48 | ctx.fillStyle = "#000000";
49 | var textW = ctx.measureText(textData).width;
50 | ctx.fillText(textData, -textW/2, 0.8*textH/2);
51 | ctx.restore();
52 | },
53 |
54 | //////////////////////////////////////////////////////////////////////////////////
55 | // texture helper //
56 | //////////////////////////////////////////////////////////////////////////////////
57 |
58 | ballTexture: function( textData, stripped, color, canvasW, mapping, callback ) {
59 | var canvasDrawer = function(canvas){
60 | THREEx.Texture.PoolBall.draw(canvas, textData, stripped, color);
61 | }
62 | return THREEx.Texture.PoolBall._buildTexture( canvasW, mapping, callback, canvasDrawer );
63 | },
64 |
65 | _buildTexture: function( canvasW, mapping, callback, canvasDrawer ) {
66 | canvasW = typeof canvasW !== 'undefined' ? canvasW : 64;
67 | var canvas = document.createElement('canvas');
68 | canvas.width = canvas.height = canvasW;
69 | var texture = new THREE.Texture(canvas, mapping);
70 |
71 | canvasDrawer(canvas);
72 |
73 | texture.needsUpdate = true;
74 | if( callback ) callback( this );
75 | return texture;
76 | },
77 |
78 | }
--------------------------------------------------------------------------------