Outerra forum

Outerra Engine => Technology => Topic started by: geonemo on August 01, 2014, 09:22:33 am

Title: planet partionning + vector data
Post by: geonemo on August 01, 2014, 09:22:33 am
I am refactoring a simplified planetary engine, and I would like the partition system to be compatible with the one in Outerra, for a mutually beneficial result. I originally used lat/long with OSM bitmap tiles. But this time, I am using OSM vector data. The goal is to store one binary file every 4 levels in exact alignment with your cube partitioning.

I understand you are normalizing vector(u,v,+-k) on the 6 faces of a cube, with k=1+0.2071067812(1-u2)(1-v2).

I am having a hard time mapping vector data on the cube though. The way I see it, I have to transform lat/long data into x,y,z on the sphere, then apply a Newton solver to transform x,y,z back to uv, which invariably has a negative effect on my mood ;-)

Would you do it that way, and if so, would you consider sharing the algo you use to reverse x,y,z back to u,v? In another thread, you are suggesting a look into a javascript file called cubeface.js but the link is broken.

Thanks in advance.
Title: Re: planet partionning
Post by: cameni on August 01, 2014, 11:49:14 am
You are going good :)

We have got a Newton solver there as well. I once saw someone noting that it should be solvable, but so far all attempts turned out to be more complex than the Newton, of which there are usually just a few steps needed. So I have made peace with it in the end ...