Lukich Posted March 22, 2004 Share Posted March 22, 2004 Hi. I'm new to Vex, but I have some C++ background, so I decided to give it a shot by trying to convert some hard code into VOPs. I used the example from the houdini help file, which is a simple point-displacement procedure: RandMove (float height = 1; int myseed = 1;) { vector Nf = normalize(N); float r = random(ptnum+random(myseed)*Npt); P=+Nf*r*height; } It all works fine in my translation to vops, except for one thing. I'm not quite sure how to represent the equality of a custom variable ® to the product of several other things, including certain point attributes that come from the global variables. I ended up multiplying r, which has a value of 1 by the product of random(ptnum+random(myseed)*Npt and used the output as a value of r. It worked fine for a sphere, however when I used it on the grid it turned it into a line, and I'm not sure why. I have attached a jpg of my network in case the description doesn't make much sense. Please, advise. Thanks a lot!!! Quote Link to comment Share on other sites More sharing options...
Jason Posted March 23, 2004 Share Posted March 23, 2004 Hey Lukich, I can see one mistake: This line: P += Nf*r*height; ..suggests that you shoud be Adding your input P from your Global Variables VOP to your result before outputting to the Output VOP's P. Quote Link to comment Share on other sites More sharing options...
Lukich Posted March 23, 2004 Author Share Posted March 23, 2004 perfect! thanks a lot, Jason! Quote Link to comment Share on other sites More sharing options...
Jason Posted March 23, 2004 Share Posted March 23, 2004 No problem:) Good luck! 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.