Tanks, Turrets & Barrels...

Started by
3 comments, last by Paul Richardson 18 years, 1 month ago
What is a nice way of storing and keeping track of models representing tanks (with turrets and barrels)? Should I store them as seperate models? What is a good way of rotating the tank, the turret and the barrel while keeping them in their correct positions?
Advertisement
woah woah woah dude. Slow down. You'll get faster replies if u just ask one or two questions at a time.
Visit me at my new site www.freewebs.com/sunmanexe1/
Quote:Original post by Smit
What is a good way of rotating the tank, the turret and the barrel while keeping them in their correct positions?

you mean for rendering? 2d or 3d?
Opps, sorry I meant 3D.
I would try and have a high level organsiation of a 3d object which can consist of multiple parts, each of which can have sub-meshes which can have their own martices applied to them (as well as having hierachical connections).

'Tank'
|
|-- 'Body'
|
| 'Turret'

So you could do something like this (not exactly like this though as its woefully bad and ineffiecnt)

tank->SetMatrix("TURRET",newmatrix);
tank->Draw();

I wouldn't use a string, a u32 id would be better, but basically have a way to id sub-meshes and move those,

Anyway...random rambles over now....

HTHs

Paul

This topic is closed to new replies.

Advertisement