POV-Ray : Newsgroups : povray.binaries.images : Piles of things (with Bullet Physics Playground) : Re: Piles of things (with Bullet Physics Playground) Server Time
30 Jul 2024 14:31:10 EDT (-0400)
  Re: Piles of things (with Bullet Physics Playground)  
From: Robert McGregor
Date: 15 Sep 2012 12:55:01
Message: <web.5054b1c72fe15fc5f7aa22b40@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote:
> Well that's excessively cool, Robert. Congrats!

Thanks Sam :)

> What kind of geometry evaluations did you use for the object collisions? Convex
> meshes, triangle (concave) meshes, primitive mathematical representations? Are
> they colliding with a low-poly mesh representation of the cart?

For the shopping cart I made a simple cart-shaped stand-in box, with the top
removed, that fits inside the actual cart geometry (10 triangles). For the
collisions themselves I used:

[Dynamic objects]
Primitives:
   btBoxShape
   btSphereShape
   btConeShape
   btConvexHullShape

[Kinematic objects]
Cart box: btTriangleMesh
Ground: btStaticPlaneShape

After the sim is stable (objects have stopped moving) the transformation data
for each object (via btTransform::getBasis() for rotation and
btTransform::getOrigin() for translation) is written to a POV-Ray include file
as a set of multidimensional arrays, something like this:

// for each collision object
btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
btRigidBody* body = btRigidBody::upcast(obj);

btMatrix3x3 rot = body->getWorldTransform().getBasis();
btVector3 trans = body->getWorldTransform().getOrigin();

// write to file...

> More than any of those things, I'd like to know how stable everything was at
> runtime. When working in Blender, solid bodies tend to jump around a lot when
> confined in any space, sometimes never stabilizing. This mainly happens when
> performing mesh-mesh collisions.

Working with Bullet is extremely stable. While a sim is running it's pretty much
real-time, like a video game.

I haven't delved into the soft body capabilities yet (although they are
amazing); I just wanted to get my feet wet with the rigid body stuff first.

> BTW, those front wheels seem off. More often than not you'll see them pointed
> the other way... maybe the force of all those dropped objects pushed the cart
> back? :)

Hmm, I hadn't noticed that, it must've rolled backwards a bit indeed :)
-------------------------------------------------
www.McGregorFineArt.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.