Start a new topic

mathematics for 3d object rotation

mathematics for 3d object rotation


Hi 3d programming experts!

I need to rotate a 3d object around its own axes after it has snapped to a screen container, but I don't find the mathematics to do it with tilt, heading and roll. Please help!

Basically what I want is: Imagine you're sitting infront of a turntable with an object rotating on it. To see this effect, all three rotation parameters tilt, heading and roll must be animated accordingly, but I can't figure out the maths to calculate these values. Something like this...

function turntableRotation (degreesToRotate){
  var tilt = model.rotate.tilt;
  var heading = model.rotate.heading;
  var roll = model.rotate.roll;

  **************************************************************************************
  * "Magic formula" that takes degreesToRotate, tilt, heading and roll as input *
  * and gives newtilt, newheading and newroll as output                               *
  **************************************************************************************
  model.rotate.tilt = newtilt;
  model.rotate.heading = newheading;
  model.rotate.roll = newroll;

}

Can anyone help?

Thanks
Andras
 

 

Hi,

Here are some details from our tech team:

Trackball navigation is not supported by the WikitudeSDK.
However you can do the magic calculation on your own from. You can get some hint, e.g., here:
http://planning.cs.uiuc.edu/node102.html
http://planning.cs.uiuc.edu/node103.html

I hope this helps. Greetings

Nicola
Login or Signup to post a comment