🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.graphics.api.opengl
2 messages
2 total messages Started by Albert Goodwill Mon, 06 Sep 1999 00:00
3D scene data structure
#90
Author: Albert Goodwill
Date: Mon, 06 Sep 1999 00:00
8 lines
1323 bytes
In an OpenGL based C++ application I have many number of 3D objects in a
scenery.
Each 3D-objects are relatively complex set of polygonal surfaces.
I currently able to look at to scene from any camera position and render the
result.
In certain camera positions many of the the 3D-objects are out of the view.
Which kind data structure you could recomment for 3D-objects to be placed so
that I can skip in rendering process if they are out of the view?
Re: 3D scene data structure
#91
Author: Dave Eberly
Date: Mon, 06 Sep 1999 00:00
42 lines
2844 bytes
Albert Goodwill <albertgoodwill@geocities.com> wrote in message
news:7qvilu$npv$1@metro.ucc.usyd.edu.au...
> In an OpenGL based C++ application I have many number of 3D objects in a
> scenery.
> Each 3D-objects are relatively complex set of polygonal surfaces.
> I currently able to look at to scene from any camera position and render
the
> result.
> In certain camera positions many of the the 3D-objects are out of the
view.
> Which kind data structure you could recomment for 3D-objects to be placed
so
> that I can skip in rendering process if they are out of the view?

Organize your objects as a tree.  The leaf nodes represent the drawable
objects.  The internal nodes are used for grouping.  Your 3D objects might
each be a leaf node, but you might also decompose your objects into
smaller pieces if they are large meshes.

Each node of the tree maintains a bounding volume.  The bounding volume
of a node is required to enclose all the bounding volumes of its child
nodes.  Rendering the scene amounts to traversing the tree and drawing
the geometry at the leaf nodes.  For each visited node, you test its
bounding
volume against the view frustum.  If it is outside the frustum, then all the
geometry represented by the subtree rooted at that node is outside the
frustum.  Therefore, you can cull large portions of the tree at one time.

Moreover, if you keep track of which planes a bounding volume is
"inside" (on the frustum side of the plane), you can save time in the
culling tests.  At a node if the bounding volume is inside the Right
plane, then there is no need to test the child bounding volumes against
the Right plane.  In fact, when you get to a leaf node where the
bounding volume is inside the Right plane, then the renderer can be
told not to clip against that plane (assuming the renderer has support
for disabling clipping planes).  Same arguments apply for other
clipping planes, Left, Top, Bottom, Near, Far.

--
Dave Eberly
eberly@magic-software.com
http://www.magic-software.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads