arda3d Posted November 10, 2017 Share Posted November 10, 2017 Hi all, I am struggling to write a force array per particle, i have an float array per particle named "upforce" and i want to use this array as my "y" force. Any tips? Thanks Quote Link to comment Share on other sites More sharing options...
3dome Posted November 10, 2017 Share Posted November 10, 2017 I don't understand.. a force is a vector so if you just want to modify the y-component of that forcevector you cannot use an array. You can only use a single element of that array. Quote Link to comment Share on other sites More sharing options...
arda3d Posted November 10, 2017 Author Share Posted November 10, 2017 1 minute ago, 3dome said: I don't understand.. a force is a vector so if you just want to modify the y-component of that forcevector you cannot use an array. You can only use a single element of that array. The thing is, i want to apply a force per point.. Quote Link to comment Share on other sites More sharing options...
3dome Posted November 10, 2017 Share Posted November 10, 2017 yes sure. you can do something like this: float upforce = fit01(rand(@id), ch("min_force"), ch("max_force")); v@force = set(0, upforce, 0); Quote Link to comment Share on other sites More sharing options...
arda3d Posted November 10, 2017 Author Share Posted November 10, 2017 19 minutes ago, 3dome said: yes sure. you can do something like this: float upforce = fit01(rand(@id), ch("min_force"), ch("max_force")); v@force = set(0, upforce, 0); this is it! 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.