Jump to content

Resample in VEX? (imitate Resample SOP | resample vector array)


Krion

Recommended Posts

Hi guys!

Is it possible to have imitate the Resample SOP in VEX?
I basically want to do the last step of this tutorial (see 07:20) entirely in VEX, so that it generates the array of proper vector positions from the 5 'control point' vectors.

(so I could potentially make a polyline from there as well with addpoint and addprim then if I wanted to)

Thanks in advance

 

Edited by Krion
Link to comment
Share on other sites

v[]@pos;                                        

vector posStart = point(1,"P",0);               
append(v[]@pos,posStart);                       

for(int i = 16; i < npoints(1)-16; i++){      
    vector tempP = point(1,"P",i);                 
    append(v[]@pos,tempP);                      
}                                              

vector posEnd = point(1,"P",npoints(1)-1);     
append(v[]@pos,posEnd);                        


//create spline                                                       

int its = chi("iterations");                                         

for(int i = 0; i <= its; i++){                                       
    vector tempP = spline("linear",(float)i/(float)its,v[]@pos);        
    int newPt = addpoint(0,tempP);  
}                                    
int val = 20;

for (int i = 0; i<= val; i++){
        vector temP = spline('linear',(float)i/(float)val,{0,0,0},{0,0,5},{0,0,10});
        int newPt = addpoint(0,temP);
}

+ you have here FeELib-for-Houdini just search on Google (something Like Q-lib for Houdini endless ex and Files


 

res.jpg

Edited by Librarian
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...