Arthur Spooner Posted May 4, 2016 Share Posted May 4, 2016 (edited) @t = @ptnum; f@lop = @t*=6; v@tgh = @P; float noise(@tgh); I'd like to know why the vector @tgh isn't have noise applied ? I know I'm doing something awkward ! Edited May 4, 2016 by Arthur Spooner Quote Link to comment Share on other sites More sharing options...
haggi Posted May 5, 2016 Share Posted May 5, 2016 The noise() function returns a value, it does not modify the argument. So if you want to modify the tgh vector: @tgh = noise(@tgh); Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 5, 2016 Author Share Posted May 5, 2016 4 hours ago, haggi said: The noise() function returns a value, it does not modify the argument. So if you want to modify the tgh vector: @tgh = noise(@tgh); That code didn't work; no noise was applied to the grid ? Quote Link to comment Share on other sites More sharing options...
holycause Posted May 5, 2016 Share Posted May 5, 2016 @tgh is not your position attribute. you gave it the position values but it's not link to your position attribute. you will have to set your new position values @P = noise(@tgh); I know I already told you this, but based on your questions, I highly recommend you to take some introduction courses. It will help you a lot. You can find courses on coursera or any other website https://www.coursera.org/courses/?languages=en&query=introduction%20to%20programming you will see, once you will understand those basic operations, it will make it much easier for you. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 5, 2016 Author Share Posted May 5, 2016 (edited) 3 hours ago, holycause said: I know I already told you this, but based on your questions, I highly recommend you to take some introduction courses. It will help you a lot. You can find courses on coursera or any other website https://www.coursera.org/courses/?languages=en&query=introduction%20to%20programming you will see, once you will understand those basic operations, it will make it much easier for you. I've taken introduction courses, I just have to do a little when time permits until I understand, it will be tedious; unless you know of any courses which can fast track ? Ohh I set the the attribute, then I have to get it and set it on the point position Edited May 5, 2016 by Arthur Spooner Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 5, 2016 Author Share Posted May 5, 2016 float ch("string",@attribute); What am I doing wrong ? Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 5, 2016 Author Share Posted May 5, 2016 (edited) f@apl = ch("noise"); This works, but it doesn't change the noise, the values for @apl change but there all the same value when they change ? I did another code adjustment trying to get it to work; @P.y = ch("noise",noise(@tgh)); In this case, my grid moves but the noise is not applied ? Edited May 6, 2016 by Arthur Spooner Quote Link to comment Share on other sites More sharing options...
haggi Posted May 7, 2016 Share Posted May 7, 2016 I suppose you have a parameter added to the pointwrangle node called "noise" and you want to use it as a multiplier for the general noise? Then you can read the parameter: float noiseMultiplier = ch("noise"); Then you can calculate the noise itself: vector noiseVector = noise(@P); And apply the whole thing to the @P: @P = noiseVector * noiseMultiplier; Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 7, 2016 Author Share Posted May 7, 2016 I want a slider to control the noise, when the slider is at 0, no noise, anything above 0 there is noise ? I set the point position on an vector attribute, then I assigned that attribute to noise() on the position.y that all works successful but what isn't working is applying the noise to a slider or I believe it's called channel ? v@tgh = @P; @P.y = noise(@tgh); @apl = ch("noise"); Quote Link to comment Share on other sites More sharing options...
Atom Posted May 8, 2016 Share Posted May 8, 2016 @apl = ch("noise") Does not really do anything. You're setting an attribute of an unknown type (you really should specify the type) to a channel value. The attribute is just made up. So that's like saying my_gobblygook = a slider. What did you expect the code to do for you? Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 8, 2016 Author Share Posted May 8, 2016 (edited) 2 hours ago, Atom said: @apl = ch("noise") Does not really do anything. You're setting an attribute of an unknown type (you really should specify the type) to a channel value. The attribute is just made up. So that's like saying my_gobblygook = a slider. What did you expect the code to do for you? I know I'm only setting it, I know it's wrong but the only other code method I know is float ch("noise",@apl); that doesn't work either @P.y = noise(ch("noise")); The grid moves, but no noise is applied ? Edited May 8, 2016 by Arthur Spooner Code Quote Link to comment Share on other sites More sharing options...
Atom Posted May 8, 2016 Share Posted May 8, 2016 There is this website called google where you can search for things. I found this link. http://www.sidefx.com/docs/houdini15.0/expressions/ch It clearly shows that the ch function does not accept two parameters. Also you are trying to define it as a float, it is not a variable, it returns values. There are companion functions such as chf (which returns a float) and chs (which returns a string). Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 8, 2016 Author Share Posted May 8, 2016 I made a changes, if that helps in my previous post ? Quote Link to comment Share on other sites More sharing options...
6ril Posted May 8, 2016 Share Posted May 8, 2016 great changes ! Quote Link to comment Share on other sites More sharing options...
6ril Posted May 8, 2016 Share Posted May 8, 2016 as holycause told you, and as I told you too, you should start at the beginning. All your threads and questions are clearly showing a lack of the basic knowledge. And I'm not mocking you, I am too in the process of learning houdini. I've accepted to help you via skype, and I could see that you need to understand the basic philosophy of houdini before you can tackle some vex coding. It's like your asking for help to pilot an space shuttle when you've never rode a bike ! Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 8, 2016 Author Share Posted May 8, 2016 I'm trying to learn and understand Without hacking away, never know ! Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 8, 2016 Author Share Posted May 8, 2016 chf is (channel,frame) which I don't want the frame @P.y = noise(0,ch("noise"),0); noise takes three parameters, if the channel noise is controlling the Y which is suppose to control the noise ? Quote Link to comment Share on other sites More sharing options...
anim Posted May 9, 2016 Share Posted May 9, 2016 (edited) if you want to control the amplitude of the noise, you need to multiply the result of the noise() function so for example : @P.y = noise(@P) * ch("amp"); if you decide you need to have control over frequency as well then you can do this: @P.y = noise(@P*chv("freq")) * ch("amp"); and with offset control it would be: @P.y = noise(@P*chv("freq")+chv("offset")) * ch("amp"); Edited May 9, 2016 by anim Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 9, 2016 Author Share Posted May 9, 2016 16 hours ago, anim said: if you want to control the amplitude of the noise, you need to multiply the result of the noise() function so for example : @P.y = noise(@P) * ch("amp"); if you decide you need to have control over frequency as well then you can do this: @P.y = noise(@P*chv("freq")) * ch("amp"); and with offset control it would be: @P.y = noise(@P*chv("freq")+chv("offset")) * ch("amp"); I assume you only need to use, for example, the temp variable vector chv if you are creating the variable, not if you are applying it, as in the last two VEX code examples ? I thought noise needs three values, there is four if you including @P; I'm probably completely wrong in the sense that you need three values. I don't see the big difference between chv & ch ? How do I keep the grid stuck at it's position because currently it moves on the Y in the world ? Thanks for help up to this point, truly am appreciative. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted May 10, 2016 Author Share Posted May 10, 2016 @P.y = noise(@P) * ch("amp"); Is it possible to turn the above VEX code to display a literal math formula ? 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.