Texturing of a Softbody.
Posted: Wed Apr 18, 2012 9:22 am
Hi,
I am new to BulletPhysics and a openGL beginner. I am working on the paper falling softbody demo (Aero)in the demo applications provided. I am trying to texture the falling cloth/paper. I am working over for two days but didnt had much luck, also couldnt find any particular way how I can texture the softbody using a jpg png image from harddisk.
Is there any way using btSoftBodyHelpers or btdebugdraw?
here is some bit of my renderme() routine
Regards,
Paras.
I am new to BulletPhysics and a openGL beginner. I am working on the paper falling softbody demo (Aero)in the demo applications provided. I am trying to texture the falling cloth/paper. I am working over for two days but didnt had much luck, also couldnt find any particular way how I can texture the softbody using a jpg png image from harddisk.
Is there any way using btSoftBodyHelpers or btdebugdraw?
here is some bit of my renderme() routine
Code: Select all
btIDebugDraw* idraw=m_dynamicsWorld->getDebugDrawer();
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
m_dynamicsWorld->debugDrawWorld();
int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
{
btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i];
if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
{
//btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());
}
}
Regards,
Paras.