Arthur Spooner Posted March 19, 2016 Share Posted March 19, 2016 What is the explicit alternative to this *= for VEX ? Quote Link to comment Share on other sites More sharing options...
Atom Posted March 19, 2016 Share Posted March 19, 2016 (edited) Just like most other languages. float my_value *= 2.0; // Or... float my_value = my_value * 2.0; Edited March 19, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 19, 2016 Author Share Posted March 19, 2016 Hrm, maybe then you can elaborate because I have @P *= cr (variable name) and I'm getting the error that it should be explicit not implicit ? Quote Link to comment Share on other sites More sharing options...
woodenduck Posted March 20, 2016 Share Posted March 20, 2016 Can you post the rest of your code? Where you declare the variable. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 20, 2016 Author Share Posted March 20, 2016 matrix3 cr = indent(); vector axis = {0,0,1}; float angle = radians(ch('amount')); rotate(cr,angle,axis); @P *= cr; One other question; functions are written as follows; (word of warning, this code example will have missing code, hoping someone can fill in the voids ?) surface noise_surf() { } ? Quote Link to comment Share on other sites More sharing options...
mestela Posted March 20, 2016 Share Posted March 20, 2016 Do you mean ident(), not indent()? Apart from that the code looks ok. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 20, 2016 Author Share Posted March 20, 2016 (edited) Do you mean ident(), not indent()? Apart from that the code looks ok. Hi, yes, sorry, I meant ident() ! My code is not indent, it's ident() Edited March 20, 2016 by Arthur Spooner Quote Link to comment Share on other sites More sharing options...
mestela Posted March 20, 2016 Share Posted March 20, 2016 you might have to attach a hip, there's no obvious error in your example code. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 20, 2016 Author Share Posted March 20, 2016 Hi, I've attached the HIP file; hope it helps. VEX.Learning.hipnc Quote Link to comment Share on other sites More sharing options...
mestela Posted March 20, 2016 Share Posted March 20, 2016 Ah, you've used a lowercase @p. It should be @P. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 20, 2016 Author Share Posted March 20, 2016 Correct me if I'm wrong, shouldn't the Amount slider rotate the cube ? Quote Link to comment Share on other sites More sharing options...
mestela Posted March 20, 2016 Share Posted March 20, 2016 It does; you've set it to work in degrees though. The default range of the slider is 0-1, so you'll barely percieve 1 degree of rotation. Use the middle-mouse-slider, and try changing it to 45 degrees, it should work. Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 21, 2016 Author Share Posted March 21, 2016 Ahh Sorry, I don't understand the definition of ident() in the VEX functions doc The ident function returns the identity matrix for the given matrix type. Quote Link to comment Share on other sites More sharing options...
mestela Posted March 21, 2016 Share Posted March 21, 2016 Just means 'a matrix that does nothing'. Ie, translate and rotation are all 0 0 0, and scale is 1 1 1. There's probably (read: definitely) a more mathematically pure definition of it, but think of it as making an empty transform, ready for you to do stuff with. In this case, you use it to do the rotation. https://en.wikipedia.org/wiki/Identity_matrix Quote Link to comment Share on other sites More sharing options...
Arthur Spooner Posted March 21, 2016 Author Share Posted March 21, 2016 Ah, thank you, once again 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.