Controller to keep camera at 1.6m above objects

Hi,

I can move camera above picked objects, but I would like to make a controller for CAMERA z position so I could move camera with my 3D connexion and keep my camera 1.6 meter above the ground, stairs, slopes,...

I can't manage to translate this to a controller :
int_point = find_intersection target_mesh CAMERA
if int_point != undefined then CAMERA.pos = int_point.pos + [0,0,1.6]

It would be sooo cool ! :-)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jahman's picture

.

find any example of intersectRayScene usage.
It might be slow if your scene contains a lot of objects, but it suits your task better than anything else

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.