Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #14775 from MiiBond/khr_lights_punctual_direction_…
…update

Reverse direction of glTF lights to comply with spec changes
  • Loading branch information
mrdoob committed Sep 25, 2018
2 parents 1f83a59 + bde0cbd commit 869e8b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/js/loaders/GLTFLoader.js
Expand Up @@ -311,7 +311,7 @@ THREE.GLTFLoader = ( function () {

case 'directional':
lightNode = new THREE.DirectionalLight( color );
lightNode.target.position.set( 0, 0, 1 );
lightNode.target.position.set( 0, 0, -1 );
lightNode.add( lightNode.target );
break;

Expand All @@ -329,7 +329,7 @@ THREE.GLTFLoader = ( function () {
lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0;
lightNode.angle = lightDef.spot.outerConeAngle;
lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle;
lightNode.target.position.set( 0, 0, 1 );
lightNode.target.position.set( 0, 0, -1 );
lightNode.add( lightNode.target );
break;

Expand Down
8 changes: 4 additions & 4 deletions examples/models/gltf/monster/glTF-lights/Monster.gltf
Expand Up @@ -746,12 +746,12 @@
0.0,
0.0,
0.0,
1.0,
-1.0,
0.0,
0.0,
0.0,
0.0,
1.0,
-1.0,
0.0,
0.0,
0.0,
Expand All @@ -765,7 +765,7 @@
"light": 2
}
},
"matrix": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 50, -100, 1],
"matrix": [1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 50, -100, 1],
"name": "spot light"
}
],
Expand Down Expand Up @@ -4539,7 +4539,7 @@
},
{
"type": "directional",
"intensity": 0.5,
"intensity": 1.5,
"color": [
0.0,
1.0,
Expand Down

0 comments on commit 869e8b3

Please sign in to comment.