Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Videos

Downloads

  • For_Loop_Lissajous.zip

Missing 1 full-res photo, 1 file, as this post has not yet been imported.

Content

Suppose you want to calculate a point's position over and over again - but writing down hundreds and hundreds of lines of the same code? Seems a bit tedious. Fear not - the mighty for-loop is your friend for exactly this situation.

In this tutorial we'll go over the basics of using for-loops to create a three dimensional version of an old-school (analog) CG trick: Lissajous Curves.

For texturing we used Cornelius Dämmrich's awesome free textures. Have a look at his freebies here: https://zomax.net/free-stuff/

Files

Previews only

VEX 101 pt. 10: For Loops & Lissajous Curves

Comments

Balthazar Sahel

french listener here : it's pronounced"Lee-ssa-joo" ;)

Wirginia Romanowska

I would like to add and change some other point attributes, that would depend on the "angle" variable from the wrangle. I thought I would change @Cd and @width for the carve sop to use. Tried few things here and there, but didn't have much luck with this idea, could you point me in the right direction?

entagma

Hi Wirginia, the simplest thing you could do is just create and set those attribs on your newly created points - for example here's a greyscale color ramp along your curve (put this at the end of the for-loop): vector color = set(angle/maxiter, angle/maxiter, angle/maxiter); setpointattrib(0, "Cd", newpt, color); Cheers, Mo

Wirginia Romanowska

setpointattrib is the thing - have had no idea - now I can do anything, thanks a ton!

Florian

Lissajous figures, pretty close to the french pronunciation Mo, think if 'Lissajoos' like in 'kangaroo' for the 'ou' sound :) nice one.

Nick Nick

Entagma the best!!!!!!!

André Gama

Thanks guys I finally get out of the shadows and I begin to understand VEX I still do not think through him But I know where it's going Let's keep going!

Ahmet Barak

Hey Entagma thank you for the amazing tutorials you make, I'm currently having an issue however where my point is not appearing it's weird I'm typing the vex code exactly as you are. I'm using Houdini 17,0 so not sure if this would be the cause of the issue, but all help is appreciated.

entagma

Hi Ahmet, hm, that's kind of hard to diagnose without seeing a scene file. Have you tried downloading the provided scene file and checked against this? That usually sorts out most questions very quickly :) Cheers, Mo

Vid Kavšek

Hey, I'm wondering how did you achieve the geo to be wider in the middle and thinner on the ends and the twisting effect that can be seen in your render. Thanks

entagma

Hi Vid, used a resample-SOP to give the polyline a curveu-attribute. This goes from 0 at the line's first point to 1 at the line's last point. Then used a pointwrangle (pointVOP works as well) to remap that into a pscale/width attribute. However nowadays you could do the exact same thing using a Sweep-SOP. Lissajous' polyline goes into the left input, a circle (set to polygon) goes into the right one. Cheers, Mo

andrew farhall

I think I've missed something along the way but what is the difference between vector pos = set(0,0,0); and vector pos = {0,0,0};