Author Topic: Limitation on world coordinates  (Read 728 times)

Offline colens

  • byte
  • *
  • Posts: 1
    • View Profile
Limitation on world coordinates
« on: September 11, 2017, 06:47:53 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12056
    • View Profile
Re: Limitation on world coordinates
« Reply #1 on: September 12, 2017, 09:12:29 am »
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 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.