Forum Coordinators: RedPhantom
Poser - OFFICIAL F.A.Q (Last Updated: 2024 Dec 20 7:20 am)
I think adjacent actors do not collide, but the convex hull of the fingers seems to be too large. Its bigger than the finger segment, but I do not know how to get it smaller. I tried using the mesh itself as its own collision shape, but bullet does not seem to support mesh hulls for moving objects :/
You can uses BoxShape() for the fingers instead of ConvexHullShape(), but the offset need to be corrected for when doing so. Hulls are created around the center, boxes start at a corner.
ConvexHullShape expects the center of mass (COM) to be (0,0,0), but the cube is offset from the center, making it tilt towards the corner.
You can find the correct COM like this.
const int indexStride = 3 * sizeof(int);
const int vertexStride = 12;
int vertexCount = points.Count;
int indexCount = vertexCount / 3;
TriangleIndexVertexArray vertexArray = new TriangleIndexVertexArray();
IndexedMesh mesh = new IndexedMesh();
mesh.Allocate(vertexCount, vertexStride, indexCount, indexStride);
Vector3Array vdata = mesh.Vertices;
IntArray idata = mesh.TriangleIndices;
for (int i = 0; i < vertexCount; i++)
{
vdata[i] = points[i];
idata[i] = i;
}
vertexArray.AddIndexedMesh(mesh);
ConvexTriangleMeshShape shape = new ConvexTriangleMeshShape(vertexArray, true);
Matrix center = Matrix.Identity;
Vector3 inertia;
float volume;
shape.CalculatePrincipalAxisTransform(ref center, out inertia, out volume);
CompoundShape compound = new CompoundShape();
compound.AddChildShape(Matrix.Invert(center), shape);
As far as the shoudlers go in your ragdoll, are you using cone twist constraints for the upper arm? There are tricks to those, but it is version dependant due to bugs in various builds.
Just so we are on the same page, what version of Bullet are you using?
Some things are easy to explain, other things are not........ <- Store -> <-Freebies->
No i'm using 6DOF for all the joints.
Translation from and to Poser somewhat works, its not 100% I feel, maybe the rotation order is wrong or something else. Moreover, I'm initializing the bullet doll based on the posed figure (world geometry with world orientation of joints) because I wasn't sure I'm able to use the base geometry as bullet does not support scaling and Poser's world API's all have scaling included in the transformations.
The convextrianglemeshshape, I wonder what happens if the mesh is not totally convex?
Compound Shape wise, I thought of segmenting a Poser actor along its bone axis into several smaller convex pieces, to have a bit more precision. But the clumsy finger problem is I think different.
I also do not know if bullet creates the smallest convex hull or if its just any hull that is convex.
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Hi, I am trying to make a bridge poser<->bulletphysics, mainly to make a posing assistant. I know that Poser already learned some physics tricks but I want to have something under my control ;) For the moment I am trying to translate a Poser figure to a set of chained rigidbodies, have them processed by bullet and translate this back into a pose of the figure. This is to enable gravity and having collisions with other body parts and props in the scene. I wonder if there is someone here who knows bullet internals a bit and might want to jump in.