About the opacity of softbody and rigidbody in Bullet

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?
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm
Contact:

Re: About the opacity of softbody and rigidbody in Bullet

Post by dphil »

[Note: Topic moved from Career Opportunities]

This sounds like a graphics issue, not a physics one, so I would consult graphics forums. Offhand, my first guess would be to ensure appropriate drawing order of your renderables (see http://www.opengl.org/archives/resource ... arency.htm). Also, I'm assuming you mean "I can not see rigidbodies through the cloth". If you can, then transparency should be working :) .
Post Reply