Jump to content

Vex anoise


Alexanrus

Recommended Posts

That looks like it should work. But... I find VEX a little tricky with multiplying vectors by floats. It doesn't like to do that right after a function. I suggest assigning the noise to the variable and then in another line multiplying the vector by your float amp. Like:

float amp = 4;
vector noise1 = anoise(v@P);
noise1 *= amp

 

  • Like 2
Link to comment
Share on other sites

57 minutes ago, kleer001 said:

That looks like it should work. But... I find VEX a little tricky with multiplying vectors by floats. It doesn't like to do that right after a function. I suggest assigning the noise to the variable and then in another line multiplying the vector by your float amp. Like:


float amp = 4;
vector noise1 = anoise(v@P);
noise1 *= amp

Thanks it's working

 

Link to comment
Share on other sites

  • 2 weeks later...

when you have vex functions that can output different types, its always a good idea to cast them directly

for example, if you want a random greyscale color, based on the position:

v@Cd = float(rand(v@P)); // this will cast it back to a vector in the end, with the same value for all components.

v@Cd = rand(v@P); // this will cast it back to a vector in the end, but with different values for the components.

 

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