How to: Camera Look At Primitive in Solaris?

   1437   3   0
User Avatar
Member
10 posts
Joined: Dec. 2021
Offline
I’m trying to aim a camera (Solaris level) at a point.
Here’s what I’ve done:

Imported the point from the geometry level via SOP Import.
Used the "Look At Primitive" parameter on the camera and set it to /sopimport1/points_0.
However, the camera doesn’t aim at the point as expected.

I’ve attached a HIPNC file for reference.
Any help would be greatly appreciated—Merry Christmas!
Best,
Nils

Houdini Apprentice Non-Commercial 20.5.420
Edited by Herr_Dienstantritt - Dec. 25, 2024 06:21:22

Attachments:
lookat.hipnc (166.3 KB)
look at.jpg (232.4 KB)

User Avatar
Member
1820 posts
Joined: March 2009
Offline
There are probably many ways to do this, here's one:

Stick your point position into a detail attribute (in SOPs), that automatically ends up in a primvar after the sopcreate.
Then add an Xform, and after that you put the previously stored primvar onto the xform as a translation.

Then you point the camera's look-at to the xform, and not the primitive where the position came from.

You also may want to cache this, which I have not done in this example (see attached).

Attachments:
cam_lookat.hip (311.3 KB)

Martin Winkler
money man at Alarmstart Germany
User Avatar
Member
10 posts
Joined: Dec. 2021
Offline
Thank you for your example - it works!

Best regards,
Nils
Edited by Herr_Dienstantritt - Dec. 26, 2024 06:40:50
User Avatar
Member
10 posts
Joined: Dec. 2021
Offline
I’d like to quickly sum up my thoughts here to make sure I’ve understood the overarching principles correctly:

I find the documentation for the Camera LOP somewhat confusing, particularly regarding the “Look At Primitive” parameter. It states: “The path to a USD prim this object should look at.” Without additional information or examples, one might assume that it’s sufficient to provide the path to any USD prim.

However, USD prims brought in via SOP Create or SOP Import store geometry information, such as point positions. Intuitively, I assumed that it would be possible to access this directly, but this doesn’t seem to be the case. It appears that the USD prim must first have a transformation (such as a translation) applied to it for the camera to align properly.

The concepts I’m discussing here are based on my assumptions. It seems to me that this behavior might be rooted in the idea that LOPs, with their address-based approach, strictly separate geometry from transformations.

I’d appreciate it if other forum participants could share their thoughts or experiences on this. This would be very helpful for me and perhaps for others who have similar questions.

Greetings
Nils
  • Quick Links