how can i make my 3D program run faster ?

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:
the demo is here:
need glut

Here ,i am chinese too.Nice to meet you
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

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

thank you all ~~
and i want to do frustum culling , how ?

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

3q,but this is just back face culling,how about the object culling ?

google with the keywords “view-frustum culling” gave this interessting link:

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


i’m a Chinese and my English is not good
so many English words … my god …