efficient data structures

Started by
1 comment, last by Dragoncar 18 years, 10 months ago
Hey guys, If anyone could guide me in the right direction to what would be an efficient data structure to model these types of things that would be great. 1) a complex polygonal model (like a ship or building) 2) organic shapes (like a head or a plasticine figure) 3) primitive data objects (like spheres, cones, etc.) thanks a billion!
Advertisement
Quote:Original post by ronkelly
If anyone could guide me in the right direction to what would be an efficient data structure to model these types of things that would be great.

It's often possible to have multiple valid algorithms/structures depending on what the eventual use is. Do you need to optimize for fast insertion/removal? do you need dynamic storage? etc...

Quote:Original post by ronkelly
1) a complex polygonal model (like a ship or building)

Probably a list of vertices and indices, stored heirachically or in groups. Then again, that's pretty much based on my usage of the D3DX environment [smile]

Quote:Original post by ronkelly
2) organic shapes (like a head or a plasticine figure)

parametric/higher-order surfaces seem to be popular for this sort of thing. Look up NURBS/NURMS and see what you think.

Quote:Original post by ronkelly
3) primitive data objects (like spheres, cones, etc.)

Could use either of the above two options here. Some of the primitive objects can be wholly expressed as mathematical functions, others might well benefit from being pre-generated polygonal groups.

Might be easier to suggest specifics if you say what/how you want to use them.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by ronkelly
Hey guys,

If anyone could guide me in the right direction to what would be an efficient data structure to model these types of things that would be great.


I'm assuming here you'll trying to get reasonable looking models at reasonib;e rendering speed.

Quote:
1) a complex polygonal model (like a ship or building)


a vertex array or an indexed vertex array as they are easy to go through and render and can give you the shape realistically

Quote:
2) organic shapes (like a head or a plasticine figure)


I agree with jollyjeffers about using NURBS/NURMS. Just store the control points for them.

Quote:
3) primitive data objects (like spheres, cones, etc.)


Just store the values you need to beable to recreate the object eg. centre point, radius, height


This topic is closed to new replies.

Advertisement