Simple simulations - need advice

I’m a relative newbie to OpenGL and I’m planning to develop simple simulations of astromonical events - e.g. solar eclipse, asteroid hurtling toward earth, gas cloud collapsing for form a star, etc.

How would you go about writing systems like these with OpenGL? I’ve got simple programs working now, but they hardcode the geometry and don’t use any kind of scene graph or bsp-tree for scene manipulation (and I’m not sure they need to).

I’m not sure where to start. Any references would be greatly appreciated.

definitely not bsp trees. they are used for hidden surface removal and work best with indoor environments. sounds like you should start looking at particle engines, gravity, physics, etc.


Check out the spec section about vertex arrays. It’s pretty straight forward once you manage to wrap your mind around it. This will remove the need for hard-coded geometry.

Animation and culling falls into the realm of software engineering challenges though. OpenGL is too low level to handle it all.

For a space sim however, you might consider researching Octrees or at least frustum culling. I’m sure the former isn’t particularly easy' or at beginner level (intermidiate). There arescene graphs’ available all over the place that hook into OpenGL though - so you might consider using one of those (if you want to learn how they work, its best to try and write your own however).

Thanks for the tips. I should amend my original “newbie” statement. While I’m a newbie to OpenGL, I’ve been programming in C and C++ for 8-10 years.

My OpenGL experience is currently the basics I’ve learned with the Red Book and Super Bible - transformations, matrix stacks, simple camera operation, texture mapping, lighting, materials.

I’m just stuck on where to go next for the “higher level” stuff involved in building/rendering a scene. The Graphics Gems books seem to be too low level…Real Time Rendering and the 3D Game Engine Design book look promising. OpenInventor seems like overkill for what I would like to do.

Anyway, thanks again, and I hope this gives a better picture about where I currently am in my experience.

You could check out some VRML tutorials (google search: vrml tutorial)

Coding the graph is easy once you see how it’s done, and VRML does it.