EasyManuals Logo

HP j6700 Supplementary Guide

HP j6700
62 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #57 background imageLoading...
Page #57 background image
programming hints
OpenGL performance hints
Chapter 5 55
... many more vertices...
glEnd();
than this:
glBegin(GL_TRIANGLES);
glColor3f(1,2,3);
glVertex3f(...);
... many more vertices...
glEnd();
For performance efficiency avoid glMaterial state changes, especially
within a glBegin/glEnd pair.
regular primitive data
If the vertex data that you give to a display list is regular (that is, every
vertex has the same data associated with it), it is possible for the display
list to optimize the primitive much more effectively than if the data is not
regular.
For example if you wanted to give only a single normal for each face in a
GL_TRIANGLES primitive, the most intuitive way to get the best
performance would look like this:
glBegin(GL_TRIANGLES);
glNormal3fv(&v1);
glVertex3fv(&p1); glVertex3fv(&p2); glVertex3fv(&p3);
glNormal3fv(&v2);
glVertex3fv(&p4); glVertex3fv(&p5); glVertex3fv(&p6);
...
glEnd();
In immediate mode, this would give you the best performance. However,
if you are putting these calls into a display list, you will get much better
performance by duplicating the normal for each vertex, thereby giving
regular data to the display list:
glBegin(GL_TRIANGLES);
glNormal3fv(&v1); glVertex3fv(&p1);
glNormal3fv(&v1); glVertex3fv(&p2);
glNormal3fv(&v1); glVertex3fv(&p3);
glNormal3fv(&v2); glVertex3fv(&p4);
OGLImp.book Page 55 Tuesday, February 14, 2006 9:15 AM

Table of Contents

Other manuals for HP j6700

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP j6700 and is the answer not in the manual?

HP j6700 Specifications

General IconGeneral
BrandHP
Modelj6700
CategoryDesktop
LanguageEnglish

Related product manuals