About the opacity of softbody and rigidbody in Bullet

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Post Reply
wolves86
Posts: 8
Joined: Wed Dec 14, 2011 11:46 am

About the opacity of softbody and rigidbody in Bullet

Post by wolves86 »

Hello everyone:
I used CreatePatch function to get a big cloth and rendered the triangles using the following code.

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_TRIANGLES);
glColor4f(color.getX(), color.getY(), color.getZ(),0.5);
glNormal3d(n.getX(),n.getY(),n.getZ());
glVertex3d(a.getX(),a.getY(),a.getZ());
glVertex3d(b.getX(),b.getY(),b.getZ());
glVertex3d(c.getX(),c.getY(),c.getZ());
glEnd();
glDisable(GL_BLEND);
I can get a transparent cloth with the opacity parameter equal 0.5. But the cloth will shelter rigidbodies. That is to say, I can see rigidbodies through the cloth. So could you help me?
Post Reply