Alexanrus Posted May 24, 2019 Share Posted May 24, 2019 Hi guys I can't understood how does work a vex anoise. Is it a bug or my mistake. At the picture a simple code with result. Noise added just to first component of the vector. Usually Im work in vop but sometimes need write in vex and there another result https://imgur.com/YU2stZN Quote Link to comment Share on other sites More sharing options...
kleer001 Posted May 24, 2019 Share Posted May 24, 2019 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 2 Quote Link to comment Share on other sites More sharing options...
Alexanrus Posted May 24, 2019 Author Share Posted May 24, 2019 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 Quote Link to comment Share on other sites More sharing options...
acey195 Posted June 4, 2019 Share Posted June 4, 2019 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.