0

I can only access rotation values for my camera relative to its last value or as 0 to -90, -90 to 0, 0 to 90 and 90 to 0.

I would like a straight up 0 to 360 or even a 0 to 180 and 0 to -180 so I can calculate the absolute rotation of my camera about the y axis at any time. No code as this is conceptual. Any assistance is gracefully received, likely a simple answer and I'm missing something and must say mrdoob, blooming legend thanks for all the hard work.

  • camera.rotateX(Math.PI*2) // 360 degree rotation from actual state – Martin Apr 02 '15 at 07:37
  • camera.rotation.x = Math.PI // rotation 180 to absolute value relative to parent camera.rotation.y = Math.PI*-1 // rotation -180 to absolute value relative to parent do the job – Martin Apr 02 '15 at 07:39
  • he camera is being controlled by deviceorientationcontroller using quaternions. I need to access the world rotation about a given axis. camera.rotation.x simply returns cam = -0.03040609004346102 whic may be positive or negative depending on the caermas rotation about other axis. The net result is it doesn't return a consistent 0-360 value. or 0 to 180, -180 to 0. Thanks for your prompt reply though – piggy_smalls Apr 02 '15 at 10:03

1 Answers1

0

This post answered my question perfectly

How to derive "standard" rotations from three.js when using quaternions?

I may have missed some tools built into three that do this in a more efficient manner but this was bang on and gave me the absolute world camera orientation I was after.

@Martin thanks for chipping in bud

Community
  • 1
  • 1