Sign in to follow this  
Caesar

camera and scene hierarchy

Recommended Posts

hi I've been trying to write a simple 3d engine. I have a scene manager that stores a tree of scene nodes. Each node has two matrices, one that stores it's transformation relative to it's parent and one that stores the absolute transformation. When I want the scene manager to draw the whole scene, it traverses the whole tree, multiplying the relative matrices together and storing the absolute matrices for each node (note: I guess there is a better way, but I figured I need to set up all lights before the geometry gets drawn and since the lights are also nodes, I need to get their transformations before traversing the tree a second time, drawing geometry). Now that I've gotten to the point where I want to implement a camera class (also a node), I'm quite not sure what to do. I have the absolute transformation of the camera (world space), but I guess that's not what I need. I guess what I need would be an inverse of that matrix, but I'm not sure and I don't want to implement matrix inversion algorithm unless I have to :) not to mention it maybe isn't the best method. Do I need that inverse, any ideas? PS: another way would be to not store relative transformation matrices and store the matrix in some kind of transformation batch that I could easily invert (I could traverse from the camera to the root, building the inverse matrix). That's work I'd rather spare. Whether this would be correct or not, I'm still curious about my original question. I've been looking at the Irrlicht engine as a reference throughout my efforts, but wasn't able to pick up where it does the transformations. thanks for any clarification :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this