Cameras & Renderables

Started by
0 comments, last by _DarkWIng_ 19 years, 8 months ago
I feel like I've coded myself into a corner once again. See, I've been working on a 3D engine that's based loosely on how OGRE does things. I now have a render function which grabs renderables from a queue and displays them. Each renderable stores a single world transform matrix which is loaded before rendering. I am now trying to create a Camera class and this forms a big problem because no matter where I locate my camera too, the renderable world matrix transforms it to the same location every time with respect to the Camera. At least, that is what I think the problem is. How would one go about solving this problem?
Advertisement
You need to multiply objects world space matrix with inverse of cameras matrix.

Something like:
glLoadMatrix( camera.matrix.Inverse() );for each Renderable r {    glPushMatrix();    glMultMatrix( r.matrix );    render r    glPopMatrix();}
You should never let your fears become the boundaries of your dreams.

This topic is closed to new replies.

Advertisement