www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: lawless_c on August 15, 2015, 08:45:17 pm

Title: Screen size/shape & view area?
Post by: lawless_c on August 15, 2015, 08:45:17 pm
Just wanted to know does the size of a screen affect the area the Camera sees?

For example , if i have world which contains multiple objects will a large screen running the same code as a device with a smaller screen simply show me a larger image?
or would a larger screen show everything exactly the same but larger?


I ask because im working on Some UI elements which exist in the world space(instead of being added to the framebuffer) and i wanted to know how difficult it would be to keep them im roughly similar positions accross devices.
Title: Re: Screen size/shape & view area?
Post by: EgonOlsen on August 17, 2015, 08:37:42 am
For blitting, you are using absolute coordinates and so a change in device resolution causes a change in change in blitting positions relative to the screen. If you don't want that, define yourself a reference coordinate system and scale everything based on that. For example, "blit" as if your screen would be 800*480 and rescale the values accordingly before doing the actual blit operation to match your device's resolution. Keep in mind that different aspect ratios exist as well.

For 3D models, it shows the same as long as the aspect ratio remains the same. If not, it will adjust vertically by default. In other words: The horizontal field of view will always be the same, the vertical will be adjusted to prevent the rendering from distorting.
You can modify this behaviour, but this is how it's by default and that should actually be what one wants in most cases.
Title: Re: Screen size/shape & view area?
Post by: lawless_c on August 17, 2015, 06:19:50 pm
Is there a way to extract the coordinates of the image plane in world space? , I think if i have this it will all become very easy.
Title: Re: Screen size/shape & view area?
Post by: EgonOlsen on August 17, 2015, 09:04:53 pm
What for? I don't really understand the purpose... ???
Title: Re: Screen size/shape & view area?
Post by: lawless_c on August 17, 2015, 09:38:38 pm
If i can get that along with the field of views i can extrapolate where the edge of the screen is at any distance.
Title: Re: Screen size/shape & view area?
Post by: EgonOlsen on August 17, 2015, 11:29:14 pm
The methods in Interact2D should help for that: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Interact2D.html (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Interact2D.html)
Title: Re: Screen size/shape & view area?
Post by: lawless_c on August 17, 2015, 11:51:21 pm
Ah that's perfect.