is it possible to find the distance between my camera and an object in Houdini ?
thanks,
bern
edward
Feb. 22, 2007 18:00:02
untested example expression: vlength(vtorigin(“/obj/geo1”, “/obj/cam1”))
malexander
Feb. 22, 2007 18:08:49
You can also use an Object CHOP, if expressions aren't your thing.
Andy_23
June 2, 2022 09:08:58
Hi, how would I do this in Solaris?
Thank you โ any help is much appreciated.
No_ha
June 3, 2022 01:54:08
I created myself an HDA that calculates the distance between the camera and a Sphere primitive and then sets the focus distance on the camera. In my case I did it through an attribute wrangle. You can read the World transform of the camera and the object you want and then use the cracktransform function to get only the position vector of the two. Then you calculate the distance.
Iโm not in front of my computer right now so I canโt copy the code. Let me know if this is what you need and canโt figure it out.
I certainly have never any clue on how the cracktransform function works. I just copied it once from another example. So if somebody in the meantime wants to explain the syntax behind that I would be very grateful ๐
WowNems
Oct. 2, 2022 05:04:55
Hi any clue about this expression in SOlaris? vlength(vtorigin(โ/obj/geo1โ, โ/obj/cam1โ))
Thank you
eikonoklastes
Oct. 3, 2022 14:54:27
Why this isn't built into Houdini as a default feature is entirely beyond me. It should have been there in /obj, and it definitely should have been there in Solaris at launch, given that it is supposedly a lookdev environment. Hey SideFX, having a focus target is kinda important in lookdev, especially when you're animating. Please add one.
I have attached a scene that uses a simple Python script to do this. I have set it up so that you can drag the focus object LOP directly into a parameter on the camera. You can save the setup as a shelf tool for easy access.
Demo of it in action:
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.