jorditantadiaz Posted February 21, 2017 Share Posted February 21, 2017 Hi, i trying to emulate a cloth animation follow this: http://www.babylonjs-playground.com/#1J3WEP#6 I am trying to apply cloth to a garment (obj. file / shorts), and then do a collision with a manikin, but when i apply it, it's look like this, i dont know why: Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 23, 2017 Share Posted February 23, 2017 Hi @jorditantadiaz. Take a look at THIS browser-bogging playground. http://www.babylonjs-playground.com/#1J3WEP#117 First, notice the demo uses CannonJS physics engine, and not the default Oimo physics engine. (line 5-6) CannonJS is currently the ONLY 3rd party physics engine for BabylonJS... that allows meshImpostor. meshImpostor is how to get a physics impostor... that perfectly "matches" a complex shape such as a manikin. So, your manikin MUST use a CannonJS meshImpostor... for its physics impostor (like I did with the torus knot... which is a complex shape). Now for more bad news. meshImpostors ONLY interact-with sphereImpostors! OH NO! Thus... notice I changed particleImpostor... to be sphereImpostor... for the cloth (line 53)? I had-to. When it was particleImpostor, the cloth drops "thru" the shape. And notice the speed of the demo? Browser killer! 4-5 FPS? Nod. But, this is your challenge. Cannon MeshImpostor on the manikin, sphereImpostor-based sim-cloth for your garment. I don't mean to discourage you, but your hopes... are rather large. What you MIGHT wish to code... is a custom collision system. Perhaps it will be much less powerful and detailed than Oimo or Cannon, yet it will allow you to place garments upon manikins with SOME body-contour-following accuracy (spandex). But even then, garments and manikins are NOT simple bounding boxes, so simple mesh intersect testing/checking... is difficult. Now if you want to use "weighting" on the entire surface of the garment (so you can see how a dress or sport coat "hangs" on a person)... you will need many many many weight points and calculations (for proper-acting clothing). This is a big challenge for Javascript. Interesting, though. I figged I would tell you some little things about meshImposters and complex shapes. Perhaps others may comment. The "super-hero" move would be... get particleImpostor... working with meshImpostor (deep Cannon.js hacking and native-method calls). That would be essentially the same as coding your own custom collider/intersecter. You would essentially be creating "CannonJS For Clothing" ... also a big project, I suspect. I'm no expert, though, ok? I could be wrong about anything, anytime. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted February 23, 2017 Share Posted February 23, 2017 Sps system might be able to pull off cloth. One of my projects I wanted to do was soft body simulations in real time but have had like no time to work any any "want" projects... let me know what you dig up in this area there would be a few ways to accomplish this. Quote Link to comment Share on other sites More sharing options...
jorditantadiaz Posted February 23, 2017 Author Share Posted February 23, 2017 Thank you for your recommendations @Wingnut, @Pryme8 Last month i did a soft body simulations whit whiteStormJ, for the same goal, but i have not been success, i think softbody is maybe like cloth, but it is not cloth, it have a lot of problems whit the collision and effect's behavior. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 23, 2017 Share Posted February 23, 2017 Did you check the code of this demo: http://www.babylonjs.com/Demos/Cloth/ ? You can find it here: https://github.com/BabylonJS/Website/tree/master/Demos/Cloth Quote Link to comment Share on other sites More sharing options...
jorditantadiaz Posted February 23, 2017 Author Share Posted February 23, 2017 Hi @Deltakosh, i check it, Maybe not in depth, but i did it and i got similar problems when i do it with ThreeJS or WhiteStorm, and that is because i use a concave mesh + cloth effect ,and because according to what i investigate, cloth is only for plane geometry: My problems when i do sometring like the demo are: Mesh deformed Collision with itself And i need some controll on the behavior of the cloth effect Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 23, 2017 Share Posted February 23, 2017 Unfortunately this seems beyond what the engine can do out of the box:( Quote Link to comment Share on other sites More sharing options...
jorditantadiaz Posted February 23, 2017 Author Share Posted February 23, 2017 Right now I've given up a little, I'm trying to solve the problem that a garment like a pole goes through another garment and maybe emulate the effect of collapsing the garment against the manikin or other garment, but no longer with cloth, I lost my hopes 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.