Placing the marbles inside of a glass (like a wine glass) has proven somewhat challenging. It is hard to see where to place them so they logically fill the space and do not intersect other geometry,
I thought of using particles and collision, but it seemed like too much work for a simple thing…
When you are doing “physical things” in Blender, the physics-simulation features are quite useful. Those features are often regarded as being “synonymous with” BGE, but in fact they’re not: the output of a physics-simulation can be “baked” to a set of IPOs for use in an animation.
So, you can “fill the glass with marbles,” trying it out in real-time in BGE (at 60 fps or whatever), then bake to produce IPOs (at the selected animation-speed, e.g. 25 fps).
You might simply be interested in “where the marbles wind up,” e.g. when creating a static picture. You can do that, too.
thanks so much…i played with it and it works great…not hard to use at all.
one thing i cannot figure out is that when you have a bunch of objects, they spray outwards and don’t all fall into the glass and I cannot yet figure out which setting controls that.
i think i figured it out. if you copy the object while in logic mode, it flies apart, but when you duplicate before, it works as if they are just two different objects and they fall together as separate objects. If you have a lot of objects, makes for a lot of copying…but it works
I just put a bunch of marbles that are rigid bodies with bounds set to convex-hull or triangle mesh above the glass, then I run the simulation while having the option to save the game data to IPOs. When I hit p, the marbles fall into the glass and settle down. Then I exit game mode by hitting esc. Then I move to a frame where the marbles have settled. Finally, I delete the IPOs so that the marbles just stay there no matter the frame. Peace
ok…i was using ‘cylinder’ and not ‘convex-hull’ but the same thing happens when you make a lot of duplicates, only in a different way. the marbles shoot upwards when the duplicates are all ‘convex-hull’ and sideways when they are all ‘cylinder’. don’t know about triangle mesh as I was using a uv-sphere, but i think it is the same.
A basic example of balls in a glass
From the Game menu at the top of the blender window select “Record game physics to ipo”.
Press P to run the animation long enough for the balls to settle, then Esc
Go to the frame with the balls position you want, add materials to the glass and balls, then render. balls.blend (81.1 KB)
Not sure if the bound makes much of a difference. You could even try sphere but you may get some overlapping objects. Make one sphere, set all its physics settings then duplicate with Shift+D. This also copies all its physics settings. You can then select these two, duplicate again, select all four and duplicate again and so on.