vi_rus Posted July 30, 2014 Share Posted July 30, 2014 Hi everybody, I'm looking for a way how to create dynamic constraints with Bullet. The basic way doesn't work. Take a look at hip file please to see the problem. Any help would be appreciated! Thanks! bullet_dynamic_con_issue_v01.hip Quote Link to comment Share on other sites More sharing options...
anim Posted July 31, 2014 Share Posted July 31, 2014 (edited) your constraint has to have correct anchor positions relative to initial pose of the rbds and since you are creating constraints between already simulated positions of the pieces, you need to transfer found anchors back to initial pose yourself here is the file (13.0.401) bullet_dynamic_con_issue_v01_fix.hip Edited July 31, 2014 by anim 1 Quote Link to comment Share on other sites More sharing options...
vi_rus Posted July 31, 2014 Author Share Posted July 31, 2014 Hi Tomas, Thank you for your respond! Actually, I had similar thoughts, but I couldn't solve an orientation issue. So I didn't change your setup, just replaced spheres on boxes and changed initial velocity. As we can see, constraint takes direction from an initial orientation. bullet_dynamic_con_issue_v02.hip Quote Link to comment Share on other sites More sharing options...
vi_rus Posted July 31, 2014 Author Share Posted July 31, 2014 Seems like I solved this issue! Thanks again, Tomas! You really helped me! bullet_dynamic_con_issue_v02_fix.hip 3 Quote Link to comment Share on other sites More sharing options...
rayman Posted July 31, 2014 Share Posted July 31, 2014 Awseome! You can also simplify this setup using only one pointwrangle: matrix tr = invert( primintrinsic(1,"packedfulltransform",@ptnum) ); vector pt0 = point(1,"P",0); vector pt1 = point(1,"P",1); vector pos = (pt0+pt1)*.5; @P = pos*tr; v@r=cracktransform(0, 0, 1, { 0, 0, 0 }, tr); hook "add1" to input0 and "dopimport1" to input1. then connect this node to "attribwrangle1" 2 Quote Link to comment Share on other sites More sharing options...
vi_rus Posted July 31, 2014 Author Share Posted July 31, 2014 Awseome! You can also simplify this setup using only one pointwrangle: matrix tr = invert( primintrinsic(1,"packedfulltransform",@ptnum) ); vector pt0 = point(1,"P",0); vector pt1 = point(1,"P",1); vector pos = (pt0+pt1)*.5; @P = pos*tr; v@r=cracktransform(0, 0, 1, { 0, 0, 0 }, tr); hook "add1" to input0 and "dopimport1" to input1. then connect this node to "attribwrangle1" thanks, I'll try it Quote Link to comment Share on other sites More sharing options...
anim Posted July 31, 2014 Share Posted July 31, 2014 Seems like I solved this issue!... good catch, didn't know about the r attrib, sometimes it's a good idea to read the help pages I guess it's a little disturbing that it's defined as euler, but I guess that can have some advantages as well Quote Link to comment Share on other sites More sharing options...
cwhite Posted July 31, 2014 Share Posted July 31, 2014 good catch, didn't know about the r attrib, sometimes it's a good idea to read the help pages I guess it's a little disturbing that it's defined as euler, but I guess that can have some advantages as well From what I recall, the reasoning for that was to match the interface of the old-style constraints (like the RBD Angular Constraint DOP). It gets converted to a quaternion internally, though. Quote Link to comment Share on other sites More sharing options...
anim Posted August 1, 2014 Share Posted August 1, 2014 that's understandable and not a big deal it's just that the current workflow is to modify these attributes through wrangle nodes or VOPs and so it'd be much easier to pass quaternion to r than extracting euler angles, as we usually work with matrices and quaternions Quote Link to comment Share on other sites More sharing options...
sekow Posted August 29, 2014 Share Posted August 29, 2014 hey I am trying to apply this to more than a pair of objects, and can't get it to work. Please see attached hip file live_constraints01.hip Quote Link to comment Share on other sites More sharing options...
sekow Posted August 29, 2014 Share Posted August 29, 2014 got it! what I am not getting how we are supose to read the prim force or torque attribute. without altering the type.. when I fetch that into an attribwrangle sop the type switches to vector. live_constraints03.hip Quote Link to comment Share on other sites More sharing options...
sekow Posted September 2, 2014 Share Posted September 2, 2014 and finally an example for more than one "wire" element ;p must say I've learned a lot by your examples. thanks a bunch! ps. of course I have to cast force as float... live_constraints04.hip 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 13, 2015 Share Posted August 13, 2015 I don't understand the idea of scaling the primitives to 0 and then running all this code: vector com = v@pivot+v@trans; @P = v@pivot+(@P-com)*invert(qconvert(p@orient)); Anyone can please tell me why these steps have to be done? Quote Link to comment Share on other sites More sharing options...
anim Posted August 13, 2015 Share Posted August 13, 2015 (edited) the idea is to bring anchor points of all new constraints generated from simmed RBDs to the initial pose of your RBDs as that's the space where bullet is looking up their attributes the code above will only work if you have copied trans and pivot attrib from corespoinding RBD to constraint anchors however in H14 trans attrib was deprecated, so this may not work the same way anymore, you need to be careful Edited August 13, 2015 by anim 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 13, 2015 Share Posted August 13, 2015 Thanks anim. What's the established way to do this in H14? Quote Link to comment Share on other sites More sharing options...
anim Posted August 13, 2015 Share Posted August 13, 2015 (edited) not sure if established help says that instead of trans, P is used for com so it's about to figure out how pivot comes in the place, just to reverse transform to initial pose as in H13 I can have a look at it once I have time, which is sadly not right now EDIT: but, you would probably use RBD's intrinsic transform directly as rayman suggested: http://forums.odforce.net/topic/20640-bullet-dynamic-constraint-creation/?p=123106 Edited August 13, 2015 by anim 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 13, 2015 Share Posted August 13, 2015 Thanks anim appreciate your help I will check out rayman's method. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted October 6, 2015 Share Posted October 6, 2015 (edited) Just got Sergei-Tomas-Pavel example working in H14, if someone need this. dynamic_constraint.hipnc Edited October 6, 2015 by f1480187 8 1 Quote Link to comment Share on other sites More sharing options...
Druidl Posted February 18, 2018 Share Posted February 18, 2018 (edited) Played with this. Hate switches, love multiple, so I did this. dynamic_constraint.hipnc Edited February 18, 2018 by Druidl added file 4 Quote Link to comment Share on other sites More sharing options...
Druidl Posted February 18, 2018 Share Posted February 18, 2018 This can be achieved also with the setup 1 1 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.