Skip to content

Commit

Permalink
Merge pull request #1 from mrdoob/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
AtiX committed Mar 9, 2015
2 parents c223a4c + 5f6960d commit 1870098
Show file tree
Hide file tree
Showing 80 changed files with 5,362 additions and 929 deletions.
157 changes: 110 additions & 47 deletions build/three.js

Large diffs are not rendered by default.

498 changes: 250 additions & 248 deletions build/three.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/extras/helpers/CameraHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3>[property:Camera camera]</h3>
<h2>Methods</h2>


<h3>[method:todo update]()</h3>
<h3>[method:null update]()</h3>
<div>
Updates the helper based on the projectionMatrix of the camera.
</div>
Expand Down
10 changes: 5 additions & 5 deletions docs/api/extras/helpers/DirectionalLightHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>[name]</h1>
<h2>Constructor</h2>


<h3>[name]([DirectionalLight:todo light], [page:Number size])</h3>
<h3>[name]([page:DirectionalLight light], [page:Number size])</h3>
<div>
light -- [page:DirectionalLight] -- Light to visualize <br />
size -- dimensions of the plane
Expand All @@ -32,18 +32,18 @@ <h2>Properties</h2>

<h3>[property:Line lightPlane]</h3>
<div>
todo
Contains the line mesh showing the location of the directional light.
</div>

<h3>[property:DirectionalLight light]</h3>
<div>
todo
Contains the directionalLight.
</div>

<h3>[property:Line targetLine]</h3>
<div>
todo
</div>
Contains the line mesh that shows the direction of the light.
</div>

<h2>Methods</h2>

Expand Down
20 changes: 9 additions & 11 deletions docs/api/extras/helpers/HemisphereLightHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,39 @@

<h1>[name]</h1>

<div class="desc">todo</div>
<div class="desc">Creates a visual aid for a [page:HemisphereLight HemisphereLight].</div>


<h2>Constructor</h2>

<h3>[name]([page:todo light], [page:todo sphereSize], [page:todo arrowLength], [page:todo domeSize])</h3>
<h3>[name]([page:HemisphereLight light], [page:Number sphereSize])</h3>
<div>
light -- todo <br />
sphereSize -- todo <br />
arrowLength -- todo <br />
domeSize -- todo
light -- The HemisphereLight. <br />
sphereSize -- The size of the sphere that shows the location.
</div>
<div>
todo
Creates an helper for the hemispherelight.
</div>


<h2>Properties</h2>

<h3>[property:Mesh lightSphere]</h3>
<div>
todo
The sphere mesh that shows the location of the hemispherelight.
</div>

<h3>[property:HemisphereLight light]</h3>
<div>
todo
Contains the HemisphereLight.
</div>


<h2>Methods</h2>

<h3>[method:todo update]()</h3>
<h3>[method:null update]()</h3>
<div>
todo
Updates the helper to match the position and direction of the [page:.light].
</div>


Expand Down
19 changes: 6 additions & 13 deletions docs/api/materials/MeshNormalMaterial.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1>[name]</h1>

<div class="desc">A material that maps the normal vectors to RGB colors.</div>

<iframe src='../../scenes/material-browser.html#MeshNormalMaterial'></iframe>


Expand All @@ -21,10 +21,9 @@ <h2>Constructor</h2>

<h3>[name]([page:Object parameters])</h3>
<div>
parameters is an object with one or more properties defining the material's appearance.
parameters is an object with one or more properties defining the material's appearance.
</div>
<div>
shading -- How the triangles of a curved surface are rendered. Default is [page:Materials THREE.FlatShading].<br/>
wireframe -- Render geometry as wireframe. Default is false (i.e. render as smooth shaded).<br/>
wireframeLinewidth -- Controls wireframe thickness. Default is 1.<br/>
morphTargets -- Define whether the material uses morphTargets. Default is false.<br/>
Expand All @@ -34,25 +33,19 @@ <h3>[name]([page:Object parameters])</h3>
<h2>Properties</h2>


<h3>[property:number shading]</h3>
<h3>[property:boolean wireframe]</h3>
<div>
How the triangles of a curved surface are rendered: as a smooth surface, as flat separate facets, or no shading at all.<br/><br/>
Options are [page:Materials THREE.SmoothShading], [page:Materials THREE.FlatShading](default)
Render geometry as wireframe. Default is false (i.e. render as smooth shaded).
</div>

<h3>[property:boolean wireframe]</h3>
<div>
Render geometry as wireframe. Default is false (i.e. render as smooth shaded).
</div>

<h3>[property:number wireframeLinewidth]</h3>
<div>
Controls wireframe thickness. Default is 1.<br/><br/>
Due to limitations in the ANGLE layer, on Windows platforms linewidth will always be 1 regardless of the set value.
</div>
</div>

<h3>[property:boolean morphTargets]</h3>
<div>Define whether the material uses morphTargets. Default is false.</div>
<div>Define whether the material uses morphTargets. Default is false.</div>

<h2>Methods</h2>

Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ <h1><a href="http://threejs.org">three.js</a> / docs</h1>
if ( window.location.hash.length > 0 ) goToHash();

console.log([
'_______ __',
'/ _______\\/ __\\__ ____ _____ _____',
'\\/__ __/ / /___\\/ ____\\/ _____\\/ _____\\',
' / / / / / _ / / __/ / __ / / __ /_ __ _____',
' __ __',
' __/ __\\ / __\\__ ____ _____ _____',
'/ __/ /\\/ / /___\\/ ____\\/ _____\\/ _____\\',
'\\/_ __/ / _ / / __/ / __ / / __ /_ __ _____',
'/ / / / / / / / / / / / ___/ / ___/\\ _\\/ __\\/ _____\\',
'\\/__/ \\/__/\\/__/\\/__/ \\/_____/\\/_____/\\/__/ / / / ___/',
' / __/ / \\__ \\',
Expand Down
16 changes: 16 additions & 0 deletions editor/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ textarea, input { outline: none; } /* osx */
display: none;
}

/* CodeMirror */

.CodeMirror {

position: absolute !important;
Expand All @@ -76,6 +78,20 @@ textarea, input { outline: none; } /* osx */

}

.CodeMirror .errorLine {

background: rgba(255,0,0,0.25);

}

.CodeMirror .esprima-error {

color: #f00;
text-align: right;
padding: 0px 20px;

}

/* scene types */

.type {
Expand Down
2 changes: 1 addition & 1 deletion editor/examples/arkanoid.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"31517222-A9A7-4EAF-B5F6-60751C0BABA3": [
{
"name": "Game Logic",
"source": "var ball = this.getObjectByName( 'Ball' );\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = - 0.5;\ndirection.normalize();\n\nvar speed = new THREE.Vector3();\n\n//\n\nvar group = new THREE.Group();\nthis.add( group );\n\nvar paddle = this.getObjectByName( 'Paddle' );\ngroup.add( paddle );\n\nvar brick = this.getObjectByName( 'Brick' );\n\nfor ( var j = 0; j < 8; j ++ ) {\n\n\tvar material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );\n\n\tfor ( var i = 0; i < 12; i ++ ) {\n\t\t\n\t\tvar object = brick.clone();\n\t\tobject.material = material;\n\t\tobject.position.x = i * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\n\t\tgroup.add( object );\n\t\t\n\t}\n\t\n}\n\nbrick.visible = false;\n\n//\n\nvar raycaster = new THREE.Raycaster();\n\nfunction update( event ) {\n\t\n\tif ( ball.position.x < - 150 || ball.position.x > 150 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;\n\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );\n\t\n\traycaster.set( ball.position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( group.children );\n\t\n\tif ( intersections.length > 0 ) {\n\t\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 5 ) {\n\t\t\t\n\t\t\tif ( intersection.object !== paddle ) {\n\n\t\t\t\tgroup.remove( intersection.object );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tdirection.reflect( intersection.face.normal );\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n}"
"source": "var ball = this.getObjectByName( 'Ball' );\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = - 0.5;\ndirection.normalize();\n\nvar speed = new THREE.Vector3();\n\n//\n\nvar group = new THREE.Group();\nthis.add( group );\n\nvar paddle = this.getObjectByName( 'Paddle' );\ngroup.add( paddle );\n\nvar brick = this.getObjectByName( 'Brick' );\n\nfor ( var j = 0; j < 8; j ++ ) {\n\n\tvar material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );\n\n\tfor ( var i = 0; i < 12; i ++ ) {\n\t\t\n\t\tvar object = brick.clone();\n\t\tobject.material = material;\n\t\tobject.position.x = i * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\n\t\tgroup.add( object );\n\t\t\n\t}\n\t\n}\n\nbrick.visible = false;\n\n//\n\nvar raycaster = new THREE.Raycaster();\n\nfunction update( event ) {\n\t\n\tif ( ball.position.x < - 150 || ball.position.x > 150 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;\n\n\tball.position.x = Math.max( - 150, Math.min( 150, ball.position.x ) );\n\tball.position.z = Math.max( - 200, Math.min( 200, ball.position.z ) );\n\t\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );\n\t\n\traycaster.set( ball.position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( group.children );\n\t\n\tif ( intersections.length > 0 ) {\n\t\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 5 ) {\n\t\t\t\n\t\t\tif ( intersection.object !== paddle ) {\n\n\t\t\t\tgroup.remove( intersection.object );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tdirection.reflect( intersection.face.normal );\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n}"
}]
}
}
112 changes: 63 additions & 49 deletions editor/examples/camera.app.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"generator": "ObjectExporter"
},
"object": {
"uuid": "F0D8434F-4603-415B-8024-792FE97B9600",
"uuid": "C7FB195B-270E-47B4-95C9-1754652A9D11",
"type": "PerspectiveCamera",
"name": "Camera",
"fov": 50,
"aspect": 1.2252042007001167,
"near": 0.1,
"far": 100000,
"matrix": [0.9700406789779663,-5.500052080442686e-10,-0.24294254183769226,0,-0.04822639003396034,0.9800989627838135,-0.19256223738193512,0,0.23810774087905884,0.19850945472717285,0.950735867023468,0,159.0158233642578,132.5708465576172,634.9312744140625,1]
"matrix": [0.9700406789779663,-2.851828329042405e-9,-0.24294254183769226,0,-0.04822639003396034,0.9800989627838135,-0.1925622522830963,0,0.23810774087905884,0.19850945472717285,0.950735867023468,0,154.7735595703125,129.03408813476562,617.992431640625,1]
}
},
"scene": {
Expand All @@ -23,6 +23,14 @@
"generator": "ObjectExporter"
},
"geometries": [
{
"uuid": "51BB3E54-D2DF-4576-9953-FB8E940588B5",
"type": "PlaneGeometry",
"width": 1000,
"height": 1000,
"widthSegments": 1,
"heightSegments": 1
},
{
"uuid": "D8E200D3-27BC-49F8-A5C5-7384206E70FE",
"type": "BoxGeometry",
Expand All @@ -43,14 +51,6 @@
"heightSegments": 1,
"openEnded": false
},
{
"uuid": "51BB3E54-D2DF-4576-9953-FB8E940588B5",
"type": "PlaneGeometry",
"width": 1000,
"height": 1000,
"widthSegments": 1,
"heightSegments": 1
},
{
"uuid": "4DECFAB5-6FD1-4D84-9A29-565807B074EA",
"type": "IcosahedronGeometry",
Expand All @@ -59,25 +59,25 @@
}],
"materials": [
{
"uuid": "B5943856-E404-45D9-A427-4774202C2CD0",
"uuid": "4AE8130E-B6A8-47BC-ACCF-060973C74044",
"type": "MeshPhongMaterial",
"color": 37119,
"color": 16777215,
"emissive": 0,
"specular": 1118481,
"shininess": 30
},
{
"uuid": "3F872310-2067-4BE4-9250-5B3F4E43797E",
"uuid": "B5943856-E404-45D9-A427-4774202C2CD0",
"type": "MeshPhongMaterial",
"color": 15859456,
"color": 37119,
"emissive": 0,
"specular": 1118481,
"shininess": 30
},
{
"uuid": "4AE8130E-B6A8-47BC-ACCF-060973C74044",
"uuid": "3F872310-2067-4BE4-9250-5B3F4E43797E",
"type": "MeshPhongMaterial",
"color": 16777215,
"color": 15859456,
"emissive": 0,
"specular": 1118481,
"shininess": 30
Expand All @@ -97,47 +97,53 @@
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
"children": [
{
"uuid": "60B69C58-4201-43FD-815E-AD2EDFBBD0CE",
"type": "PerspectiveCamera",
"name": "PerspectiveCamera 1",
"fov": 50,
"aspect": 1,
"near": 100,
"far": 10000,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,100,400,1]
"uuid": "B7CBBC6F-EC26-49B5-8D0D-67D9C535924B",
"type": "Group",
"name": "Dummy",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,100,400,1],
"children": [
{
"uuid": "60B69C58-4201-43FD-815E-AD2EDFBBD0CE",
"type": "PerspectiveCamera",
"name": "PerspectiveCamera",
"fov": 50,
"aspect": 1,
"near": 100,
"far": 10000,
"matrix": [-1,0,-1.2246468525851679e-16,0,0,1,0,0,1.2246468525851679e-16,0,-1,0,0,0,0,1]
}]
},
{
"uuid": "A460C230-DC88-4A8F-A3FB-AA0FE735F3ED",
"type": "Mesh",
"name": "Plane",
"geometry": "51BB3E54-D2DF-4576-9953-FB8E940588B5",
"material": "4AE8130E-B6A8-47BC-ACCF-060973C74044",
"matrix": [1,0,0,0,0,0.040785226970911026,-0.9991679191589355,0,0,0.9991679191589355,0.040785226970911026,0,0,-50,0,1]
},
{
"uuid": "26DAAD69-725D-43B7-AF9D-990A99DEF8C5",
"type": "Mesh",
"name": "Box 1",
"name": "Box",
"geometry": "D8E200D3-27BC-49F8-A5C5-7384206E70FE",
"material": "B5943856-E404-45D9-A427-4774202C2CD0",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
},
{
"uuid": "AAAFF2D6-4725-4AFC-A9FE-26419B11011F",
"type": "Mesh",
"name": "Cylinder 3",
"name": "Cylinder",
"geometry": "25BA32DB-8B02-4ABA-A77C-69868C464A1A",
"material": "3F872310-2067-4BE4-9250-5B3F4E43797E",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-130,-15,0,1]
},
{
"uuid": "A460C230-DC88-4A8F-A3FB-AA0FE735F3ED",
"uuid": "B855E267-A266-4098-ACD6-6A1FDE7B88BA",
"type": "Mesh",
"name": "Plane 4",
"geometry": "51BB3E54-D2DF-4576-9953-FB8E940588B5",
"material": "4AE8130E-B6A8-47BC-ACCF-060973C74044",
"matrix": [1,0,0,0,0,0.040785059332847595,-0.9991679191589355,0,0,0.9991679191589355,0.040785059332847595,0,0,-50,0,1]
},
{
"uuid": "3412781E-27CC-43C3-A5DB-54C0C8E42ED6",
"type": "PointLight",
"name": "PointLight 2",
"color": 12773063,
"intensity": 1,
"distance": 0,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,88.12999725341797,8.3100004196167,125.44999694824219,1]
"name": "Icosahedron",
"geometry": "4DECFAB5-6FD1-4D84-9A29-565807B074EA",
"material": "E1826901-7922-4584-A25D-6D487E2C9BBD",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,130,-10,0,1]
},
{
"uuid": "E2939A7B-5E40-438A-8C1B-32126FBC6892",
Expand All @@ -146,23 +152,31 @@
"color": 9474221,
"intensity": 0.75,
"distance": 0,
"decay": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-93.86000061035156,127.12999725341797,-114.30000305175781,1]
},
{
"uuid": "B855E267-A266-4098-ACD6-6A1FDE7B88BA",
"type": "Mesh",
"name": "Icosahedron 1",
"geometry": "4DECFAB5-6FD1-4D84-9A29-565807B074EA",
"material": "E1826901-7922-4584-A25D-6D487E2C9BBD",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,130,-10,0,1]
"uuid": "3412781E-27CC-43C3-A5DB-54C0C8E42ED6",
"type": "PointLight",
"name": "PointLight 2",
"color": 12773063,
"intensity": 1,
"distance": 0,
"decay": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,88.12999725341797,8.3100004196167,125.44999694824219,1]
}]
}
},
"scripts": {
"60B69C58-4201-43FD-815E-AD2EDFBBD0CE": [
{
"name": "Camera Orbit",
"source": "player.setCamera( this );\n\nfunction update( event ) {\n\n\tvar time = event.time * 0.001;\n\n\tthis.position.x = Math.sin( time ) * 400;\n\tthis.position.z = Math.cos( time ) * 400;\n\tthis.lookAt( scene.position );\n\n}"
"name": "Player Camera",
"source": "player.setCamera( this );"
}],
"B7CBBC6F-EC26-49B5-8D0D-67D9C535924B": [
{
"name": "Orbit",
"source": "function update( event ) {\n\n\tvar time = event.time * 0.001;\n\n\tthis.position.x = Math.sin( time ) * 400;\n\tthis.position.z = Math.cos( time ) * 400;\n\tthis.lookAt( scene.position );\n\n}"
}]
}
}
}
Loading

0 comments on commit 1870098

Please sign in to comment.