Search - User list
Full Version: V4 Orient INSTANCES problem
Root » Technical Discussion » V4 Orient INSTANCES problem
bhb
Need help to work with v4 orient values.
I undestand the N normal directions , but dont understand how to control the orient values.
I need this to place INSTANCES on those points with the v4 orient values on them.

In the example image atached:
1. The original object mesh.
2. The INSTANCED objects as I want.(a simple extrude for demostration pourpose)
3. The problem i have. The instanced objects are “steped” (marked in red). I want them maintaining the face direction (marked in green in pic2.)

Any help please, atach example file. Thanks

// set_prim_orient //////////////////////////////////////////////////////
vector up = {0,1,0};
vector nN = normalize(v@N);
matrix3 localrot = matrix3(maketransform(0, 0, {0,0,0}, {90, 0, 0}, {1,1,1}));
matrix3 rot = maketransform(nN, up);
p@orient = quaternion(localrot*rot);
/////////////////////////////////////////////////////////////////////////
jsmack
They're lined up with ‘up’ because the y axis was used as the up vector. Use the local y axis of the target shape to get the local up vector, although that isn't necessarily trivial.
bhb
The problem is that target shape is not always to be perfect. Sometimes could be deformed.
The “copy-instances-to-prims” must be based on prims, not the object itself.
toadstorm
Like jsmack said, figuring out the orientation here isn't very straightforward. If your topology is very consistent, like that ring-like geometry you posted, then it can be done without too much effort, but it still takes a bit of work. Essentially, you split up all of the primitives and for each one, you store the primitive normal as N, and you figure out an up vector by averaging the vectors that represent both of the long edges. Then you create a point at the center of each primitive and transfer that N and up to the point, and finally you copy your objects to those points.

Attaching an example file.
bhb
Yeah! Thats it.

I finally solved in the last week using “carves” in a bungler way.
But I think your solution is more clear.

I attach here an screen capture if anybody need it.
bhb
Sorry toadstorm,
outside the INSTANCE node works fine (using copy_to_points), but for some reason, your solution dont work with INSTANCES. (HOUDINI 17.5.543)
https://www.sidefx.com/docs/houdini/nodes/obj/instance.html [www.sidefx.com]

I dont know its a bug or I made something wrong. I have the INSTANCE node option:
Point instancig: Full Point instancing
… and again the instances are showing stepped.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB