Article View: comp.graphics.api.opengl
Article #91Re: 3D scene data structure
From: Dave Eberly
Date: Mon, 06 Sep 1999 00:00
Date: Mon, 06 Sep 1999 00:00
42 lines
2844 bytes
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
Technical Details
Message-ID:
<7r21n7$3i1@dfw-ixnews19.ix.netcom.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7qvilu$npv$1@metro.ucc.usyd.edu.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10e433,964e62e5ba9b4c0f X-Google-Attributes: gid10e433,public X-Google-Thread: f65bb,964e62e5ba9b4c0f X-Google-Attributes: gidf65bb,public X-Google-Thread: 103885,964e62e5ba9b4c0f X-Google-Attributes: gid103885,public From: "Dave Eberly" <eberly@magic-software.com> Subject: Re: 3D scene data structure Date: 1999/09/06 Message-ID: <7r21n7$3i1@dfw-ixnews19.ix.netcom.com> X-Deja-AN: 521948397 References: <7qvilu$npv$1@metro.ucc.usyd.edu.au> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Organization: Magic Software X-NETCOM-Date: Mon Sep 06 10:44:39 PM CDT 1999 X-MSMail-Priority: Normal Newsgroups: comp.graphics.api.opengl,comp.graphics.visualization,borland.public.cppbuilder.graphics