Hi all it’s any way to do a Spherical way with the terrain engine of JMonkey?
thanks in advance!
I’m not using TerraMonkey, but I did this:
That is veerry cool! i taking another approach let me explain…
- i got my own sphere geometry.
- i got the dataArray with the hight took from a grayscale map
- i need to use the 2) in 1) to set the hight of each point, so here is my cuestion i don´t know how to map my grayscale data into the spehere coordinate, any clue?
thanks in advance!
Get a formualt to calculate the outer shell of your sphere,
eg center + (direction to outside*radius)
then you have a normal (the direction) and your sphere surface position.
Sample the hieghmap at that position and move the vertex from that position by the color value in the direction outside.
I implemented this approach also in an earlier attempt: Simple Planet Generator
Problem with this approach is you get distortion at the poles. Also if you want to implement large bodies with LOD it’s more complicated.
Not knowing your use case though, this might be fine.
Note: if your sphere is a projected+subdivided cube then you spread any distortion over 6 points instead of two and it might be acceptable. Also, the distortion will be limited because only three quads are coming together instead of all strips.