Jump to content

Variables


Stremik

Recommended Posts

From "Shaders.pdf"

Chapter "Creating simple VEX SOP Operator"

RandMove(float  height = 1;
                      int  myseed = 1;)
{
  vector  Nf = normalize(N);
  float  r = random(ptnum+random(myseed)*Npt);
  P += Nf * r * height;
}

Link to comment
Share on other sites

"height" and "myseed" are the parameters to the OP. These will be displayed in your dialog. Whereas "Nf" and "r" are just variables that are needed for whatever process internal to the VEX OP.

So height and myseed will be the values that the user tweaks.

The same applies to functions.

// Define the Parameters
float
myFunctionThing1( float UserParameter1 =9;
                            float UserParameter2 = 6;) 
{

// Define variables and other snazzy stuff
  if (UserParameter1*UserParameter2 != 42) {
    printf("Error\n");
  }

}

jim.

jim.

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