HELP: Cameras and Billboards

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
Anton1
Posts: 14
Joined: Fri Mar 09, 2007 7:47 am

HELP: Cameras and Billboards

Post by Anton1 »

I need help. I'm doing a basic graphic engine for high school project. I've been using Irrlicht as a reference. But I'm stuck with the camera and billboard thing. :?

I want to do a billboard node, but the irrlicht camera uses the lookat method. i don't to think to long about it, so i ask you how can i get the upvector, eye and center from just a matrix xyz rotation. I'd prefer to know it this way.
Thanks
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

If you have the view matrix, you can get all the information you need pretty easily. Assuming you are using a row major matrix, it would look like this...

Code: Select all

[ 0  1  2  3]
[ 4  5  6  7]
[ 8  9 10 11]
[12 13 14 15]
You can easily extract the following information from the view matrix...

Code: Select all

 x axis       = (M[0], M[4], M[8])
 y axis       = (M[1], M[5], M[9])
 z axis       = (M[2], M[6], M[10])
 eye position = (M[12], M[13], M[14])
If you use a right hand coordinate system with +Z into the screen and +Y up, then the Z axis is the look direction vector and Y is the up vector. +X would point to the left.

Travis
Post Reply