- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 26
- Points
- 0
Hi
Könnte mir einer vielleicht den Code von einem Hexagon geben?
Könnte mir einer vielleicht den Code von einem Hexagon geben?
glBegin(GL_POLYGON);
for(int i = 0; i < 6; ++i) {
glVertex2d(sin(i/6.0*2*M_PI),
cos(i/6.0*2*M_PI));
}
glEnd();
glBegin(GL_QUADS);
glColor3f(1,1,1);
glVertex3f(0.0, 0.4, 0);
glVertex3f(-0.3, 0.2, 0);
glVertex3f(-0.3,-0.2, 0);
glVertex3f(0.3, 0.2, 0);
glEnd();//end the shape we are currently working on
glBegin(GL_QUADS);
glColor3f(1,1,1);
glVertex3f(-0.3, -0.2, 0);
glVertex3f(0.0, -0.4, 0);
glVertex3f(0.3,-0.2, 0);
glVertex3f(0.3, 0.2, 0);
glEnd();//end the shape we are currently working on