Jump to content

Deforming curve with vex (sin)


ekan de

Recommended Posts

Im trying to deform a curve with vex. I want to deform it with a sin function.

Kinda rookie on vex but i thought this would work. 

I create a curve with just a start and end point.

Resample it to say 50 points.

Add a attributeWrangle and add this vex code: @P.y = sin(@P.y * 500) * 0.1;

I get no errors in the code but i dont get any result at all either.

Anyone got any clue?

I tested alot of different numbers just to make sure it wasnt the size of the sin curve but i get nothing.

Link to comment
Share on other sites

19 minutes ago, ekan de said:

Add a attributeWrangle and add this vex code: @P.y = sin(@P.y * 500) * 0.1;

 

assuming your line is by default in Y direction, straight up...(and why bother with resampling, in Line just say 50 points)

then it would make better sense if you perturb the X direction

@P.x = sin(@P.y * 2) * 0.1;

and 500 in houdini is huge, innit ? ahh, sorry that's freq...doesn't matter..

Still, nothing wrong with you moving in Y direction...now you're just adjusting the point distribution along Y axis that's all..

Edited by Noobini
Link to comment
Share on other sites

Sorry. the curve is in x axis on the grid. i made a typo here on the forum. This is what i write in vex: @P.y = sin(@P.y * 2) * 0.1;

500 was just an example. i have tried everything from 0.1 to much much higher than 500.

Im using H16.0.5.

So it should work?

Took a glance at the link Sepu posted but need a bit more time to dig deeper and read more.

 

curveSine.hipnc

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...