GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


the point array and loop by dark q
1
 
typedef struct Point2Struct {
    double x, y;
} Point2;

typedef struct Point3Struct {
    double x, y, z;
} Point3;




/* --------------- Box02 ---------------*/
Point3 Box02_vertex[] = {
    {-25.676006,-85.303658,  0.000000}, {-25.676006,-34.696342,  0.000000}, { 24.931313,-34.696342,  0.000000},
    { 24.931313,-85.303658,  0.000000}, {-25.676006,-85.303658, 50.607319}, { 24.931313,-85.303658, 50.607319},
    { 24.931313,-34.696342, 50.607319}, {-25.676006,-34.696342, 50.607319}
};

long Box02_face[] = {
    0,1,2,-1,
    2,3,0,-1,
    4,5,6,-1,
    6,7,4,-1,
    0,3,5,-1,
    5,4,0,-1,
    3,2,6,-1,
    6,5,3,-1,
    2,1,7,-1,
    7,6,2,-1,
    1,0,4,-1,
    4,7,1,-1
};
///////////////////////////////////////////////////////////////////////////////////////////
int i;
glBegin(GL_TRIANGLES);
for(i=0; i<8; i++)
{
glVertex3d(Box02_vertex[i].x, Box02_vertex[i].y, Box02_vertex[i].z);
}
glEnd();
glFlush();