Stremik Posted May 31, 2003 Share Posted May 31, 2003 Why some of the variables in VEX code are being declared inside operator's header while others inside body? Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted June 1, 2003 Share Posted June 1, 2003 Can you point us to a example? jim. Quote Link to comment Share on other sites More sharing options...
Stremik Posted June 1, 2003 Author Share Posted June 1, 2003 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; } Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted June 1, 2003 Share Posted June 1, 2003 "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. Quote Link to comment Share on other sites More sharing options...
Stremik Posted June 1, 2003 Author Share Posted June 1, 2003 Thanks! 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.