Jump to content

converting code into vops


Lukich

Recommended Posts

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

post-9-1079998941.jpg

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