PDA

View Full Version : Determine real world (GPS) location from API World Space



FSLAutoIoT
14-09-2015, 11:57
Hello,

I'm using the PCars API and trying to overlay my current track position (using mWorldPosition) onto a real world map (e.g. google maps). I notice something similar has been attempted here:

http://forum.projectcarsgame.com/showthread.php?26520-Dedicated-Server-API&p=1040033#post1040033

What I'm struggling to understand is the units or real world orientation the mWorldPosition (i.e. XYZ World Space) data is giving me. I took some data from a lap of the Silverstone GP course and made a scatter plot of the XY data, but doesn't look a similar shape to what I'd expect the track outline to be (from google maps). I'm making the assumption that X & Y = lat & lng (or vice-versa) & Z = altitude, is this valid? Could anyone offer advice on translating the World Position to real world lat/lng co-ords?

Thanks.

mr_belowski
14-09-2015, 18:08
I had a fiddle when building the spotter for my app, and I think the y axis is up/down. You want x and z (position 0 and 2 in the float array).

I don't know what / where the origin is but the coordinates appear to be Cartesian and in metres

FSLAutoIoT
14-09-2015, 18:51
I had a fiddle when building the spotter for my app, and I think the y axis is up/down. You want x and z (position 0 and 2 in the float array).

I don't know what / where the origin is but the coordinates appear to be Cartesian and in metres

Yes, thanks, I've just managed to plot the data I had into a 3d scatter plot & it became obvious that the Y-axis is altitude. See the 3D scatter plot here: http://jsfiddle.net/Lcw0p2ro/

I've tried on a few tracks now and the X/Z-axis do relate to the Cartesian coordinates. Just need to work out how to offset from a know GPS point for the track.

M. -VIPER- Morgan
16-09-2015, 11:27
http://forum.projectcarsgame.com/showthread.php?39269-Provide-GPS-coordinates-of-all-track-reference-points-GPS-calculation-in-javascript