Absolute rotation of a mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Will Piovano
Posts: 22
Joined: Sun Oct 15, 2006 10:02 pm

Absolute rotation of a mesh

Post by Will Piovano »

Is it possible to rotate a mesh with absolute values? When I rotate a die around a board, as soon as I perform a sideways rotation, the axis gets shifted and I can no longer roll in the correct direction.

Thanks,

Will
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post by sgt_pinky »

If you are going to do more complex rotations, you need to dig out a maths book and read up on transformation matrices. Or Google it, whatever. When you apply a rotation to an object, what you are actually doing is creating a 4x4 matrix that transforms the coordinates of each vertex (in world space).

Pinky
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
CodeDog
Posts: 106
Joined: Sat Oct 07, 2006 8:00 pm
Location: CA. USA
Contact:

Post by CodeDog »

It can also be done with spherical trigonometry.
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post by sgt_pinky »

It can also be done in an abstract coordinate system of any number of dimensions - but it's unlike that's what he will do, isn't it?! ;)
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
mystic jimbo
Posts: 8
Joined: Fri Oct 13, 2006 3:12 pm

Post by mystic jimbo »

I am struggling with this as well. Say I have a simple cube and I want it roll correctly towards a certain direction, how would I figure out how to rotate it? When I rotate just by a single axis it works OK, but when I add another axis it all goes to nuts.

I have tried to google, but I can't find a good example. :(
mystic jimbo
Posts: 8
Joined: Fri Oct 13, 2006 3:12 pm

Post by mystic jimbo »

This topic got me going:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=12629

I still don't have rolling, but the cube now turns to right direction...
Post Reply