Bullet Physics/Chemistry

I am trying to use the bullet physics feature to create balls bouncing around in a box like atoms. I have been adjusting the three axes of gravity, and all the other effects on the spheres in a box created with six planes but it is really not obvious how to get relatively random motion. The balls eventually stick together in some corner after about 5 seconds. I have used the infinite skills tutorial to get started but that only gets me dropping things to a floor.

Anybody understand this process?

«1

Comments

  • evilproducerevilproducer Posts: 9,050

    Have you tried using scene forces? Not sure what would work best. The other question ii, do you know about surface properties? You will want to set them on the simulated object as well as the any object they interact with. You can find the settings under the object's Effects tab. For instance, you may want to increase the bounce factor and decrease the friction.

    Finally, it is important to remember that Carrara is at its core, an art program. I like to think of the physics as being artistically acurate, but I wouldn't trust them to run a scientifically acurate simulation. If that makes sense.

  • hrpschrdhrpschrd Posts: 180

    Yes, I played with all the effects and they don't make sense. Surely someone understands how they work?

    I only want to make animations not accurate models of data.

  • DesertDudeDesertDude Posts: 1,235
    edited July 2019

    Hi hrpschrd,

    The Scene Forces evilproducer was refering to are different from the surafce properties in the Effects tab. You can find them by clicking the icon next to the Camera Icon in the Toolbar. They are Directional Force, Point Force, Damping Force, Torque Force and Flow Force. You can also find them using 'Insert'. Screen grabs at the end of this post to help.

    I made a quick animation by creating an enclosed box in the Vertex Modeler, 6 sides. I then created another seperate Vertex Model, a sphere, default Object Definition of 8 and gave it one level of smoothing. Back in the Assembly Room with the sphere selected, under the Motion Tab, I changed the animation method from Keyframe to Physics. I then made several duplicates and and gave them some pretty colors. :)

    For the Box, in the Effects Tab, I changed the Bounce to 100% and dropped Friction to 1%. I left the Spheres at their default values. I then turned the Visibility of the Box off.

    I then inserted a Flow Force, and just used default values. I then clicked the Simulate Physics button, and once finished, made a quick render:

     

     

    Here is a video by Cripeman that introduces and explains the Scene Forces (he is using particle emitters to show their effects):

     

    https://www.youtube.com/watch?time_continue=327&v=x6ksxcqHt68

     

    You can find many tutorials on YouTube for Physics and also over at Carrara Cafe. Hope that helps you get started. Feel free to ask more questions.

     

     

    assembly_room.jpg
    1030 x 924 - 134K
    insert.jpg
    155 x 799 - 34K
    motion.jpg
    238 x 241 - 16K
    effects_tab.jpg
    237 x 727 - 39K
    Post edited by DesertDude on
  • Persona Non GrataPersona Non Grata Posts: 1,365
    edited July 2019

    PLEASE DELETE THIS!

    Post edited by Persona Non Grata on
  • Persona Non GrataPersona Non Grata Posts: 1,365
    edited July 2019

    10

    Well explained DD I would also add the scene physics tab too to control collision distance and simulation accuracy settings.


    IMAGE 1

    Atoms by Selinita


    IMAGE 2

    Atoms2 by Selinita

    Post edited by Persona Non Grata on
  • evilproducerevilproducer Posts: 9,050

    You can also keyframe the scene forces so that if you start to get them bunching up, you could increase or decrease the strength or even the direction of the force. I also forgot to mention, under the Scene's effects tab  you can adjust the scene's default gravity, or turn it off altogether.

  • hrpschrdhrpschrd Posts: 180
    edited July 2019

    Thanks all.

    DD: I followed your directions literally which means I missed some details.

    - i assume you moved the balls around after duplicating. The balls jiggle  as well as move around but they move in a smaller volume which is less than the box volume. Something about the vertex modeling of the box? It was set for eight. The balls definitely don't move as smoothly as yours. I don't have "flow force" in my instances box. One of the balls went well outside the box. If I can get to where your animation is, I would like the balls to start at the top of the box and spread downward. I assume I want higher gravity?

    I obviously don't understand this. Is flow force only applied to the balls? Why don't I have the wavy indicators in my screen? Sorry but you can't assume I know all the "obvious" steps you take.

    Post edited by hrpschrd on
  • DesertDudeDesertDude Posts: 1,235
    edited August 2019

    Hi hrpschrd,

    Sorry, wasn't at my computer yesterday and sorry for any omitted details.

     

    hrpschrd said:

    - i assume you moved the balls around after duplicating.

    Yes, After duplicating each set of 3 balls I offset them from each other so none of them were touching. 

     

    hrpschrd said:

    Something about the vertex modeling of the box? It was set for eight. 

    The box is made of of a cube, 6 flat planes, no extra polygons/subdivision/geometry.  

     

    hrpschrd said:

    It was set for eight. The balls definitely don't move as smoothly as yours.

    The spheres are default drag and drop from inside the Vertex Modeler. All I did was apply smoothing, If you accept the default sphere its Object Definition is 8.

     

    hrpschrd said:

     I don't have "flow force" in my instances box. 

    Hmmm...did you drag a Flow Force into your scene from the drop down like in the screen shot in my first post (it's the last icon in the drop down menu). Or, go to Insert > Flow Force (down near the bottom of the drop down list).

     

    hrpschrd said:

    One of the balls went well outside the box. 

    Ah...okay, maybe as FENgari suggested above you need to adjust the Simulation Accuracy, Geometric Fidelity and Collision Distance settings. You can find those settings by clicking 'Scene' at the top of the Instances Tab, then look for the Physics Tab. I set my Simulation Accuracy to 1000% - the simulation calculation is a little slower, but not painful. I also set my Geometric Fidelity to 100% and Collision Distance to 10%.

     

    hrpschrd said:

    I obviously don't understand this. Is flow force only applied to the balls? 

    Yes, because only the balls have changed to Physics from the Motion Tab. Motion > Physics. (See the screen grab from my previous post.) The box is still set to the default Motion > Keyframe.

    Here is a link to a mini tutorial that may help explain some settings. Lots of words but may be of help:

    https://www.daz3d.com/forums/discussion/23632/bullet-physics-tutorial

     

    hrpschrd said:

    If I can get to where your animation is, I would like the balls to start at the top of the box and spread downward. I assume I want higher gravity?

    Hmmm...will give it a try today and see if I can come up with something and share my findings, if successful.

    Post edited by DesertDude on
  • DesertDudeDesertDude Posts: 1,235
    edited August 2019

    OK, it was  pretty easy, not sure if this is the exact look you want...you probably have to make adjustments to the strength of the forces, but here we go!

    Align the spheres at the top in rows. Make sure there is a little space inbetween each of them.

    Since you can't keyframe Gravity, set your Gravity in X,Y and Z to 0.

    Insert a Directional Force (Insert > Directional Force). It comes in by default pointing down, which is convenient. 

    Insert a Flow Force (Insert > Flow Force).

    At frame 0, turn the Strength of the Directional Force to 0. Do the same for the Strength X,Y,Z and Rotation Strength  of the Flow Force - set to 0.

    I moved the playhead of the timeline down to frame 36 and entered 2.00 for the Directional Force. Then at frame 48  reduced the Strength back to 0.

    For the Flow Force, I copied the first frame and moved it to frame 12, essentially holding the values at 0. Then, at frame 36 increased the Strength of X,Y,Z and Rotate Strength to 20,000 each. 

    I added a gentle ramp up for the tweeners as the Strength increased for both the Directional and Flow Force.

    Hit the Simulate Physics button, let it do its thing, then rendered.

    Like I said, you will want to adjust the values to suit your own animation.

     

     

     

    edited to add: make sure the initial aligned spheres have a little space inbetween each of them

    forces.jpg
    725 x 637 - 88K
    forces_timeline.jpg
    495 x 374 - 24K
    Post edited by DesertDude on
  • hrpschrdhrpschrd Posts: 180

    I still can't do the simple animation DD shows and explained.

    - made box and 6 balls with VM. Balls are in box. After inserting FF and doing simulate physics, the balls fly out of the box.

    - when inserting FF I tried without selecting anything, and selecting everything (balls and box). balls fly out of box.

    What exactly does insert Flow Force really do? The balls fly away because they are Physics not Keyframe? Why should the box stop them (it doesn't). Please explain what is really going on because I am SOOO stuck at the beginning after three damn days!

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,200

    Is bullet selected under scene physics?

  • hrpschrdhrpschrd Posts: 180

    Yes.

  • DesertDudeDesertDude Posts: 1,235

    hrpschrd,

    I'm sorry for you agony and frustration.  Maybe it's time to post your scene so we can dissect it? I think you have to post it as a ZIP file, if you are willing.

    I'm going out for a bit (it's Friday night here where I am) but will check in later and...offer more diagnostic advice.

    Posting your latest test/scene would really help.

    Cheers

  • hrpschrdhrpschrd Posts: 180

    Sorry for the whinging, it was late.

    I found the trick to keeping the balls in the box: select "Scene" before simulating physics. Oddly, the balls bounce around actively for 3 seconds then, one by one, three have escaped by 4 seconds. Seen that before?

  • DesertDudeDesertDude Posts: 1,235

    Hi hrpschrd

    I must confess I am not an expert when it comes to Physics simulations, so it could many things. That's why I was hoping you could post your scene so we might be able to pinpoint the problem. 

    I've uploaded my scene for you to dissect.

    Hope it helps.

    zip
    zip
    Spheres_In_A_Box_002.car.zip
    173K
  • MistaraMistara Posts: 38,675
    FENgari said:

    10

    Well explained DD I would also add the scene physics tab too to control collision distance and simulation accuracy settings.


    IMAGE 1

    Atoms by Selinita


    IMAGE 2

    Atoms2 by Selinita

    really really kewl!

  • hrpschrdhrpschrd Posts: 180

    Mystara and DesertDude;

    What you show is just what I need. Please provide exact directions for your animations. I am completely unable to follow your instructions still.

     

  • DesertDudeDesertDude Posts: 1,235
    edited August 2019

    Hi hrpschrd,

    Did you download my scene to look at it? All you have to to do is hit the Simulate Physics button...but more importantly, look at the scene elements and see what may differ from your own scene elements to see what is working / not working. I'm not trying to be stubborn, I have already given...all Scene elements and values... it would really help us if you uploaded your own scene so we could maybe find the culprit.

    Let's solve this. yes

    Just out of curiosity, what version of Carrara are you using?

    Cheers

    Post edited by DesertDude on
  • hrpschrdhrpschrd Posts: 180

    Hi DD;

    I watched the YouTube video, but didn't see a file to download. I am not sure how to upload my own either. BTW, how do you do the Quotes in this Forum?

    I do appreciate whatever you can do. Version 8.5.1 Pro, build 19 (64 bit). I only use it once a year so it is always a struggle.

  • de3ande3an Posts: 915

    Here's another method.

    Open a new Medium Scale scene.

    Insert a cube (I just used a cube primitive). Choose a transparent shader with no refraction (I used the Basic Shaders "Transparency", and changed the Refraction channel to None).

    Insert one Sphere of the appropriate size and set it's Motion Property to Physics. Choose its color now if you want them to all be the same.

    Use the Duplicate command to make as many spheres as you need and arrange them all inside the cube but not touching it or each other.

    Insert a Directional Force and set its Strength property to 6.00 ft/s^2. Place it directly beneath the cube. With the force selected, go to the Modifiers tab and add a Spin modifier. Choose the x or y axis.

    Now click the Simulate Physics button in the upper left corner of the toolbar and watch the action.

     

  • hrpschrdhrpschrd Posts: 180
    edited August 2019

    de3an: I don't get what you do. My spheres drop to the bottom and jiggle around a bit on the bottom of the cube. Maybe you can see that I didn't follow directions EXACTLY somewhere if I could show you. 

    I would like to post my results but don't know how. I can't find a tutorial or help on posting images or files. .Also, how do you use the "QUOTE function? Where is this help stuff??

    Post edited by hrpschrd on
  • UnifiedBrainUnifiedBrain Posts: 3,588

    Hrpdchrd, when you click on the quote button, the post in that box will now start out your new post, and you can respond to it.  The quote button does not help you post images or files.

    To post an image, here is the quick version:  https://www.daz3d.com/forums/discussion/comment/3701141/#Comment_3701141

    Regarding the file that DesertDude spoke about, in your current thread here, scroll up 7 posts from my post you are reading right now.  It should be a DesertDude post.  At the bottom of that post, you should be able to see a box labled "attachments"  This is the zip file of the setup that desertDude is trying to help you with.  Click on that zip file, download it, load it into Carrara, and you should be able to see EXACTLY how he did it.

    Hope this was clear.

  • hrpschrdhrpschrd Posts: 180

    Thanks Brain!

    I was still trying to follow his earlier simple directions. I can see from this attachment that the later directions are what I need. I will try to understand why and how it was done. If you know of a good source for the details on these force tricks, please let me know.

     

  • hrpschrdhrpschrd Posts: 180

    I opened the attachment from DD and copied exactly what that .car file had. The exception is that I have nine red objects that are double spheres to represent oxygen molecules. For that reason they are listed as groups (two atoms each). I can't imagine that making a difference. My file looks just like DesertDude's with the two forces and sequencer set. 

    When I did the physics simulate all the molecules flew straight out of the screen. Obviously no render necessary. What should be keeping the molecules inside the box so that they bounce around inside? Since I don't understand how this works, I can't fix my file.

    I would like to post the .car file but don't know how. It can't just be a picture file, right? How did DD do it?

  • DesertDudeDesertDude Posts: 1,235
    edited August 2019

    Hi hrpschrd,

    Did you also set the values for the Physics Engine under Scene > Physics? Did you set the Pysical Properties for the Box and the Spheres under the Effects Tab for each of those objects?

    Under the Physics Engine I have:
    Simulation Accuracy: 1000%
    Geometric Fidelity: 100%
    Collision Distance: 10%
    Gravity: Use Default Gravity 'checked' , X=0.00 Y=0.00 Z=0.00
    Physics Solver: set to 'Bullet'

    For each of my Spheres, under the Effects Tab > Physical Properties I have:

    Collide with other objects 'checked'
    Density: 1.000
    Bounce: 95%
    Friction: 5%

    For the Box, under the Effects Tab > Physical Properties I have:

    Collide with other objects 'checked'
    Density: 1.000
    Boucne: 95%
    Friction: 1%

    To post a scene file, you need to compress the file into a ZIP file. I'm on a Mac, so I just select my .CAR file and from the Finder got to File > Compress. I have no idea how to do it on a PC, maybe someone can chime in here who can help witht that.

    Then, below the box where we type our messages you will see 'Attach File'. Click that and then click the 'Choose File' button and navigate to you ZIP file and select that. It should upload automatically and when you hit the 'Post Comment' button it should show up at the bottom of your post.

    Here's a screen grab.
    I have a sneaking suspicion the problem is the Collision Distance setting under Scene > Physics Engine, but I don't know for certain. Keep us posted.

     

    upload_file.jpg
    348 x 360 - 24K
    Post edited by DesertDude on
  • DesertDudeDesertDude Posts: 1,235
    hrpschrd said:

    The exception is that I have nine red objects that are double spheres to represent oxygen molecules. For that reason they are listed as groups (two atoms each). I can't imagine that making a difference.

    Ah, I just re-read your comment. That might make a difference, let me try something real quick here.

  • DesertDudeDesertDude Posts: 1,235
    edited August 2019

    No, worked fine, although I don't know how your two spheres are 'grouped'. I tried Grouping several sets of 2 spheres by selecting 2 spheres at a time and used Edit > Group. I ran the simulation and they...split apart from each other but stayed in the box. I Googled what an Oxygen Molecule looks like (...lol) and then made a single object of 2 spheres pushed together. I made 8 copies of those and ran the simulation and they all stayed in the box and the two spheres did not seperate, they acted as one object each and bounced around the box.

     

     

    double_spheres.jpg
    1026 x 789 - 113K
    Post edited by DesertDude on
  • de3ande3an Posts: 915

    In the example that I posted, except for the settings that I specifically mentioned, all parameters were left at their default settings.

    I'll attach the Carrara scene file here.

    As for grouping two balls together, when physics forces are applied, they will not follow each other. Physics forces do not seem to respect grouping.
    To make a double ball you will need to create it in the vertex modeler. (as DesertDude described)

     

    zip
    zip
    Tumble balls.zip
    463K
  • DesertDudeDesertDude Posts: 1,235

    Thanks for chiming in de3an. I just downloaded your scene to test and works fine. I then reset most of my settings to default and they worked fine for my own scene. I think I had a problem when I first tackled this issue in that some of the spheres were 'poking' through the box so I started getting drastic with the settings, but obvisouly unnecessary.

    I'm at a loss as to what the problem could be....

     

  • hrpschrdhrpschrd Posts: 180

    Thanks both!

    When I individually checked and adjusted the settings for each sphere in each group (and the box) as DD suggested, the paired spheres stayed paired but went right out of the universe. By the way the spheres are vertex objects. Matter? I could always make a vertex object look like two combined spheres (oxygen) without grouping. DD, can you tell me why you chose those physics settings? How do they work? Is there a tutorial? I will look at de3an's file next. This may be frustrating but there is a lot to learn here!

Sign In or Register to comment.