In a recent email, I was told I could simulate OpenGL's glOrtho/gluOrtho2D functions by using the Camera.setViewport() method. I tried it out, and it works great! Thank you very much for the pointer!
My question/concern is: The javadoc for the Camera class indicates that removing the setViewport() method is on the TODO list as part of a refactoring effort. I am happy to change my code later if the API evolves, but am wondering if there already exists a preferred way of setting the viewport. (No need to use deprecated code if one doesn't have to, right?) :)
Thanks for any advice you could offer!
Geoff
setting the camera's viewport
Re: setting the camera's viewport
This will stay as it is for now, maybe forever ;-)
However there are several problems with the properties of a camera. I. e. one might set the viewport depending on the viewer's window size but that screws up the aspect-ratio of another viewer rendering the same scene. So maybe the viewport should belong to the viewer. In a Cave-like setting, one might regard a camera as the head of the user, then the viewport is implicitly given by the geometry of the Cave - in this case a viewport of the camera makes no sense. So we need to discuss this at some point but I think this will not happen within the next weeks or even months.
Steffen.
However there are several problems with the properties of a camera. I. e. one might set the viewport depending on the viewer's window size but that screws up the aspect-ratio of another viewer rendering the same scene. So maybe the viewport should belong to the viewer. In a Cave-like setting, one might regard a camera as the head of the user, then the viewport is implicitly given by the geometry of the Cave - in this case a viewport of the camera makes no sense. So we need to discuss this at some point but I think this will not happen within the next weeks or even months.
Steffen.