Hi,
I've set a cam to use a path object. The initial transform of the cam is tx/y/z=0, as the position in space is determined by the path object.
I want to calculate the distance of the cam to the lookat object, basically to set focus distance to this value.
How do I get the actual position of the cam (transformed to the path)?
Thanks for any help!
Regards,
Carsten
Cam with path object - get position
7646 6 1- carstenw
- Member
- 30 posts
- Joined: Aug. 2010
- Offline
- carstenw
- Member
- 30 posts
- Joined: Aug. 2010
- Offline
I've managed to get the distance via the expression
sqrt(dot(vtorigin(“/obj/cam_lookat”,“/obj/cam1”),vtorigin(“/obj/cam_lookat”,“/obj/cam1”)))
However, if I use this for focus distance, it works only after editing the expression. If I switch to another frame, the cam shows “infinite recursion” error.
How can I avoid that?
Regards,
Carsten
sqrt(dot(vtorigin(“/obj/cam_lookat”,“/obj/cam1”),vtorigin(“/obj/cam_lookat”,“/obj/cam1”)))
However, if I use this for focus distance, it works only after editing the expression. If I switch to another frame, the cam shows “infinite recursion” error.
How can I avoid that?
Regards,
Carsten
- rmagee
- Staff
- 1182 posts
- Joined: July 2005
- Offline
Did you try the camera's focus handle? You can RMB-click on the camera's handle (when the Handle tool is active) and select Focus Handle. This gives you a handle for positioning the Focus Distance using the little cube and the F-Stop using the arrows.
You can then set keyframes on the parameters as needed.
You can then set keyframes on the parameters as needed.
Robert Magee
Senior Product Marketing Manager
SideFX
Senior Product Marketing Manager
SideFX
- brianBurke
- Member
- 192 posts
- Joined: Nov. 2008
- Offline
You can use the Object CHOP to return the distance between your target null or object and the camera. If you set the CHOP's Channel Range to Use Current Frame it will only cook one frame at a time like an expression. You can pull this value using the chop() expression or push it to your output parm with Export.
Good luck dude!
edit: added an example
Good luck dude!
edit: added an example
- carstenw
- Member
- 30 posts
- Joined: Aug. 2010
- Offline
rmagee
Did you try the camera's focus handle? You can RMB-click on the camera's handle (when the Handle tool is active) and select Focus Handle. This gives you a handle for positioning the Focus Distance using the little cube and the F-Stop using the arrows.
You can then set keyframes on the parameters as needed.
Yep, I already tried that, but why do it manually ;-)
Regards,
Carsten
- carstenw
- Member
- 30 posts
- Joined: Aug. 2010
- Offline
brianBurke
You can use the Object CHOP to return the distance between your target null or object and the camera. If you set the CHOP's Channel Range to Use Current Frame it will only cook one frame at a time like an expression. You can pull this value using the chop() expression or push it to your output parm with Export.
Good luck dude!
edit: added an example
Thanks a lot! Works perfectly.
Regards,
Carsten
- CiaranM
- Member
- 31 posts
- Joined: June 2009
- Offline
-
- Quick Links