jungjaehwa Posted July 1, 2015 Share Posted July 1, 2015 (edited) Hi All, I want to know the difference between set( ) and { } using on Wrangle. Exactly what is difference? Best, Jamie Edited July 1, 2015 by jungjaehwa Quote Link to comment Share on other sites More sharing options...
anim Posted July 1, 2015 Share Posted July 1, 2015 (edited) 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 July 1, 2015 by anim 1 Quote Link to comment Share on other sites More sharing options...
rtep Posted July 1, 2015 Share Posted July 1, 2015 https://vimeo.com/67677051 It's also discussed in Ari Danesh's tutorial (starting at 19:30). He says set() is much more effecient than {} to calculate. 2 Quote Link to comment Share on other sites More sharing options...
anim Posted July 1, 2015 Share Posted July 1, 2015 ... 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 1 Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted July 1, 2015 Share Posted July 1, 2015 (edited) 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 July 3, 2015 by Stalkerx777 1 Quote Link to comment Share on other sites More sharing options...
anim Posted July 1, 2015 Share Posted July 1, 2015 Well, technically, 0.854 as a constant is more efficient than any function call ... my point Quote Link to comment Share on other sites More sharing options...
rtep Posted July 1, 2015 Share Posted July 1, 2015 (edited) 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 July 1, 2015 by rtep 1 Quote Link to comment Share on other sites More sharing options...
jungjaehwa Posted July 2, 2015 Author Share Posted July 2, 2015 @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. 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.