Post reply

Message icon:

shortcuts: hit alt+s to submit/post or alt+p to preview

Topic Summary

Posted by: Kronnect
« on: March 03, 2020, 03:55:45 AM »

Hi, thanks for the repro steps. This one has resulted a regression in 13.4 due to a floating point accuracy issue. It's been fixed in latest beta. Please upgrade and check if the problem is solved. Thanks.
Posted by: MR
« on: March 02, 2020, 11:32:04 AM »


I tried to replicate the situation at a smaller scale just to make sure it wasn't the large scale that was throwing things off. I opened up the Example #9 for slippy map (Which uses a scale of 5,000) and used the calculator to move the player to the same coordinates: 41.403545, 2.174409

I am attaching the view it gave me. I assume the center of the screen is supposed to be 41.403545, 2.174409, but it's quite a bit off. (Also attaching a Google Maps screenshot with the pin at the correct location). The globe is giving the same coordinate position as it gave me with the real world coordinates. So I don't think it's the scale that's causing the problem.

You can replicate this by:
1. Open Example #9 (Slippy Map)
2. Select the earth and set position and rotation vectors to 0,0,0
3. Hit Play
4. Zoom in pretty far so you can see cities
5. Select the Earth
6. Press the "Open Calculator" on the earth component
7. Type in "Convert From:" 41.403545, 2.174409
8. Change convert to: Sphere Coordinates
9. Hit Convert
10. Verify the spherical coordinates match the same as the real real scale coordinate readout (which makes sense because it's a trig calculation)
11. Hit the "Locate" button
12. Check the center of the screen is not at the correct coordinate

It looks like the latitudinal scaling of the OSM tiles isn't quite right.
Posted by: Kronnect
« on: February 26, 2020, 12:09:39 PM »


It might be a floating point issue. Generally, it's not recommended to use positions greater than 300.000, to avoid rounding errors in calculations. Could you try using a small scale?

You could also use the Conversion static class which is more convenient.


Posted by: MR
« on: February 26, 2020, 07:56:05 AM »


I am attempting to place icons on my huge globe (scale of (12756274, 12756274, 12756274)) for significant landmarks around the world and I found that the coordinates transformed by the calculator don't seem to line up with the position of the feature in OSM.
For example:

Basilica La Sagrada Familia in Barcelona, Spain
Latitude: 41.403545
Longitude: 2.174409

The calculator converts this to a spherical coordinate of:
x: -0.02845875
y: 0.6613583
z: 0.7495301

Multiplied by the earth radius (half the scale of my globe) of 6378137:
x: -181513.80634875
y: 4218233.8434871
z: 4780605.6634237

I attached an image showing a cube I located at the above coordinates with "Plotted Location" next to it. I indicated the actual approximate location of the Basilica with a red dot. I also tried several other landmarks and they seem to be alright on the longitudinal axis but the latitudinal axis appears to be slightly off.

I am using the Beta version V13.4 B7

Am I doing this right? or is there a more accurate way to calculate the position?