Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
Delphi 6 Personal
|
Re: Windows Seven und OpenGL nicht kompatibel ?
17. Sep 2009, 22:53
Vorweg, Aero ist in der VM aus.
Was mich wundert ist, das alles soweit funktioniert bis auf das Darstellen
meines 3D-Körpers.
Hier mal ein Ausschnitt:
Delphi-Quellcode:
//Klappt nicht:
procedure glQader(TextureID: DWORD);
begin
//glColor4f(0.5, 0.5, 1.0, 1.0);
glColor4f(0.7, 0.7, 1.0, 1.0);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TextureID); // Bind the Texture to the object
glBegin(GL_QUADS);
// Front Face
glNormal3f( 0.0, 0.0, 1.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 1.0);
glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, -1.0, 1.0);
glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, 1.0);
glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 1.0);
// Back Face
glNormal3f( 0.0, 0.0,-1.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, -1.0);
glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, 1.0, -1.0);
glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, -1.0);
glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, -1.0, -1.0);
// Top Face
glNormal3f( 0.0, 1.0, 0.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, 1.0, -1.0);
glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, 1.0, 1.0);
glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, 1.0);
glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, 1.0, -1.0);
// Bottom Face
glNormal3f( 0.0,-1.0, 0.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, -1.0);
glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, -1.0, -1.0);
glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, -1.0, 1.0);
glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, -1.0, 1.0);
// Right face
glNormal3f( 1.0, 0.0, 0.0);
glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0, -1.0);
glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, 1.0, -1.0);
glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, 1.0);
glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, -1.0, 1.0);
// Left Face
glNormal3f(-1.0, 0.0, 0.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, -1.0);
glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, 1.0);
glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, 1.0, 1.0);
glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, -1.0);
glEnd();
end;
Delphi-Quellcode:
//Läuft:
procedure glLineQader(Size: single; Color: TV4f);
begin
glColor4fv(@Color);
glDisable(GL_TEXTURE_2D);
glBegin(GL_LINE_STRIP);
glVertex3f(-Size, Size,-Size); //Top
glVertex3f( Size, Size,-Size);
glVertex3f( Size, Size, Size);
glVertex3f(-Size, Size, Size);
glVertex3f(-Size, Size,-Size);
glVertex3f(-Size,-Size,-Size); //toBottom
glVertex3f( Size,-Size,-Size); //Bottom
glVertex3f( Size,-Size, Size);
glVertex3f(-Size,-Size, Size);
glVertex3f(-Size,-Size,-Size);
glEnd();
glBegin(GL_LINES);
glVertex3f(-Size, Size, Size);
glVertex3f(-Size,-Size, Size);
glEnd();
glBegin(GL_LINES);
glVertex3f( Size, Size, Size);
glVertex3f( Size,-Size, Size);
glEnd();
glBegin(GL_LINES);
glVertex3f( Size, Size,-Size);
glVertex3f( Size,-Size,-Size);
glEnd();
glEnable(GL_TEXTURE_2D);
end;
|