Jump to content
Sign in to follow this  

Trunc function- vex

Recommended Posts


I am going through "The Joy of Vex" tutorials and I came across a problem. I am on Day 8 where he is talking about noises. http://www.tokeru.com/cgwiki/index.php?title=JoyOfVex8

I am on the last part where he gives the exercises but I can't get it to do what he is explaining.

Basically I am trying to make some blocky noise with a custom slider using the Trunc function as he states:

Can you make stepped noise? Blocky noise? Hint: When we did quantising in an earlier lesson we took our distance 'd' and trunc'd it to reduce its precision. Here, you'd want to copy @P to a temp vector pos, quantise it, and feed that result to noise (see gif below)

 I get really close but I don't know how he is controlling it with a slider. My noise looks very faded and disapears after a certain value.

I am just trying to ahieve the same effect in the gif 

I will attach my scene for anyone that wants to take a look

Thank you



Share this post

Link to post
Share on other sites

Keep working at it. You'll get it.

Problems like these are work for the student to prove they've learned the material.

I spent a few minutes and think I got it, but I've got a dozen years plus of experience messing with these kind of things.

Also, you'll want to never have an integer multiply a vector assignment, there on the right side of the equation. It will turn your vector into a float. Also you want to declare your attributes with f,v,i,s for float, vector, integer, and string respectively.

//should be
v@Cd = noise(posQ*chf("freq"));
v@Cd *= 2;

Do please spend at least another day or so at it before checking my hint below if you really really can't get it.

Try quantizing a transformation of your v@P before trunc, then transform back.


  • Like 1

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
Sign in to follow this