Limitation on world coordinates

Started by colens, September 11, 2017, 06:47:53 PM

Previous topic - Next topic

colens

I am using JPCT AE in an app that draws a vehicle path as series of polygons. I get longitude/latitude coordinates from gps and transform them into coordinates in XZ plane of JPCT AE world. In my case Y is always 0. It seems that x and z coordinates are limited to about +-32000. When I draw a polygon whose coordinates exceed this limit , although the camera  position and focal point (with lookAt()) are correctly set, polygon is not drawn. On the other hand,  when polygon and camera are inside these bounds everything works as expected.
I tried to find any information about this issue, but  I couldn't. Please help.

EgonOlsen

This might be related to the way in which you are creating your objects, which I don't know...but jPCT-AE tries to detect if it's possible to compile an object's vertex data to fixed point, which is limited to that range. Depending on the way in which you are building your objects, this check might return true albeit it's actually not true anymore later in the process. You can avoid this by setting http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setFixedPointMode(boolean) to false on the objects in question (before calling build() on them).
Another reason might be that some GPUs can't handle numbers above or below +-2^15 in the shaders. This shouldn't be an issue with the default shaders but it might be one, if you are using your own shaders.