Help: How to determine the node id of a convex shape?

User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Help: How to determine the node id of a convex shape?

Post by Garibalde »

Hi

I have some objects that i load into a simulation that are created by doing a createconvex() function.
After the object is created i did like to fix some of the node points by setting their mass to 0 like so
setmass(Nodeid, 0); How do you determine what the node numbers are for an object.

As an example i have a cube made up of many triangles. I would like to set the center node of on of the faces to mass = 0. How can i find what that node id is to do this. Is there a tool of some sort to help with this process, 3dsmax or bender or something where i can easily determine the node numbers so that i can use them in the phsyics engine?

Thanks
Garibalde
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Help: How to determine the node id of a convex shape?

Post by Erwin Coumans »

I can't find the 'createconvex' function in the Bullet library, can you be more precise?

What function is it exactly, and what collision shape does it involve (btConvexHullShape?)

Thanks a lot,
Erwin
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Help: How to determine the node id of a convex shape?

Post by Garibalde »

yes it is a btConvexHullShape.

My problem is that i am trying to find an easy way to know which vertices to clamp down (set as boundary
condictions) so my objects will be anchored to something when it is poked. Right now as it is poked the object
moves away as expected.

i wanted to know if there was some sort of tool to see the nodal number of an object so that i may pick the anchorinf indices from it.

Garibalde
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Help: How to determine the node id of a convex shape?

Post by Erwin Coumans »

Again, which function are you using exactly? I cannot find "createconvex", and "setmass" neither.

Also, what do you mean by node or nodal number?

Thanks,
Erwin
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Help: How to determine the node id of a convex shape?

Post by Garibalde »

SetMass is part of btSoftBody class

Code: Select all

void setMass(int node, btScalar mass);
CreateConvex is part of BtOgre Wrapper Class defined as follows

Code: Select all

btConvexHullShape* VertexIndexToShape::createConvex()
{
      assert(mVertexCount && (mIndexCount >= 6) && 
               ("Mesh must have some vertices and at least 6 indices (2 triangles)"));

      return new btConvexHullShape((btScalar*) &mVertexBuffer[0].x, mVertexCount, sizeof(Vector3));
	}
I am trying to fix some node in the softbody so that the body is anchored. I am having a hard time to figure out which node (int) in the SetMass function to use since i do not know the node
placement of the object, is there a tool that will help me define the nodes numbering?

Thanks

Garibalde