View Full Version : how can i make my 3D program run faster ?

07-03-2003, 05:46 AM
hi,i want to write a program to make the user interface into 3D world,but my program runs not as fast as i want.
sorry,i'm not good at English.
my program runs under linux + Xwindow,the source is here: http://download.gro.clinux.org/myworld/my3dgui-0.1_1.7.tar.gz
the demo is here: http://download.gro.clinux.org/myworld/my3dgui_demo_1-0.1_1.7.tar.gz
need glut

07-04-2003, 12:27 AM
Here ,i am chinese too.Nice to meet you http://www.opengl.org/discussion_boards/ubb/smile.gif
But I think your post is a little too broad to answer ,people here tend to answer more specific problem,usually not code/bug analysis .
Red book page 678 has peformance tips like use glcalllist ,something like that that i don't repeat here.
Give it look and Good Luck

07-04-2003, 06:35 AM
For the gllist all you have to do is:

Glcalllist ListNumber, GL_COMPILE

that will save the rendereing information inside OpenGL

then when you run the program and want to draw that list you call

GlCalllist ListNumber

Thats it, real easy, and it made my programs jump from 5 FPS to 60 FPS http://www.opengl.org/discussion_boards/ubb/smile.gif

07-04-2003, 05:24 PM
thank you all ~~
and i want to do frustum culling , how ?

07-05-2003, 11:12 AM
culling is very simple (now i just have to remeber how to do it...)

to enable first call, glEnable GL_CULLFACE
then call glCullFace and then the method; either front and back, front, or back

07-06-2003, 01:37 AM
3q,but this is just back face culling,how about the object culling ?

07-06-2003, 03:34 AM
google with the keywords "view-frustum culling" gave this interessting link:

I think it explains in detail what you are looking for.


07-06-2003, 03:57 AM
i'm a Chinese and my English is not good
so many English words .... my god .....