Imagination PowerVR SDK Blog

How to get Euler angles?


#1

I want to implement an interface that permits the rotation of an object with constrained angles.



For example I want to turn a 3D object around its x-axis, but I want to constrain the possible movements from 0 - 90 degrees.

Think of the object as a building, the user should not be able to ‘dive’ beneath the surface and see the the building from beneath.



I would implement like this:

  1. transform my node’s rotation quaternion (or -matrix) to Euler-angles
  2. check angles agains my constraints, adapt them if necessary
  3. transform the Euler angles to a matrix which I hand over to OpenGL



    The task seems pretty common, so I guess there must be tools to perform that kind of calculation in PVRTools.

    I was surprised, that I could not find any function of help in PVRTModelPOD, PVRTQuaternion or PVRTMatrix.



    I could of course add my own QuaternionToEuler function, but somehow that just doesn’t seem to fit with the design of the SDK – which generally encapsulates this kind of functionality.

    Also, the tools do not seem to provide an interface to the underlying quaternion.

    I can only access rotations through functions like ‘void CPVRTModelPOD::GetRotationMatrix’, it seems.



    Am I missing something in the tools?

    Or am I just all wrong with my implementation pattern, overseeing some other, probably much simpler, solution?

#2

Hi Dan,



You definitely have a full and working install of the tools, the functionality isn’t there. We’re currently looking at revamping our tools so any feedback is great. I’ll note this down and bring it up at our next discussion on the tools.



Bob.


#3

Thanks Bob,

In my opinion this would be a very interesting feature that would fit well in your tool set.

Do you already have a release date for the next version on the roadmap?

I am looking very much forward to it.



I guess this would be my wish list =)


#4

Hi Dan,



Our 3.1 SDK release is due for the start of March. We’ve already locked down on features in this release though, so the changes are unlikely to be added. Our 3.2 SDK should be released ~August.



Sorry that the features won’t be added sooner. As Bob has mentioned, your feedback has been noted for addition in our PVRTools overhaul.



Regards,

Joe