diff --git a/README.md b/README.md index 6b68a97a..82546fc0 100644 --- a/README.md +++ b/README.md @@ -14,43 +14,49 @@ More? [#three.js on irc.freenode.net](http://webchat.freenode.net/?channels=thre #### WebGL (Context 3D) #### -[![shader](http://mrdoob.github.com/three.js/assets/examples/34_shader.png)](http://mrdoob.github.com/three.js/examples/shader.html) -[![materials_normalmap2](http://mrdoob.github.com/three.js/assets/examples/33_materials_normalmap2.png)](http://mrdoob.github.com/three.js/examples/materials_normalmap2.html) -[![materials_grass](http://mrdoob.github.com/three.js/assets/examples/32_materials_grass.png)](http://mrdoob.github.com/three.js/examples/materials_grass.html) -[![materials_normalmap](http://mrdoob.github.com/three.js/assets/examples/31_materials_normalmap.png)](http://mrdoob.github.com/three.js/examples/materials_normalmap.html) -[![geometry_terrain_gl](http://mrdoob.github.com/three.js/assets/examples/30_geometry_terrain_gl.png)](http://mrdoob.github.com/three.js/examples/geometry_terrain_gl.html) -[![geometry_minecraft](http://mrdoob.github.com/three.js/assets/examples/29_geometry_minecraft.png)](http://mrdoob.github.com/three.js/examples/geometry_minecraft_ao.html) -[![materials_shader_fresnel](http://mrdoob.github.com/three.js/assets/examples/28_materials_shaders_fresnel.png)](http://mrdoob.github.com/three.js/examples/materials_shaders_fresnel.html) -[![materials_cars](http://mrdoob.github.com/three.js/assets/examples/25_materials_cars.png)](http://mrdoob.github.com/three.js/examples/materials_cars.html) -[![materials_cubemap_refraction](http://mrdoob.github.com/three.js/assets/examples/18_materials_cubemap_refraction.png)](http://mrdoob.github.com/three.js/examples/materials_cubemap_refraction.html) -[![materials_cubemap_balls_reflection](http://mrdoob.github.com/three.js/assets/examples/15_materials_cubemap_balls_reflection.png)](http://mrdoob.github.com/three.js/examples/materials_cubemap_balls_reflection.html) -[![materials_cubemap_balls_refraction](http://mrdoob.github.com/three.js/assets/examples/16_materials_cubemap_balls_refraction.png)](http://mrdoob.github.com/three.js/examples/materials_cubemap_balls_refraction.html) -[![materials_cubemap_escher](http://mrdoob.github.com/three.js/assets/examples/17_materials_cubemap_escher.png)](http://mrdoob.github.com/three.js/examples/materials_cubemap_escher.html) -[![materials_cubemap](http://mrdoob.github.com/three.js/assets/examples/14_materials_cubemap.png)](http://mrdoob.github.com/three.js/examples/materials_cubemap.html) -[![materials_gl](http://mrdoob.github.com/three.js/assets/examples/20_materials_gl.png)](http://mrdoob.github.com/three.js/examples/materials_gl.html) -[![materials_shaders](http://mrdoob.github.com/three.js/assets/examples/23_materials_shaders.png)](http://mrdoob.github.com/three.js/examples/materials_shaders.html) -[![large_mesh](http://mrdoob.github.com/three.js/assets/examples/12_large_mesh.png)](http://mrdoob.github.com/three.js/examples/geometry_large_mesh.html) +[![video](http://mrdoob.github.com/three.js/assets/examples/40_video.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_video.html) +[![dof](http://mrdoob.github.com/three.js/assets/examples/39_dof.png)](http://mrdoob.github.com/three.js/examples/webgl_postprocessing_dof.html) +[![ribbon](http://mrdoob.github.com/three.js/assets/examples/38_ribbon.png)](http://mrdoob.github.com/three.js/examples/webgl_ribbons.html) +[![vertexcolors](http://mrdoob.github.com/three.js/assets/examples/37_vertexcolors.png)](http://mrdoob.github.com/three.js/examples/webgl_geometry_colors.html) +[![particles](http://mrdoob.github.com/three.js/assets/examples/36_particles.png)](http://mrdoob.github.com/three.js/examples/webgl_particles_billboards_colors.html) +[![lines](http://mrdoob.github.com/three.js/assets/examples/35_lines.png)](http://mrdoob.github.com/three.js/examples/webgl_lines_colors.html) +[![shader](http://mrdoob.github.com/three.js/assets/examples/34_shader.png)](http://mrdoob.github.com/three.js/examples/webgl_shader.html) +[![materials_normalmap2](http://mrdoob.github.com/three.js/assets/examples/33_materials_normalmap2.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_normalmap2.html) +[![materials_grass](http://mrdoob.github.com/three.js/assets/examples/32_materials_grass.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_grass.html) +[![materials_normalmap](http://mrdoob.github.com/three.js/assets/examples/31_materials_normalmap.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_normalmap.html) +[![geometry_terrain_gl](http://mrdoob.github.com/three.js/assets/examples/30_geometry_terrain_gl.png)](http://mrdoob.github.com/three.js/examples/webgl_geometry_terrain.html) +[![geometry_minecraft](http://mrdoob.github.com/three.js/assets/examples/29_geometry_minecraft.png)](http://mrdoob.github.com/three.js/examples/webgl_geometry_minecraft_ao.html) +[![materials_shader_fresnel](http://mrdoob.github.com/three.js/assets/examples/28_materials_shaders_fresnel.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_shaders_fresnel.html) +[![materials_cars](http://mrdoob.github.com/three.js/assets/examples/25_materials_cars.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_cars.html) +[![materials_cubemap_refraction](http://mrdoob.github.com/three.js/assets/examples/18_materials_cubemap_refraction.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_cubemap_refraction.html) +[![materials_cubemap_balls_reflection](http://mrdoob.github.com/three.js/assets/examples/15_materials_cubemap_balls_reflection.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_cubemap_balls_reflection.html) +[![materials_cubemap_balls_refraction](http://mrdoob.github.com/three.js/assets/examples/16_materials_cubemap_balls_refraction.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_cubemap_balls_refraction.html) +[![materials_cubemap_escher](http://mrdoob.github.com/three.js/assets/examples/17_materials_cubemap_escher.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_cubemap_escher.html) +[![materials_cubemap](http://mrdoob.github.com/three.js/assets/examples/14_materials_cubemap.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_cubemap.html) +[![materials_gl](http://mrdoob.github.com/three.js/assets/examples/20_materials_gl.png)](http://mrdoob.github.com/three.js/examples/webgl_materials.html) +[![materials_shaders](http://mrdoob.github.com/three.js/assets/examples/23_materials_shaders.png)](http://mrdoob.github.com/three.js/examples/webgl_materials_shaders.html) +[![large_mesh](http://mrdoob.github.com/three.js/assets/examples/12_large_mesh.png)](http://mrdoob.github.com/three.js/examples/webgl_geometry_large_mesh.html) #### Canvas (Context 2D) #### -[![materials_reflection](http://mrdoob.github.com/three.js/assets/examples/27_materials_reflection.png)](http://mrdoob.github.com/three.js/examples/materials_reflection.html) -[![materials](http://mrdoob.github.com/three.js/assets/examples/13_materials.png)](http://mrdoob.github.com/three.js/examples/materials.html) -[![materials_depth](http://mrdoob.github.com/three.js/assets/examples/19_materials_depth.png)](http://mrdoob.github.com/three.js/examples/materials_depth.html) -[![materials_normal](http://mrdoob.github.com/three.js/assets/examples/22_materials_normal.png)](http://mrdoob.github.com/three.js/examples/materials_normal.html) -[![lights_pointlights](http://mrdoob.github.com/three.js/assets/examples/09_walthead.png)](http://mrdoob.github.com/three.js/examples/lights_pointlights.html) -[![interactive_cubes](http://mrdoob.github.com/three.js/assets/examples/11_interactive.png)](http://mrdoob.github.com/three.js/examples/interactive_cubes.html) -[![camera_ortographic](http://mrdoob.github.com/three.js/assets/examples/10_orthographic.png)](http://mrdoob.github.com/three.js/examples/camera_orthographic.html) -[![geometry_birds](http://mrdoob.github.com/three.js/assets/examples/08_birds.png)](http://mrdoob.github.com/three.js/examples/geometry_birds.html) -[![geometry_earth](http://mrdoob.github.com/three.js/assets/examples/07_earth.png)](http://mrdoob.github.com/three.js/examples/geometry_earth.html) -[![geometry_terrain](http://mrdoob.github.com/three.js/assets/examples/06_terrain.png)](http://mrdoob.github.com/three.js/examples/geometry_terrain.html) -[![materials_video](http://mrdoob.github.com/three.js/assets/examples/24_materials_video.png)](http://mrdoob.github.com/three.js/examples/materials_video.html) -[![geometry_panorama](http://mrdoob.github.com/three.js/assets/examples/04_vr.png)](http://mrdoob.github.com/three.js/examples/geometry_panorama.html) -[![geometry_cube](http://mrdoob.github.com/three.js/assets/examples/03_cube.png)](http://mrdoob.github.com/three.js/examples/geometry_cube.html) -[![particles_sprites](http://mrdoob.github.com/three.js/assets/examples/26_particles_sprites.png)](http://mrdoob.github.com/three.js/examples/particles_sprites.html) -[![particles_random](http://mrdoob.github.com/three.js/assets/examples/02_random.png)](http://mrdoob.github.com/three.js/examples/particles_random.html) -[![particles_wave](http://mrdoob.github.com/three.js/assets/examples/01_waves.png)](http://mrdoob.github.com/three.js/examples/particles_waves.html) -[![particles_floor](http://mrdoob.github.com/three.js/assets/examples/00_floor.png)](http://mrdoob.github.com/three.js/examples/particles_floor.html) +[![materials_reflection](http://mrdoob.github.com/three.js/assets/examples/27_materials_reflection.png)](http://mrdoob.github.com/three.js/examples/canvas_materials_reflection.html) +[![materials](http://mrdoob.github.com/three.js/assets/examples/13_materials.png)](http://mrdoob.github.com/three.js/examples/canvas_materials.html) +[![materials_depth](http://mrdoob.github.com/three.js/assets/examples/19_materials_depth.png)](http://mrdoob.github.com/three.js/examples/canvas_materials_depth.html) +[![materials_normal](http://mrdoob.github.com/three.js/assets/examples/22_materials_normal.png)](http://mrdoob.github.com/three.js/examples/canvas_materials_normal.html) +[![lights_pointlights](http://mrdoob.github.com/three.js/assets/examples/09_walthead.png)](http://mrdoob.github.com/three.js/examples/canvas_lights_pointlights.html) +[![interactive_cubes](http://mrdoob.github.com/three.js/assets/examples/11_interactive.png)](http://mrdoob.github.com/three.js/examples/canvas_interactive_cubes.html) +[![camera_ortographic](http://mrdoob.github.com/three.js/assets/examples/10_orthographic.png)](http://mrdoob.github.com/three.js/examples/canvas_camera_orthographic.html) +[![geometry_birds](http://mrdoob.github.com/three.js/assets/examples/08_birds.png)](http://mrdoob.github.com/three.js/examples/canvas_geometry_birds.html) +[![geometry_earth](http://mrdoob.github.com/three.js/assets/examples/07_earth.png)](http://mrdoob.github.com/three.js/examples/canvas_geometry_earth.html) +[![geometry_terrain](http://mrdoob.github.com/three.js/assets/examples/06_terrain.png)](http://mrdoob.github.com/three.js/examples/canvas_geometry_terrain.html) +[![materials_video](http://mrdoob.github.com/three.js/assets/examples/24_materials_video.png)](http://mrdoob.github.com/three.js/examples/canvas_materials_video.html) +[![geometry_panorama](http://mrdoob.github.com/three.js/assets/examples/04_vr.png)](http://mrdoob.github.com/three.js/examples/canvas_geometry_panorama.html) +[![geometry_cube](http://mrdoob.github.com/three.js/assets/examples/03_cube.png)](http://mrdoob.github.com/three.js/examples/canvas_geometry_cube.html) +[![particles_sprites](http://mrdoob.github.com/three.js/assets/examples/26_particles_sprites.png)](http://mrdoob.github.com/three.js/examples/canvas_particles_sprites.html) +[![particles_random](http://mrdoob.github.com/three.js/assets/examples/02_random.png)](http://mrdoob.github.com/three.js/examples/canvas_particles_random.html) +[![particles_wave](http://mrdoob.github.com/three.js/assets/examples/01_waves.png)](http://mrdoob.github.com/three.js/examples/canvas_particles_waves.html) +[![particles_floor](http://mrdoob.github.com/three.js/assets/examples/00_floor.png)](http://mrdoob.github.com/three.js/examples/canvas_particles_floor.html) ### Featured projects ### @@ -73,16 +79,16 @@ More? [#three.js on irc.freenode.net](http://webchat.freenode.net/?channels=thre Download the [minified library](http://mrdoob.github.com/three.js/build/Three.js) and include it in your html. - + This code creates a camera, then creates a scene object, adds a bunch of random particles in it, creates a <canvas> renderer and adds its viewport in the document.body element. - - + diff --git a/examples/canvas_materials_normal.html b/examples/canvas_materials_normal.html index 02fc53c0..c4c469eb 100644 --- a/examples/canvas_materials_normal.html +++ b/examples/canvas_materials_normal.html @@ -76,7 +76,6 @@ function animate() { requestAnimationFrame( animate ); - render(); } diff --git a/examples/canvas_performance.html b/examples/canvas_performance.html index 5160a08f..a5219528 100644 --- a/examples/canvas_performance.html +++ b/examples/canvas_performance.html @@ -63,7 +63,7 @@ - + diff --git a/examples/canvas_sandbox.html b/examples/canvas_sandbox.html index f6de171f..8a534184 100644 --- a/examples/canvas_sandbox.html +++ b/examples/canvas_sandbox.html @@ -63,7 +63,7 @@ - + diff --git a/examples/misc_sound.html b/examples/misc_sound.html index 03280d1f..7df1d13a 100644 --- a/examples/misc_sound.html +++ b/examples/misc_sound.html @@ -97,8 +97,8 @@ mesh1.position.set( -250, 30, 0 ); mesh1.scale.set( s, s, s ); - var sound1 = new THREE.Sound3D( [ "sounds/358232_j_s_song.mp3", "sounds/358232_j_s_song.ogg" ] , 275, 20, true ); - //var sound1 = new THREE.Sound3D( "sounds/358232_j_s_song.ogg", 275, 20, true ); + var sound1 = new THREE.Sound( [ "sounds/358232_j_s_song.mp3", "sounds/358232_j_s_song.ogg" ] , 275, 20, true ); + //var sound1 = new THREE.Sound( "sounds/358232_j_s_song.ogg", 275, 20, true ); sound1.play(); var dbg = new THREE.Mesh( cube, material_cube ); @@ -113,8 +113,8 @@ mesh2.position.set( 250, 30, 0 ); mesh2.scale.set( s, s, s ); - var sound2 = new THREE.Sound3D( [ "sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3", "sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg" ], 275, 20, true ); - //var sound2 = new THREE.Sound3D( "sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg", 275, 20, true ); + var sound2 = new THREE.Sound( [ "sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3", "sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg" ], 275, 20, true ); + //var sound2 = new THREE.Sound( "sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg", 275, 20, true ); sound2.play(); var dbg = new THREE.Mesh( cube, material_cube ); diff --git a/examples/misc_uqbiquity_test.html b/examples/misc_uqbiquity_test.html index f9c67dae..e587bf01 100644 --- a/examples/misc_uqbiquity_test.html +++ b/examples/misc_uqbiquity_test.html @@ -64,7 +64,7 @@ - + diff --git a/examples/webgl_geometry_hierarchy.html b/examples/webgl_geometry_hierarchy.html index 9b1c0105..078aa420 100644 --- a/examples/webgl_geometry_hierarchy.html +++ b/examples/webgl_geometry_hierarchy.html @@ -64,7 +64,7 @@ - + diff --git a/examples/webgl_geometry_hierarchy2.html b/examples/webgl_geometry_hierarchy2.html index 2f8ac200..534ca62e 100644 --- a/examples/webgl_geometry_hierarchy2.html +++ b/examples/webgl_geometry_hierarchy2.html @@ -64,7 +64,7 @@ - + diff --git a/examples/webgl_performance.html b/examples/webgl_performance.html index 2745f2c6..d0fdeac3 100644 --- a/examples/webgl_performance.html +++ b/examples/webgl_performance.html @@ -64,7 +64,7 @@ - + diff --git a/examples/webgl_sandbox.html b/examples/webgl_sandbox.html index cce36d0c..9163e696 100644 --- a/examples/webgl_sandbox.html +++ b/examples/webgl_sandbox.html @@ -82,7 +82,7 @@ - + diff --git a/src/objects/Sound3D.js b/src/objects/Sound.js similarity index 74% rename from src/objects/Sound3D.js rename to src/objects/Sound.js index 25b188ca..e20a4a5c 100644 --- a/src/objects/Sound3D.js +++ b/src/objects/Sound.js @@ -2,7 +2,7 @@ * @author mikael emtinger / http://gomo.se/ */ -THREE.Sound3D = function ( sources, radius, volume, loop ) { +THREE.Sound = function ( sources, radius, volume, loop ) { THREE.Object3D.call( this ); @@ -48,7 +48,7 @@ THREE.Sound3D = function ( sources, radius, volume, loop ) { element = document.createElement( "source" ); element.src = this.sources[ s ]; - this.domElement.THREESound3D = this; + this.domElement.THREESound = this; this.domElement.appendChild( element ); this.domElement.addEventListener( "canplay", this.onLoad, true ); this.domElement.load(); @@ -62,16 +62,16 @@ THREE.Sound3D = function ( sources, radius, volume, loop ) { }; -THREE.Sound3D.prototype = new THREE.Object3D(); -THREE.Sound3D.prototype.constructor = THREE.Sound3D; -THREE.Sound3D.prototype.supr = THREE.Object3D.prototype; +THREE.Sound.prototype = new THREE.Object3D(); +THREE.Sound.prototype.constructor = THREE.Sound; +THREE.Sound.prototype.supr = THREE.Object3D.prototype; -THREE.Sound3D.prototype.onLoad = function () { +THREE.Sound.prototype.onLoad = function () { - var sound3D = this.THREESound3D; + var sound = this.THREESound; - if ( sound3D.isLoaded ) { + if ( sound.isLoaded ) { return; @@ -79,25 +79,25 @@ THREE.Sound3D.prototype.onLoad = function () { this.removeEventListener( "canplay", this.onLoad, true ); - sound3D.isLoaded = true; - sound3D.duration = this.duration; + sound.isLoaded = true; + sound.duration = this.duration; - if ( sound3D.isPlaying ) { + if ( sound.isPlaying ) { - sound3D.play(); + sound.play(); } }; -THREE.Sound3D.prototype.addToDOM = function ( parent ) { +THREE.Sound.prototype.addToDOM = function ( parent ) { this.isAddedToDOM = true; parent.appendChild( this.domElement ); }; -THREE.Sound3D.prototype.play = function ( startTime ) { +THREE.Sound.prototype.play = function ( startTime ) { this.isPlaying = true; @@ -115,14 +115,14 @@ THREE.Sound3D.prototype.play = function ( startTime ) { }; -THREE.Sound3D.prototype.pause = function () { +THREE.Sound.prototype.pause = function () { this.isPlaying = false; this.domElement.pause(); }; -THREE.Sound3D.prototype.stop = function (){ +THREE.Sound.prototype.stop = function (){ this.isPlaying = false; this.domElement.pause(); @@ -130,7 +130,7 @@ THREE.Sound3D.prototype.stop = function (){ }; -THREE.Sound3D.prototype.calculateVolumeAndPan = function ( cameraRelativePosition ) { +THREE.Sound.prototype.calculateVolumeAndPan = function ( cameraRelativePosition ) { var distance = cameraRelativePosition.length(); @@ -146,7 +146,7 @@ THREE.Sound3D.prototype.calculateVolumeAndPan = function ( cameraRelativePositio }; -THREE.Sound3D.prototype.update = function ( parentMatrixWorld, forceUpdate, camera ) { +THREE.Sound.prototype.update = function ( parentMatrixWorld, forceUpdate, camera ) { // update local (rotation/scale is not used) diff --git a/src/scenes/Scene.js b/src/scenes/Scene.js index 2a66dbaf..415688d7 100644 --- a/src/scenes/Scene.js +++ b/src/scenes/Scene.js @@ -38,7 +38,7 @@ THREE.Scene.prototype.addChildRecurse = function( child ) { } - } else if ( child instanceof THREE.Sound3D ) { + } else if ( child instanceof THREE.Sound ) { if ( this.sounds.indexOf( child ) === -1 ) { @@ -84,7 +84,7 @@ THREE.Scene.prototype.removeChildRecurse = function( child ) { } - } else if ( child instanceof THREE.Sound3D ) { + } else if ( child instanceof THREE.Sound ) { var i = this.sounds.indexOf( child ); diff --git a/utils/REVISION b/utils/REVISION index f5c89552..bb95160c 100644 --- a/utils/REVISION +++ b/utils/REVISION @@ -1 +1 @@ -32 +33 diff --git a/utils/build.py b/utils/build.py index 5c188b7d..64925270 100644 --- a/utils/build.py +++ b/utils/build.py @@ -59,7 +59,7 @@ COMMON_FILES = [ 'objects/Bone.js', 'objects/SkinnedMesh.js', 'objects/Ribbon.js', -'objects/Sound3D.js', +'objects/Sound.js', 'scenes/Scene.js', 'scenes/Fog.js', 'scenes/FogExp2.js',