get rotation of a triangle

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
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

get rotation of a triangle

Post by katze555 »

i have a cubescenenode and i want to rotate it like a triangle, so the surface of the node is parallel to the triangle.
So how can i get the rotation of the triangle?
________
Starcraft 2 replays
Last edited by katze555 on Thu Feb 24, 2011 7:43 am, edited 1 time in total.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Get the orthornormal basis for your triangle (the up, left and forward vectors) in the coordinate system of the cube's parent, and then rotate the cube into alignment.

You could probably do this by using getting the world rotations of the triangle and cube as quaternions, and then finding the difference, applying this to the cube.

Travis
Post Reply