Tanks, Turrets & Barrels...
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?
woah woah woah dude. Slow down. You'll get faster replies if u just ask one or two questions at a time.
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?
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
'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
Popular Topics
Advertisement