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
HELP: Cameras and Billboards
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...
You can easily extract the following information from the view matrix...
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
Code: Select all
[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]
[12 13 14 15]
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])
Travis