V4 Orient INSTANCES problem
3153 5 2- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
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);
/////////////////////////////////////////////////////////////////////////
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);
/////////////////////////////////////////////////////////////////////////
Edited by bhb - July 3, 2020 11:15:28
- jsmack
- Member
- 7762 posts
- Joined: Sept. 2011
- Online
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- toadstorm
- Member
- 359 posts
- Joined: April 2017
- Offline
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.
Attaching an example file.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
- bhb
- Member
- 67 posts
- Joined: April 2017
- Offline
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.
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.
-
- Quick Links