setting the camera's viewport

Have jReality programming problems or questions? Post them here.
Post Reply
draperg
Posts: 5
Joined: Wed 5. Jul 2006, 19:06
Location: Salt Lake City, Utah, USA
Contact:

setting the camera's viewport

Post by draperg » Wed 5. Jul 2006, 20:44

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

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: setting the camera's viewport

Post by steffen » Thu 6. Jul 2006, 12:02

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.

Post Reply