Game Development Community

Converting Object Space to Word Space?

by Eric Hartman · in Torque Game Engine · 07/29/2005 (11:22 pm) · 3 replies

Not sure if this is the best place to post this but here goes:

For my game, Blockland, I need to render tons of quad-based bricks really fast. The way I'm doing this right now is each brick adds its quads to a vertex array in world-space and then at the end of the frame, the entire vertex array is rendered. This works well and goes pretty fast.

The trouble is that I can't really rotate the bricks at odd angles because the points have to go into the vertex array as world-space coordinates. Is there any way to efficiently transform the points and normals of each quad into worldspace so that I put them all into a single vertex array?

Now, it's not absolutely necessary that I get this working because for all practical purposes, the bricks never rotate off 90 degree increments. But it would be nice to have them rotate for some special effects purposes.

#1
07/29/2005 (11:29 pm)
Take the object't transform matrix in worldspace, multiply it by the coordinates transform matrix in object space. Voila, coordinates transform in worldspace. Very useful trick. Not entirely sure that's what you wanted. It's how torque works out node transforms in world space for functions like getEyeTransform().
#2
08/01/2005 (1:12 am)
Thanks, I got it working

www.blockland.us/blockland/screenshot_00276.jpg
#3
08/01/2005 (10:18 am)
Cool beans!