type
TForm3 =
class(TForm)
// [...]
public
// [...]
A3DFile: T3DDataFile;
procedure Render;
end;
procedure TForm3.Render;
var i,j: Integer;
begin
glClear(GL_COLOR_BUFFER_BIT
or GL_DEPTH_BUFFER_BIT);
glLoadIdentity;
Glbegin(GL_TRIANGLES);
for i:= 0
to A3DFile.Meshes.Count-1
do // beim Debuggen: A3DFile.Meshes.Count --> inaccessible value --> AV
begin
for j:= 0
to A3DFile.Meshes[i].Faces.Count-1
do
begin
glVertex3f(A3DFile.Meshes[i].Faces[j].A^.x,
A3DFile.Meshes[i].Faces[j].A^.y,
A3DFile.Meshes[i].Faces[j].A^.z);
glVertex3f(A3DFile.Meshes[i].Faces[j].B^.x,
A3DFile.Meshes[i].Faces[j].B^.y,
A3DFile.Meshes[i].Faces[j].B^.z);
glVertex3f(A3DFile.Meshes[i].Faces[j].C^.x,
A3DFile.Meshes[i].Faces[j].C^.y,
A3DFile.Meshes[i].Faces[j].C^.z);
end;
end;
glend;
SwapBuffers(
DC);
end;