animquer
animquer
About Me
Connect
LOCATION
Not Specified
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
How to make a group based on camera view? Dec. 15, 2024, 5:33 p.m.
It was a viewport issue in part. The selection works, but with my camera it keeps selecting as if the camera is 90 degree rotated. I am trying to debug.
I got it, its because there is a transform in the obj level on the geometry, and a different transform on the camera. This is just how I imported my geometry from fbx. But how to I get rid of those transforms. I think only the rotation is the problem.
I got it, its because there is a transform in the obj level on the geometry, and a different transform on the camera. This is just how I imported my geometry from fbx. But how to I get rid of those transforms. I think only the rotation is the problem.
How to make a group based on camera view? Dec. 15, 2024, 4:35 p.m.
Konstantin Magnus
Hi animquer,
the VEX function toNDC() creates normal device coordinates, X and Y between 0.0 and 1.0 will be inside the frustum:string cam = chs('camera'); vector ndc = toNDC(cam, v@P); int in_frustum = ndc[0]>=0.0 && ndc[0]<=1.0 && ndc[1]>=0.0 && ndc[1]<=1.0;
To check for visibility, shoot rays from each mesh point towards the camera position:if(in_frustum){ matrix xform_cam = optransform(cam); vector pos_cam = cracktransform(0,0,0,0,0, xform_cam); vector dir_cam = pos_cam - v@P; vector pos_ray = v@P + normalize(dir_cam) * 1e-3; int pr_hit = intersect(0, pos_ray, dir_cam, set(0), set(0)); i@group_visible = pr_hit < 0; }
It doesn't quite work, I get random selections from it. It does respect the frustum, but something happens with a selection only one side of the model, also it depends on how close the camera is, some points just disappear from the selection.
This is a view from the camera. In my scene one side -Z of the object simply doesn't work it works in your scene. But also in your scene it also falls apart if you zoom move the camera out. I have no idea what is happening. Something with ray casting?
How to make a group based on camera view? Dec. 14, 2024, 3:57 p.m.
Does anyone know how to make a group based on camera view in Houdini? I found the way to select everything in camera frustum, but that's not what I want, I want to exclude the occluded geometry. There is a maskbyfeature sop that can use a light source with shadowing but if give it camera as input it doesn't have a proper direction and FOV of the camera. Sounds so simple yet I can't find anything reliable way to do it.
Does anyone know?
Does anyone know?