larryq
larryq

Reputation: 16299

Rotating a camera about its own axes in three.js

Are there examples I can borrow from regarding rotating a camera around its own X, Y and Z axes? I learned yesterday that I can use the translate(X|Y|Z) methods to move a camera along its own axes. Are there equivalents for rotation as well?

Upvotes: 2

Views: 695

Answers (1)

WestLangley
WestLangley

Reputation: 104763

In the development version ( three.js r58dev ), a new function has been added for rotating an object on it's own axis:

Object3D.rotateOnAxis( axis, angle );

axis must be a unit-length Vector3, and angle is in radians.

three.js r58dev

Upvotes: 3

Related Questions