views:

27

answers:

1

I would like to build turret, that can rotate in all axis. So the base could rotate in Y axis and the barrel in X/Z axis depending on actual Y value, just like normal turret, that have half ball base and the barrel is cylinder. What is best way to do this in simple DirectX? (I'm not using any prepared packs, because I want to elarn it not just use it).

I thought best way would be to make base and barrel as separate models, and then rotate them.

I think there is better solutionm because in big games, like space shooters, where you can see in one battle hundreads of turrets and there is quite big ammout of effects etc. so I think this could be little slow down?

A: 

I'm not a model builder.... take what I say with a grain of salt...

You can still make the whole turrent one model, but the barrel could be attached to its own bone inside the model. This is just a simple way of providing a model with multiple rotations (i.e. rotate the whole thing around Y and then rotate the barrel up/down).

As far as big games go, tricks can often be done to reduce the number of rotations. For example, any turrent up close could be rendered to full detail while those far away could avoid rendering the turrent all since it might only render to a single pixel on the screen.

Torlack