how to get the normal of a point via VOP SOP?
9820 3 1- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
Hi,
I want to get the normal vector of a point and assign it to each of a group of points using VOP SOP.
However, it doesn't work…
I'm not sure if I use the “get attribute” node and “op:`opinputpath(”.“,2)`” code correctly inside the VOP SOP.
in the hip file attached, the normal of the “centroid” point is (0, 1, 0) and I want to assign it as a point vector attrib “eye_norm” to every points on sphere.
can anybody kindly help to suggest a solution?
Thanks!
I want to get the normal vector of a point and assign it to each of a group of points using VOP SOP.
However, it doesn't work…
I'm not sure if I use the “get attribute” node and “op:`opinputpath(”.“,2)`” code correctly inside the VOP SOP.
in the hip file attached, the normal of the “centroid” point is (0, 1, 0) and I want to assign it as a point vector attrib “eye_norm” to every points on sphere.
can anybody kindly help to suggest a solution?
Thanks!
- VisualCortexLab
- Member
- 509 posts
- Joined: July 2005
- Offline
Hey,
if I got your problem right here's a solution:
try using a “import attribute VOP” instead .. change attrib to N .. input to “1” and add a parameter (or constant really) set to “0” (point number 0 from second input) …
if you connect the output of such node to “N” global output you'd see the result you're looking for.
cheers!
if I got your problem right here's a solution:
try using a “import attribute VOP” instead .. change attrib to N .. input to “1” and add a parameter (or constant really) set to “0” (point number 0 from second input) …
if you connect the output of such node to “N” global output you'd see the result you're looking for.
cheers!
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
VisualCortexLab Ltd :: www.visualcortexlab.com
- Fabian
- Member
- 127 posts
- Joined: July 2005
- Offline
- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
Fabian
I think the mistake is that it should be “op:`opinputpath(”.“,1)`” input counting starts at 0. Although Jean-Claude is right and it's easier to do it his way.
Best regards,
Fabian
yes, Fabian, I also found this mistake and i've already correct accordingly.
r u the Fabian in NUS? hehe
anyway, thanks a lot!
-
- Quick Links