sorry, didnt seen your question earlier.
LIKE MENTIONED ABOVE FOR PLOTTER USE PHYSICS (image 2)
(you can also just use bounding boxes, but it will not be precise)
For example for planet( if you dont use planet, but flat terrain, you can skip first step and just use getHeight instead of RayCast):
I just mean you should use Math:
- over sphere (you can calculate sphere points using just math) spawn your objects.
(add some margin so sphere is bigger than planet)
- ofc use some physics based plotter so this objects do not overlap
- when all objects will be placed on math calculated sphere spawning
then each of them Raycast(use ray in physics or just on mesh) from spawn point of object to center of planet and then you will know exact point and normal direction, so you can fix each object position to be exactly on planet. Normal direction you can use for rotations if you need.
Here is my general idea:
and physics based plotter behaviour when 2 of SPAWN POINTS collide:
After objects are placed on terrain surface, you can AGAIN use physics to fix positions
(or if your objects gonna have origin point as “terrain contact point” then you dont even need, you would only need it if your objects(models) origin point is center of mass, then physics need calculate how offset them from planet surface)