What is the difference between these two punctuations

   1510   1   0
User Avatar
Member
10 posts
Joined: Jan. 2017
Offline
Whats the different between these two?
();
{};
curly braces.


Ive just started following the CGwiki guide to houdini and was learning the sop solver.I came across this snippet of code .


–Faked Physics–

@v = {2,2,0};
v@gravity = {0,-0.1,0};



but i accidentally used () and got a result the sphere translate -y.I checked the help file to see what the User-defined functions provide but i saw none for the curly braces.
User Avatar
Member
41 posts
Joined: Feb. 2018
Offline
In VEX, there are two ways to explicitly assign values to a vector variable:
  1. If the values include variables, write
    @v = set(x,y,z);
    
  2. If the values are constants, write
    @v = {2,2,0};
    

So, {2,2,0} gives you a vector.
@v = {2,2,0};
is the same as
@v = set(2,2,0);
.

(2,2,0) on itself is not meaningful. I believe it returns the last value in the bracket.

Some examples [www.sidefx.com] to checkout.
  • Quick Links