'Rotate cone to align with sphere normal?
Hello I am trying to create floating islands on planets, but I need to rotate the floating island so it looks correct, this is how it looks currently [![World Up][1]][1][![][2]][2][![World Left][3]][3] As you can hopefully see, the cones don't align with the surface as the surface curves away from facing the world up direction
I am creating a density volume with SDFs and using marching cubes to generate the mesh. Here is the SDF code :
float sdCone(float3 p)
{
p -= column * v[0].island;
float2 c = float2(0.5, 0.5);
float h = 0.45;
float q = length(p.xz);
return v[0].islandR - max(dot(c.xy, float2(q, -p.y)), h + p.y);
}
So how can I rotate the cones to the correct orientation? [1]: https://i.stack.imgur.com/dVISH.png [2]: https://i.stack.imgur.com/2LcK1.png [3]: https://i.stack.imgur.com/6xzA0.png
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
