www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Marius on June 19, 2013, 09:53:25 pm

Title: Dimension of the viewable area
Post by: Marius on June 19, 2013, 09:53:25 pm
Hello,

i think my question is very easy to answer, but i don't get it..
I want to place 16 objects on the screen. The objects should be organized in 4 rows with each 4 columns. The space between the objects should be the same between all objects. This all is easy if i'm calculating with pixels according to the dimension of my screen. But i don't get it, how to get the "dimension" of the viewable area. Lets say the camera is a position x=0,y=0,z=100. How "big" is the area the user sees? How do i calculate this value?

Thanks in advance,
Marius
Title: Re: Dimension of the viewable area
Post by: EgonOlsen on June 20, 2013, 07:22:17 am
You can use this method http://www.jpct.net/doc/com/threed/jpct/Interact2D.html#reproject2D3D(com.threed.jpct.Camera, com.threed.jpct.FrameBuffer, int, int, float) (http://www.jpct.net/doc/com/threed/jpct/Interact2D.html#reproject2D3D(com.threed.jpct.Camera, com.threed.jpct.FrameBuffer, int, int, float)) to find the 3d coordinates that represent the corners in screen space for a given depth.
Title: Re: Dimension of the viewable area
Post by: Marius on June 20, 2013, 08:43:12 am
Thank you so much!! That is what i was looking for!