🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Stuck at coordinate system

Started by
3 comments, last by _WeirdCat_ 4 years, 9 months ago

So i am trying to draw some waypoints on earth - each waypoint is ansphere but thats not the point whenever incrementing x value of the waypoint position waypoint goes left instead of right. This is like i would need to use left haned coords instead of right handed ones

Imagine camera position is at 0,0,0 and its looking toward z+ lets say at 0,0,10

Now im looking at twonspheres one pink at 0.0, 0.0, 0.1 and red at 0.1, 0.0, 0.0

Red should be at right

Anyeay this is the issue that i need different coord system. Well at least i think that will do, but now how do i do that

What would be the easiest solution?

Negating x coord of object doesnt count cause i just described a relative situation which never occurs ( no camera and objects sitting on axis aligned planes)

I would like to leave everything like it is however i can't duento this partucular problem im having.

 

Lets say i have a gps position and a waypoint now whenever i face that waypoint i would like to see it on the screen - its something similar to google ar street view but i somehow cant place objects where they should be

Advertisement

Yes, the simplest would probably be two coordinate systems, a cartesian (x,y,z with the planet's core in the centre) and a geodetic (lat/lon/height, elliptical coordinates) for world positions on the surface. And conversions between them. Converting geodetic to cartesian is less involved, but the other way round involves some scaling.

Since it's impossible to get a sphere surface onto a flat plane without distortion, you have to decide which projection you want. As a starting point for this, https://en.wikipedia.org/wiki/Map_projection seems useful. It also has a lot of names for projection types that you can probably use to find more detailed information.

I'd rather want to change view or projection matrix to compute final output instead of changing coordinates, for now i have a bypass where i changed camera.class that z points at positive z and in vertex shader output of the x component is switched to -x but it just does not seem right

This topic is closed to new replies.

Advertisement