Snow Bars Posted May 29, 2016 Share Posted May 29, 2016 Hello! I am have a problem with understand physics in babylon. If I add new mesh under existing then existing mesh jump instead change it position of y-axis on height lower object. Example: http://playground.babylonjs.com/#4OULE What am I do wrong? P.S.: sorry for my English... Quote Link to comment Share on other sites More sharing options...
dbawel Posted May 29, 2016 Share Posted May 29, 2016 @Snow Bars - Sorry that something appears to be lost in the translation, as everything you've coded appears to be working as expected. If possible, can you try and rephrase the question to make it clearer to understand specifically what behavior you are looking for on a per object basis? Perhaps make the question much longer and more thorough so that one of us might understand what you are expecting to see happen. Thanks, DB Quote Link to comment Share on other sites More sharing options...
adam Posted May 29, 2016 Share Posted May 29, 2016 You are overlapping the boxes. Try this: http://playground.babylonjs.com/#4OULE#1 Quote Link to comment Share on other sites More sharing options...
Snow Bars Posted May 30, 2016 Author Share Posted May 30, 2016 dbawel, thanks for comment. Try to clarify the idea. I have many meshes which I need them in lines one on one. I.e. one line of object exists on scene. I add one object under this line. I want this line automatically lifted up on the bottom object height. And if I delete bottom object the line must fall down. I may use arrays of objects and the cycles but there may be a huge amount of objects. And a huge amount of object lines too. I would like to simplify algorithm and I think that the physics engine may do all (or some) of these things. Adam, thank you very much for the demo. Blocks lift down just as I need on the demo. What I would like to gain is to lift them up in the same way. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 30, 2016 Share Posted May 30, 2016 Hi guys. I did another version: http://playground.babylonjs.com/#4OULE#4 It inserts/adds thin mesh at the bottom of the stack.. every 2 secs. I have solved nothing... but... its something new to stare-at, and think about how to solve this challenge. hmm - scratch scratch. This ALMOST seems like a job for non-physics, if that is possible. Add box TO bottom of stack, then move entire stack up == height of new box. Remove box FROM bottom of stack, then move entire stack down == height of new box. But maybe stacks are supposed to tip-over sideways, sometimes? (in the game) If so, then physics engine is a sure requirement... I think. How to insert/remove any-size box from bottom, without much bounce/spring. hmm. Difficult. I have ideas, still. adam and dbawel 2 Quote Link to comment Share on other sites More sharing options...
adam Posted May 30, 2016 Share Posted May 30, 2016 http://playground.babylonjs.com/#4OULE#7 Wingnut and dbawel 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 30, 2016 Share Posted May 30, 2016 Not bad at all, Adam! Not bad. I sort of lost focus... http://playground.babylonjs.com/#4OULE#6 I got lost in the playing. http://playground.babylonjs.com/#4OULE#8 You would think that a stack of spheres would be far more wobbly than a stack of planes. But nope... spheres stack very nice. hmm. I think we know why the stack of flat boxes tips over so easy, and often to the same side. It's because of the same side-slide jitter that Steffan is experiencing with his load handler... me thinks. Quote Link to comment Share on other sites More sharing options...
dbawel Posted May 30, 2016 Share Posted May 30, 2016 @Snow Bars - As usual, I got beat to the punch. I hope that @adam and @Wingnut answered your question. I'll be curious to see what kind of game you're building, as this could be allot of fun! DB Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 30, 2016 Share Posted May 30, 2016 Hi DB! Jump on in! I don't think we're anywhere near a perfect solution, yet. I was thinking about making an invisible mass-less ground ABOVE the stack... repeatedly moving that upward the same amount as the height of the each newly-added box, and then reversing gravity. How innovative, eh? (snicker) New boxes will fall upward, and the mass 0 ground... atop the stack, will keep boxes from exiting into outer space. Wha-da-ya-think, guys? Crazy, huh? When its time to remove boxes, normalize the gravity and remove from the bottom of the stack (true bottom). Then move the invisible top-ground... downward... the same amount as the height of the removed box, and then reverse gravity again. Wow! Toggling gravity direction... depending-upon add box or remove box. Scary! Might work. 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.