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

• 1

##### Share on other sites

ah why not

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

VEX Sinus Wave

• 1

##### Share on other sites

Thanks Jon3de for the first exercise !

##### Share on other sites

I finish it !
If you have a new one ?

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

Edited by Atom

##### Share on other sites

Here is a similar setup using a line.

• 1

##### Share on other sites

Thank Atom I will study the ramp

##### Share on other sites

How about... a circle? You can do a spiral if it's too easy!

• 2

##### Share on other sites

Hey kiryha thx for your participation and for my first exercise of the week !

##### 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 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 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 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  ?

##### Share on other sites

By "this" you mean UP and Normal vectors?

##### 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 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 on other sites

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

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

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