Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three.js: way to change the up axis?

I see that the ColladaLoader has a way to set the upAxis to 'Z' ... is there a way to do that in Three.js proper so that the camera's up axis is Z?

Thanks!

like image 791
Eric Avatar asked Mar 18 '13 15:03

Eric


1 Answers

You can set the camera up vector like so:

camera.up.set( 0, 0, 1 );

Then when you call camera.lookAt( point ), it will work as you expect.

Edit: Updated to three.js r.68

like image 165
WestLangley Avatar answered Dec 31 '22 03:12

WestLangley