I’m trying to create a 3d world using OpenGL. How exactly should I store the world? Do I just create models and leave them around somewhere, assuming OpenGL stores them in some organized fashion? Also, I understand that OpenGL takes care of rendering issues so I don’t need to use depth buffers or oct-trees or BSP trees or any of that, or am I mistaken?
How you store your world is totally up to you, however OpenGL has no concept of models, oct-trees or BSP-trees - even an explicit depth buffer is not guranteed /me waves at Kryo and Dreamcast graphics
You’ve gotta do all that stuff yourself, or better yet it sounds like you’d prefer using Xith3D a few forums further down…
[quote]I’m trying to create a 3d world using OpenGL. How exactly should I store the world? Do I just create models and leave them around somewhere, assuming OpenGL stores them in some organized fashion? Also, I understand that OpenGL takes care of rendering issues so I don’t need to use depth buffers or oct-trees or BSP trees or any of that, or am I mistaken?
[/quote]
Since I am a 3d newbie too I understand your position well.
OpenGL is a low level 3d API and doesn’t know about objects or such. Basically you give the lowest units of your 3d world to OpenGL, which is a polygon consisting of some 3d points (called a vertex). Then you tell the OpenGL state machine what colour, texture, light, etc should be connected to that polygon and OpenGL draws this (during rasterization).
All the rest is up to you - and that’s a lot.
Z-Puffer means that OpenGL stores for each pixel on the final 2d screen what Z value it has got, and doesn’t paint pixels with lower Z-values on it. During the rasterization from 3d to 2d. Very low level.
Things like (oct- oder BSP-) trees you need for your 3d objects like to find out which 3d objects you actually see on screen and which ones you needn’t bother to give to OpenGL.
However OpenGL doesn’t know anything about such things. So again it’s up to you.
Well, I’d recommend to use a higher level 3d API which bases on OpenGL. For example Xith3d (which is similar to Java3d but alive and optimized for fast games).
Such an API you can feed with your 3d objects and … it does all the rest, which is a lot.
For example it stores your 3d worlds’s objects in trees or whatever and does many more clever and complicated things.
Xith3d’s cool, it’s fun and it lets you concentrate on your task (ie creating a 3d world and bring this one to life). And best: it’s Opensource (BSD licence).