www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: sgi on February 03, 2014, 12:30:57 am

Title: Camera Questions
Post by: sgi on February 03, 2014, 12:30:57 am
I'm kind of new to OpenGL and this framework. I've been having some fun settings things up and researching. I have some questions so far:

Title: Re: Camera Questions
Post by: EgonOlsen on February 03, 2014, 07:38:13 am
I'm not sure what exactly you mean by "relative to the camera". You can translate objects by using, well...translate(). If that has to happen relative to the camera, you have to calculate the new position based on the position of the camera by simply adding it and then do something like

Code: [Select]
obj.clearTranslation();
obj.translate(newPosition);

If you don't clear the translation in the case, the translations will add up.

To answer your second question: Yes!
Title: Re: Camera Questions
Post by: sgi on February 15, 2014, 06:49:47 am
With the second question answered, I think what I was looking for was Object3D#setOrigin. I basically was handed some prototypes by an intern and a lot of their examples involved moving the camera a lot, so I was looking for a better approach for my prototypes. Thanks for the help! :)