tags:

views:

30

answers:

2

Greetings!

I have this question. Whenever, I enter a transformation (gltranslate, glrotate, glscale) within a display list, the transformation remains as a command within the display list. Everytime the display list is rendered, it will calculate all and over again.

Is there a way, I can make an opengl transformation and the transformed vertex coordinates be stored permanently in a display list instead of transformation & intial coordinates? Hope my question makes sense.

Thank you in advance.

Gary

A: 

Apply your matrix transforms manually to your vertexes before submitting them to a display list.

But Drew Hall is right: the driver is probably already doing something similar when it compiles your display lists.

genpfault
A: 

Hello Drew and penpfault

Thank you for your feedback. I appreciate you guys taking the time to help. Simplified version of my list is like this

List_A

glrotate
glbegin
32 segment 2D eclipse
glend

What I do know is, whenever I do a glcallist(List_A) within another Display List, the GPU takes the original vertex and do a glrotate. I am making this assumption because without the glrotate in it, 5000 copies of this display list renders at 2/3 the time it takes with glrotate included.

So I am guessing, with only 4 glrotate angles required for the task, it is better to store the eclipse, pre-rotated into 4 display list, than to call the list and transform the original vertices 5000 times. At this moment, I am doing it the way penpfault mentioned, by doing matrix transformations manually by code and storing the results in 4 display list.

I am wondering if there is a method of acheiving the same result using only opengl commands without resorting to CPU based matrix computation to pre-calculate the rotated vertices?

Gary

Gary