sessionbeer Posted September 6, 2015 Share Posted September 6, 2015 Hello, I'm trying to get more comfortable with Vex and have hit a hurdle I was hoping someone could help with. For the moment I am trying to convert what is in the Vops network to a point wrangle. I'm struggling with the primuv part of the network (seen below), I believe the prim_attribute in Vex to be the function I need to use, but I don't know where I'm going wrong with it, I've found the documentation a little hard to understand? Any help would be appreciated. float search_rad = 10.0; int max_points = 1; float uu, vv; int primid, succ; int handle = pcopen(0, "P", @P, search_rad, max_points); vector value = pcfilter(handle, "P"); vector diff = @P - value; vector sum = @P + diff; i@prim; v@uv; float dist = xyzdist(1, @P, @prim, @uv); vector hitpoint = {0,0,0}; succ = prim_attribute(1, hitpoint, "P", primid, uu, vv); vector blend = lerp(@P, hitpoint, 0.5); @P = blend; Quote Link to comment Share on other sites More sharing options...
mestela Posted September 6, 2015 Share Posted September 6, 2015 (edited) Primuv works in vex too. Try this instead of your prim_attribute call: vector lookupuv = set(uu,vv); hitpoint = primuv (1,"P", primid, lookupuv); You don't seem to assign a value to 'primid' anywhere though. Did you mean to use @prim instead? Edited September 6, 2015 by mestela Quote Link to comment Share on other sites More sharing options...
anim Posted September 6, 2015 Share Posted September 6, 2015 ... int primid; // you already have this defined, but for completeness vector primuv; xyzdist(1, sum, primid, primuv); //as sum is your lookup position according to screenshot and primid and primuv variables will get sampled data vector hitP = primuv(1, "P", primid, primuv); //then just get "P" from that sample ... Quote Link to comment Share on other sites More sharing options...
sessionbeer Posted September 7, 2015 Author Share Posted September 7, 2015 Thanks a lot Mestela and Tomas. I went with you're code Tomas and it worked out great. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.