Placing objects in the world

Started by jkndmiththinda, March 07, 2012, 08:26:20 PM

Previous topic - Next topic

jkndmiththinda

Hi I'm new to JPCT engine and find it great and very interesting. I need to create a screen with 3d icons and text captions and i want these icons to be spread evenly on the screen, regardless the screen size of the device. I used blitting to position the captions as desired. But i have trouble positioning the corresponding 3d icons, I don't understand how to correlate screen size with the object translation units. Could you please explain how to do this? Once again, thank you very much for sharing this great engine!

EgonOlsen

It's a basic perspective projection, but there's no rule that says "50 units in world space to the left ends up at pixel 50/60 on a 800*480 display. It depends on a lot of things like fov, camera position, scale etc.

However, maybe this method can help to find a solution: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Interact2D.html#reproject2D3DWS(com.threed.jpct.Camera, com.threed.jpct.FrameBuffer, int, int)

jkndmiththinda

Dear EgonOslen,

Thank you very much for the reply. I managed to get the task done using the reference you gave. Again, thanks for sharing this great engine with the developer community.