- glDeleteLists(objects,1);
- objects = glGenLists (1);
- glNewList(objects, GL_COMPILE);
- glEnable(GL_DEPTH_TEST);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glColor3f(0.1, 0.1, 0.1);
- glBegin(GL_TRIANGLES);
- for( ii = 0; ii < (int)(fileData.fileHeight - step); ii += step ){
- for( jj = 0; jj < (int)(fileData.fileWidth - step); jj += step ){
- glVertex3f(-fileData.points[(int)ii][(int)jj]/100.0f, jj/100.0f, ii/100.0f);
- glVertex3f(-fileData.points[(int)(ii+step)][(int)jj]/100.0f, jj/100.0f, (ii+step)/100.0f);
- glVertex3f(-fileData.points[(int)ii][(int)(jj+step)]/100.0f, (jj+step)/100.0f, ii/100.0f);
- glVertex3f(-fileData.points[(int)(ii+step)][(int)(jj+step)]/100.0f, (jj+step)/100.0f, (ii+step)/100.0f);
- glVertex3f(-fileData.points[(int)ii][(int)(jj+step)]/100.0f, (jj+step)/100.0f, ii/100.0f);
- glVertex3f(-fileData.points[(int)(ii+step)][(int)jj]/100.0f, jj/100.0f, (ii+step)/100.0f);
- }
- }
- glEnd();
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glColor3f(0.2, 0.2, 0.2);
- glLineWidth(1.5);
- glBegin(GL_TRIANGLES);
- for( ii = 0; ii < (int)(fileData.fileHeight - step); ii += step ){
- for( jj = 0; jj < (int)(fileData.fileWidth - step); jj += step ){
- glColor3f(fileData.points[(int)ii][(int)jj]/1024,
- fileData.points[(int)ii][(int)jj]/1024,
- fileData.points[(int)ii][(int)jj]/1024);
- glVertex3f(-fileData.points[(int)ii][(int)jj]/100.0f, jj/100.0f, ii/100.0f);
- glColor3f(fileData.points[(int)(ii+step)][(int)jj]/1024,
- fileData.points[(int)(ii+step)][(int)jj]/1024,
- fileData.points[(int)(ii+step)][(int)jj]/1024);
- glVertex3f(-fileData.points[(int)(ii+step)][(int)jj]/100.0f, jj/100.0f, (ii+step)/100.0f);
- glColor3f(fileData.points[(int)ii][(int)(jj+step)]/1024,
- fileData.points[(int)ii][(int)(jj+step)]/1024,
- fileData.points[(int)ii][(int)(jj+step)]/1024);
- glVertex3f(-fileData.points[(int)ii][(int)(jj+step)]/100.0f, (jj+step)/100.0f, ii/100.0f);
- glColor3f(fileData.points[(int)(ii+step)][(int)(jj+step)]/1024,
- fileData.points[(int)(ii+step)][(int)(jj+step)]/1024,
- fileData.points[(int)(ii+step)][(int)(jj+step)]/1024);
- glVertex3f(-fileData.points[(int)(ii+step)][(int)(jj+step)]/100.0f, (jj+step)/100.0f, (ii+step)/100.0f);
- glColor3f(fileData.points[(int)ii][(int)(jj+step)]/1024,
- fileData.points[(int)ii][(int)(jj+step)]/1024,
- fileData.points[(int)ii][(int)(jj+step)]/1024);
- glVertex3f(-fileData.points[(int)ii][(int)(jj+step)]/100.0f, (jj+step)/100.0f, ii/100.0f);
- glColor3f(fileData.points[(int)(ii+step)][(int)jj]/1024,
- fileData.points[(int)(ii+step)][(int)jj]/1024,
- fileData.points[(int)(ii+step)][(int)jj]/1024);
- glVertex3f(-fileData.points[(int)(ii+step)][(int)jj]/100.0f, jj/100.0f, (ii+step)/100.0f);
- }
- }
- glEnd();
- glEndList();