0

I recently started to work with an API in our Java application environment which uses JOGL (makes OpenGL commands accessible in Java) to create a 3D environment within our application (so I am pretty new to OpenGL).

This API uses display lists to group and speed up the commands to display a geometric component. So far, in the display method, first all the changes to the scene made by the mouse are applied (zoom, rotation, translation), then the current display list is called. The API provides a variety of scene elements (surfaces, light, transformations) which are put into a tree-like structure. This structure determines the order in which these scene elements will be "executed" later. This execution of the scene tree is than put into a display list. This works as intended.

What I want to add now is a small coordinate system as a representation of the component's current orientation. This would be a new scene element to be added to the scene tree. This coordinate system should obviously be influenced by rotations done with the mouse, but it should not be scaled or translated to other places.

My problem is: As the mouse movements are applied outside of the execution of the scene tree, I don't know how to apply only the rotation to only a certain scene element of the tree. I can't just revert the mouse movement in the corresponding part of the display list (in my understanding) because that would mean the display list would have to take the parameter of the mouse position's changes. But I can't work with parameters in display lists as their state is determined once and then only executed in this state (correct?). I can't just reset the projection matrix as I would lose the rotation state.

I hope my problem is understandable. Is there a way to do this with display lists or do I might have to replace the display lists in this API with an alternative? They don't seem to be recommended anyway.

4

0 回答 0