PDA

View Full Version : a Question of OpenGL Programming with Big Scene



zjkw
04-04-2002, 05:11 AM
I am a learner of OpenGL and plan to write a OpenGL game. The game has a large scene,but I only need draw a very little part in the window everytime. So it is very wasteful to draw the whole scene.What method I can use to solve this problem?
thanks

Furrage
04-04-2002, 05:46 AM
Do a search on "frustrum culling". It's what you need.

pleopard
04-04-2002, 05:50 AM
http://www.markmorley.com/opengl/frustumculling.html

Xiaofeng
04-05-2002, 02:29 AM
but i can not use display list anymore


Originally posted by Furrage:
Do a search on "frustrum culling". It's what you need.

Furrage
04-05-2002, 07:27 AM
Based on previous discussions it appears that display lists are best used for sections of your scene instead of the whole scene. So all the poly's of a tank can be in one display list, but different types of tanks would be in display lists. You can cull these lists by creating a bounding box/shape for them. If part (this includes all) of the bounding box is in the frustrum, draw it and let OpenGL take care of clipping. If the bounding box is outside the frustrum ignore it as the display list would not be seen anyway.

Terrain is a different matter because only a small part of it is on screen at any one time. This makes terrains a perfect candidate for frustrum culling, and not display lists. If you want to use display lists with terrain break the terrain into sectors, place the sectors in dispaly lists, build bounding boxes for the sectors, and cull away sectors that can't be seen.