Registriert: Di Apr 29, 2008 18:56 Beiträge: 1213
Programmiersprache: Delphi/FPC
HI,
ich wollt ma fragen ob man glPushMatrix/glPopMatrix auch schachteln kann, also:
Code:
[...]
glPushMatrix;
[...]
glPushMatrix;
[...]
glPopMatrix;
[...]
glPopMatrix;
[...]
geht das so? und wie oft kann man das machen? könnt das zugriffsverletzungen verursachen?
weil ich in letzter Zeit hab ich irgendwelche komischen fehler, und ich weiß einfach nich wo
die her kommen...
Registriert: Do Dez 05, 2002 10:35 Beiträge: 4234 Wohnort: Dortmund
Der Modelview Stack bietet meistens (sofern ich mich ohne Kaffee richtig erinnere) Platz für 32 Matrizen. Zugriffsverletzungen wirst du dadurch aber nicht bekommen. Selbst wenn der Stack über oder unterläuft wird es dabei nur einen OpenGL Fehler geben.
32 Einträge für ModelView, 2 für die anderen Modi(Projektion,Textur,Farbe). Push darfst du dann natürlich nur einmal weniger aufrufen, weil die aktuelle Matrix mitzählt. Natürlich kann eine Implementation einen tieferen Stack haben, du kannst dich aber nicht darauf verlassen. Man kann die Stackgröße der Implementation auch abfragen.
OpenGL 2.0 Spec:
There is a stack of matrices for each of matrix modes MODELVIEW,
PROJECTION, and COLOR, and for each texture unit. For MODELVIEW mode, the
stack depth is at least 32 (that is, there is a stack of at least 32 model-view matrices).
For the other modes, the depth is at least 2. Texture matrix stacks for all
texture units have the same depth. The current matrix in any mode is the matrix on
the top of the stack for that mode.
OpenGL 1.1 Spec:
There is a stack of matrices for each of the matrix modes. For MODELVIEW mode, the stack depth is at least 32 (that is, there is a stack of at least 32 model-view matrices). For the other modes, the depth is at least 2. The current matrix in any mode is the matrix on the top of the stack for that mode.
Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.