XaiJu
entagma
entagma

patreon


VEX101 - For Loops

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/

VEX101 - For Loops

Comments

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};

andrew farhall

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

Entagma

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

Vid Kavšek

wtf this is so awesome

Christopher Rutledge

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

Entagma

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.

Ahmet Barak

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!

André Gama

Entagma the best!!!!!!!

Nick Nick

You've been heard :)

Entagma

I need arrays!

Ezequiel Grand

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

Florian

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

Wirginia Romanowska

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

Entagma

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?

Wirginia Romanowska

Thanks man! And sorry for my French :) Cheers, Mo

Entagma

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

Balthazar Sahel


More Creators