kenjinp / hello-worlds

Virtual javascript worlds at planetary scales for your threejs or react-three-fiber scene 👋🌐
https://worlds.kenny.wtf
137 stars 8 forks source link

[Planets] Offset camera distance to Quadtree / LOD resolver #28

Open kenjinp opened 1 year ago

kenjinp commented 1 year ago

Right now, if you have highly distorted surfaces like a big mountain, the quadtree won't resolve to the highest LOD, because the camera never gets close enough to the surface of the sphere.

kenjinp commented 1 year ago

I've implemented this as a hook/component here: https://github.com/kenjinp/hello-worlds/blob/main/apps/docs/examples/moon/Moon.tsx#L71

Should investigate if this can be generalized and extracted to the library, requires knowing exact planet data height data from height generator function