scenegraphs, space sims, data structures, oh my

Started by
1 comment, last by zedzeek 19 years, 3 months ago
I'm pretty unfamiliar with data structures used in scenegraphs for 3D games. Basically I'm interested in nothing too heavy duty, just semi-smart culling of objects. Our player will be flying around in a space ship--and space is relatively sparse. In one "sector," there might be a planet off in the distance, a looming rotating space station, asteroid field off in the distance, and various other ships milling about. I'm looking for the most intelligent way to divide up all that space, for both rendering and collision detection. Most importantly, if the player isn't facing towards the space station, don't draw it. I'm thinking the easiest method would just be to define a bounding sphere with each "Renderable" object. But does anyone have any experience in this area? What would the base class for a Renderable look like? Should everything be a tree? Should model data and bounding information be tightly coupled?
Advertisement
If you have quite few objects, just having a sphere for each object that you can cull against your frustum would works nicely.
If you have many objects this will be slow, and then you should look into some kind of tree-structure (oct-tree:s or probably loose oct-tree:s).

A sphere is easiest defined by a position and a radius. :)

Good luck!
Quote:
I'm thinking the easiest method would just be to define a bounding sphere with each "Renderable" object. But does anyone have any experience in this area? What would the base class for a Renderable look like? Should everything be a tree? Should model data and bounding information be tightly coupled?


in a space simulation the (*)best method, just chuck a boundsphere/box around each object and do indiviual tests. u wont see any speed problems up to 1000 objects, if u have places with 1,000s objects in a spot (eg an asteroid field) u might wanna chuck a bounding sphere around that first.

(*)space is typicaly sparse thus space partitioning methods (pardon the pun) arent normally the best

This topic is closed to new replies.

Advertisement