Skip to content

Instantly share code, notes, and snippets.

@pluralism
Created May 25, 2014 15:58
Show Gist options
  • Select an option

  • Save pluralism/b2c1a4b295220618e6cd to your computer and use it in GitHub Desktop.

Select an option

Save pluralism/b2c1a4b295220618e6cd to your computer and use it in GitHub Desktop.
void MyRobot::drawSide()
{
glBegin(GL_QUADS);
for(int i = 0; i < stacks; i++) {
for(int j = 0; j < 3; j++) {
drawVertex(vertex[i][j]);
drawVertex(vertex[i][j + 1]);
drawVertex(vertex[i + 1][j + 1]);
drawVertex(vertex[i + 1][j]);
}
}
glEnd();
}
void MyRobot::drawVertex(Point p)
{
glTexCoord2d(p.x + 0.5, 0.5 - p.z);
glNormal3f(p.nx, p.ny, p.nz);
glVertex3f(p.x, p.y, p.z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment