[verschoben] zeichnen mit opengl
Verfasst: 19. Juli 2010 14:40
Hallo, kann mir jemand verraten,weshlb zum geier mir diese Funktion nichts zeichnet? eigentlich sollte ein dreieck gezeichnet werden. mit einer anderen funktion klappt es... es liegt also definitiv an dieser fkt.
hängt es mit meinen const float koordinaten zusammen?
hängt es mit meinen const float koordinaten zusammen?
Code: Alles auswählen
void opengl::draw_object(float x, float y, float z)
{
const float A[3] = {x-0.50000000, y+0.00000000, z+0.86602540};
const float B[3] = {x+0.50000000, y+0.00000000, z+0.86602540};
const float C[3] = {x+0.86602540, y+0.00000000, z+0.50000000};
const float D[3] = {x+0.00000000, y+0.00000000, z-1.00000000};
const float E[3] = {x-0.86602540, y+0.00000000, z-0.50000000};
const float F[3] = {x-0.86602540, y+1.93185165, z+0.50000000};
const float G[3] = {x+0.00000000, y+1.93185165, z+1.00000000};
const float H[3] = {x+0.86602540, y+1.93185165, z+0.50000000};
const float I[3] = {x+0.50000000, y+1.93185165, z-0.86602540};
const float J[3] = {x-0.50000000, y+1.93185165, z-0.86602540};
glBegin(GL_TRIANGLES);
glColor3f(128.0/255.0, 128.0/255.0, 255.0/255.0);
glVertex3f(A[0], A[1], A[2]);
glVertex3f(G[0], G[1], G[2]);
glVertex3f(B[0], B[1], B[2]);
glEnd();
}