pcopen - dot product not working

   1710   2   1
User Avatar
Member
102 posts
Joined: 5月 2013
オンライン
I'm having a problem using the vex version of pcopen to only queue up points with their normal within a set cone radius around my search point normal. I'm certain I've used this before but I can't get it to work. I've even copied the example code straight out of the docs and it doesn't work either :

int handle = pcopen("test.pc", "P", P, "N", N, 1e6, 100, "ndot", 0.8);

I did edit "test.pc" to be an op input and I edited P and N to be @P and @N . The fact that it's using a string though makes me think maybe it's shader only but it works in a VOP. Confusing...
User Avatar
Member
5130 posts
Joined: 2月 2012
オフライン
Hi,

It's working here:



float angle = ch("angle");

vector p = point ( 1, "P", 0 );
vector n = point ( 1, "N", 0 );

@angle = dot ( @N, n );

int pt = -1;
int handle = pcopen ( @OpInput2, "P", @P, "N", @N, 1, 1, "ndot", angle );
while ( pciterate ( handle ) )
{
    pcimport ( handle, "point.number", pt );
    if ( pt != -1 )
        i@group_pts = 1;
}
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
102 posts
Joined: 5月 2013
オンライン
Ok thanks very much for verifying, I'll have a look again in the morning, I was probably missing something obvious.
  • Quick Links