Jump to content

The difference between set( ) and { } on Wrangle?


Recommended Posts

you can use {} syntax to define vector using constants like {1,2,3} or {-0.1, 1.5, 2,0}

but if you want to use variables you have to use set() function, which builds a vector by evaluating arguments

 

so 

float num = 1.0;
vector A = {num, num, num}; // is invalid and will error out
vector B = set(num, num, num); // evaluates to {1.0, 1.0, 1.0}
Edited by anim
  • Like 1
Link to comment
Share on other sites

...  He says set() is much more effecient than {} to calculate.

not sure about that, as set() is a function which produces vector {}

it's as if you were saying that rand() is more efficient than number 0.854

 

unless I'm missing something

  • Like 1
Link to comment
Share on other sites

not sure about that, as set() is a function which produces vector {}

it's as if you were saying that rand() is more efficient than number 0.854

 

unless I'm missing something

Well, technically, 0.854 as a constant is more efficient than any function call  :)

Not sure if set() is faster though. For example there is also assign function, which extracts values from vector or matrix. Would it be faster then getting value by index? Need to do some tests anyway.

Edited by Stalkerx777
  • Like 1
Link to comment
Share on other sites

post-13446-0-29177600-1435780120_thumb.j

 

You're probably right, all I know about it is what I saw in the tutorial.

 

What you said about not being able to use variables in {} is probably more important anyway.

Edited by rtep
  • Like 1
Link to comment
Share on other sites

@anim : Thank you so much for your help. I've got it what your point! Have a great day.

 

@rtep : Hi rtep, It's great tutorial that I saw. I wanted to know more deeply for some a confuse things using them.

 

@Stalkerx777 : Thanks! I am going to try your technical support.

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