kingslee
12th November 2006, 23:30
hello,
I draw 4 individual objects stic together(4 cubes to form a square in blender)and export it to VRML2 format. In that i have points and coordindex for each object.so I create array list(glnewlist()) for each and print on the screen.
but the objects are not as before, it merged or in unordered manner
is there something to do with transformations?
any idea about dealing this ,please?
thanks
glNewList(2, GL_COMPILE);
for (int i=0; i<6; i++)
{
glBegin(GL_POLYGON);
x=Friend2[faceRefs2[i][0]][0];
y=Friend2[faceRefs2[i][0]][1];
z=Friend2[faceRefs2[i][0]][2];
glVertex3f(x, y, z);
x=Friend2[faceRefs2[i][1]][0];
y=Friend2[faceRefs2[i][1]][1];
z=Friend2[faceRefs2[i][1]][2];
glVertex3f(x, y, z);
x=Friend2[faceRefs2[i][2]][0];
y=Friend2[faceRefs2[i][2]][1];
z=Friend2[faceRefs2[i][2]][2];
glVertex3f(x, y, z);
x=Friend2[faceRefs2[i][3]][0];
y=Friend2[faceRefs2[i][3]][1];
z=Friend2[faceRefs2[i][3]][2];
glVertex3f(x, y, z);
if(faceRefs2[i][4] != -1)
{
x=Friend2[faceRefs2[i][4]][0];
y=Friend2[faceRefs2[i][4]][1];
z=Friend2[faceRefs2[i][4]][2];
glVertex3f(x, y, z);
}
glEnd();
}
glColor3f(1.0f,0.0f,1.0f);
glBegin(GL_QUADS);
x=Friend2[4][0];
y=Friend2[4][1];
z=Friend2[4][2];
glVertex3f(x,y,z);
x=Friend2[5][0];
y=Friend2[5][1];
z=Friend2[5][2];
glVertex3f(x,y,z);
x=Friend2[6][0];
y=Friend2[6][1];
z=Friend2[6][2];
glVertex3f(x,y,z);
x=Friend2[7][0];
y=Friend2[7][1];
z=Friend2[7][2];
glVertex3f(x,y,z);
glEnd();
glEndList();
I draw 4 individual objects stic together(4 cubes to form a square in blender)and export it to VRML2 format. In that i have points and coordindex for each object.so I create array list(glnewlist()) for each and print on the screen.
but the objects are not as before, it merged or in unordered manner
is there something to do with transformations?
any idea about dealing this ,please?
thanks
glNewList(2, GL_COMPILE);
for (int i=0; i<6; i++)
{
glBegin(GL_POLYGON);
x=Friend2[faceRefs2[i][0]][0];
y=Friend2[faceRefs2[i][0]][1];
z=Friend2[faceRefs2[i][0]][2];
glVertex3f(x, y, z);
x=Friend2[faceRefs2[i][1]][0];
y=Friend2[faceRefs2[i][1]][1];
z=Friend2[faceRefs2[i][1]][2];
glVertex3f(x, y, z);
x=Friend2[faceRefs2[i][2]][0];
y=Friend2[faceRefs2[i][2]][1];
z=Friend2[faceRefs2[i][2]][2];
glVertex3f(x, y, z);
x=Friend2[faceRefs2[i][3]][0];
y=Friend2[faceRefs2[i][3]][1];
z=Friend2[faceRefs2[i][3]][2];
glVertex3f(x, y, z);
if(faceRefs2[i][4] != -1)
{
x=Friend2[faceRefs2[i][4]][0];
y=Friend2[faceRefs2[i][4]][1];
z=Friend2[faceRefs2[i][4]][2];
glVertex3f(x, y, z);
}
glEnd();
}
glColor3f(1.0f,0.0f,1.0f);
glBegin(GL_QUADS);
x=Friend2[4][0];
y=Friend2[4][1];
z=Friend2[4][2];
glVertex3f(x,y,z);
x=Friend2[5][0];
y=Friend2[5][1];
z=Friend2[5][2];
glVertex3f(x,y,z);
x=Friend2[6][0];
y=Friend2[6][1];
z=Friend2[6][2];
glVertex3f(x,y,z);
x=Friend2[7][0];
y=Friend2[7][1];
z=Friend2[7][2];
glVertex3f(x,y,z);
glEnd();
glEndList();