Jump to content
girtab

Learning challenge Vex

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

Share this post


Link to post
Share on other sites

ah why not :) 

So here is the first exercise before it gets to complex hehe.

VEX Sinus Wave

image.thumb.png.87d6fa0029e8818a027f47a3809c6552.png

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Here is a similar setup using a line.

Untitled-1.jpg

  • Like 1

Share this post


Link to post
Share on other sites

I did the rotation in an other wangle with that :

@age = @ptnum;
@P.y = fit01(@age, 0.1, 1)+@age/ch("heigth");

 

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

yep, I’m trying to do a rope only in vex, by this I mean the rope, I’m a little bit lost about how twist the vector to creat the rope

Share this post


Link to post
Share on other sites

I just finish it, it was very complicate to understand everything with array ect..

So for today if someone have an exercise to propose :)

Share this post


Link to post
Share on other sites

You did not finish the circle yet :P And you can go further and make a helix and a spiral.

Share this post


Link to post
Share on other sites

One thing that may be useful when learning VEX is to do the same exercise in VOP also. I think this will give deeper and solid understanding of basics by looking at the same procedures from the different angles.

Share this post


Link to post
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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×