Notifications
Clear all

[Closed] Set Position with Script Controller and LOCAL axis

Hi,

to render a zDepth map and provide visual feedback for the focus region, i linked some values with wired parameters and it works fine.

But I want to show the focus start and end with a plane. So I took a plane, matched it to the camera position and added the axis value for the near distance.

All works fine in the script controller but… the plane has to move in local axis and it is always moving in gimbal/world/whatever axis.

I know that you normally use “in coordsys Local” to move in local axis but I have no idea how to apply that in the script expression.

Here is an image to illustrate the whole scenario:

I assume it is just a question of the correct syntax but I have no clue. Just putting “in coordsys local” in front of all or just the value behind the plus(+) does not help.

Regards,
marcus

3 Replies

Hi Marcus,
try this:

camera.pos - ([0,50,0] * (camera.transform.rotationPart))

where [0,50,0] is the shift from camera (shouldn't it be in Z? like [0,0,50])

You may want to put an Orientation Constraint to Plane to make it stay perpendicular to the camera axis.

  • Enrico

there is also the option of linking the plane to the camera, and it will inherit its transform.
then, just wire the axis of the plane with the parameter of the camara(ie:near range). you can use wires or and instanced controller(no maxscript)

Thanks a lot! I tried both suggestions and both are working