3D data structures

Started by
3 comments, last by Binomine 18 years, 9 months ago
Hay, Is there any tut/book that describe how to organize data structures in one 3D engine? Thanks, Zaharije Pasalic
Advertisement
What do you mean by 'organize data structures'? There are books available on 3D engine design such as '3D Game Engine Architecture' by David Eberly.
Organize data structures? The point in data structures is to organize data. [wink]
OK. Yes. It is stupid question:

For now we used B3D to load our models, so structure of one model is hierarchy starting from RootNode and every node has its childs and siblings nodes. Most of nodes has mash (some are helpers without mesh).

What is particulary problem is where to plase Collision, AI and Phisycs parts in out data hierarchy. We decided to place Collision in every node of every mesh. Is it good/bad? (just to say that is flight simulator). Becuase we are begginers in game programming it is still confusing to put all together.

We write class Object that is base class for all objects that are on scene. Every object, eg ship has it's class Ship inherited from Object. What we wonna do with this is to make main loop that simply goes trough every Object and call: move-collide-render. It is good practice to keep using OOP? If not why?

This is what I mean with "data structures".

Thansk,
Zaharije Pasalic
Quote:Original post by PasalicZaharije
For now we used B3D to load our models, so structure of one model is hierarchy starting from RootNode and every node has its childs and siblings nodes. Most of nodes has mash (some are helpers without mesh).
I'll assume each root has a mesh and you're doing a mesh by mesh rather than a full bounding box / sphere, etc. Doing that is great for collision between characters or other limbed objects. For a plane, since it's pretty square anyways, I might suggest a huge box and placing your collision only in the root node.

Quote:We write class Object that is base class for all objects that are on scene. Every object, eg ship has it's class Ship inherited from Object. What we wonna do with this is to make main loop that simply goes trough every Object and call: move-collide-render. It is good practice to keep using OOP? If not why?
This is a great practice, inhereting everything from an object class. Even the pros do it.

Personally, I suggest placing your AI & Physics in the root node. Your meshes don't need to think or react independently, so you only need a single instance. Placing that in your root would be the best place. IMHO, collision should be in the root as well, but that's how I'd do it, it's not necessarly the right way.

This topic is closed to new replies.

Advertisement