Jump to content

Learning challenge Vex


girtab

Recommended Posts

Hi all,

I started to learn Vex, But I think it's better for me if I have some exercises.
I mean like on this topic : 

It can be very cool to do this method for vex too, like this everybody can participate and learn.
Of course each day the exercise need to be a little more complex.

Thanks and I hope you will like the idea.
 

  • Like 1
Link to comment
Share on other sites

Learning ramps is nice too. The fit function will map a value within a known range into another value, in this case zero to @life. I often map particle @age over @life into the 0-1 range. You can then use this 0-1 as a lookup index into a ramp. This lets you shape a particle radius over time as it ages. Often it is just a couple lines of code.

You don't have to map to @pscale. You could also map to @Alpha and have the ramp affect opacity as well.

Untitled-1.jpg

Edited by Atom
Link to comment
Share on other sites

Hmm...you do realize that fit01 expects the first value to be in the range of 0-1. @age does not fit that criteria, neither does @ptnum. However, fit allows you to remap a known range into a 0-1 range. Because 0 and @life are the known range that @age can occupy.

float my_value = fit(@age,0,@life,0,1);

The rand() function is a great companion of fit01 because it always returns a value in the range of 0-1. You may often see something like this. Get a unique random number for each point.

float min = 0;
float max = 1.0;
float my_fit_rnd_value = fit01(rand(@ptnum),min,max);

 

Edited by Atom
Link to comment
Share on other sites

@nage is a built-in bind that automatically returns (@age/@life), or the equivalent of the my_value float Atom posted above.

that said, setting @age = @ptnum is almost certainly not what you actually want to do... overwriting @age is going to get you some pretty weird results in most scenarios.

Link to comment
Share on other sites

Thanks for these informations, tomorrow I will try without @age, I have a question, I,m trying to do a rope.

So I did a line, resample, polyframe with tangentu and tangentv

 

my question is what is the best way to achieve this  ?

Sans titre.png

Link to comment
Share on other sites

thank you Kiryha, today I finish the exercice with the normal I will send tomorrow what I wrote on the wrangle.

I do the vop challenge too, for that , after I will try to convert vop node into vex and vex into vop, if you have some exercice in vop to give me, you can :)

the principe of this topic is to practice and practice a lot 

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