Skip to content

Commit

Permalink
CubeCamera: Fix local basis for Y-cams
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Aug 13, 2018
1 parent 46ede50 commit 48c15a1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/cameras/CubeCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ function CubeCamera( near, far, cubeResolution ) {
this.add( cameraNX );

var cameraPY = new PerspectiveCamera( fov, aspect, near, far );
cameraPY.up.set( 0, 0, 1 );
cameraPY.lookAt( new Vector3( 0, 1, 0 ) );
cameraPY.up.set( 0, 0, - 1 );
cameraPY.forward.set( 0, 1, 0 );
cameraPY.lookAt( new Vector3( 0, 0, 1 ) );
this.add( cameraPY );

var cameraNY = new PerspectiveCamera( fov, aspect, near, far );
cameraNY.up.set( 0, 0, - 1 );
cameraNY.lookAt( new Vector3( 0, - 1, 0 ) );
cameraNY.up.set( 0, 0, 1 );
cameraNY.forward.set( 0, 1, 0 );
cameraNY.lookAt( new Vector3( 0, 0, - 1 ) );
this.add( cameraNY );

var cameraPZ = new PerspectiveCamera( fov, aspect, near, far );
Expand Down

0 comments on commit 48c15a1

Please sign in to comment.