Omaha

07-26-2005, 08:21 PM

I frequently come up with the most elegant solutions to problems that I have, but the cost is always heavy in transformations.

Case in point: I have a rocket that was fired from point A, follows a path of vertices (we'll say it's a homing missle and the target keeps veering to the side)and it leaves behind it a contrail of gray smoke. This is easily accomplished by setting up effectively a billboard at each vertex (I actually do some more math to make it look a little better, and connect the dots. The problem is, for best results, I have to do the billboard transform at each vertex. This is no problem if there's like one rocket going off at a time but this is a space shootemup so we're going to be talking about 40-50 rockets being fired in rapdi succession so the player can _try_ to dodge them all :p

ALl in all I find my engines are transformation heavy, and sometimes I wonder if too heavy. Rendering a a complicated object made of several submodels for instance, requires the following transformations:

pushMatrix()

1.) Translate to object position...

2.) rotate to object orientation...

3.) draw object

4.) push matrix

5.) repeat 5 for all subobjects

The hierarchies can be arbitrarily deep. For example it would be a piecce of cake to set up a class NES-style snake monster by chaining a bunch of spheres together, but then there are lots of matrix multipiles going on.

How many transformations are too many transformations?

Case in point: I have a rocket that was fired from point A, follows a path of vertices (we'll say it's a homing missle and the target keeps veering to the side)and it leaves behind it a contrail of gray smoke. This is easily accomplished by setting up effectively a billboard at each vertex (I actually do some more math to make it look a little better, and connect the dots. The problem is, for best results, I have to do the billboard transform at each vertex. This is no problem if there's like one rocket going off at a time but this is a space shootemup so we're going to be talking about 40-50 rockets being fired in rapdi succession so the player can _try_ to dodge them all :p

ALl in all I find my engines are transformation heavy, and sometimes I wonder if too heavy. Rendering a a complicated object made of several submodels for instance, requires the following transformations:

pushMatrix()

1.) Translate to object position...

2.) rotate to object orientation...

3.) draw object

4.) push matrix

5.) repeat 5 for all subobjects

The hierarchies can be arbitrarily deep. For example it would be a piecce of cake to set up a class NES-style snake monster by chaining a bunch of spheres together, but then there are lots of matrix multipiles going on.

How many transformations are too many transformations?