Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Hexagon

MasterOf13FPS

Administrator
Staff member
Administrator
MasterOf13FPS
Joined
Jul 11, 2020
Messages
0
Reaction score
25
Points
0
Hi
Könnte mir einer vielleicht den Code von einem Hexagon geben?
 
Quelle: opengl.org
Code:
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();

Quelle: programmerts.blogspot.com
Code:
   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
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top