Texturing of a Softbody.

Post Reply
xxwoLf
Posts: 1
Joined: Wed Apr 18, 2012 6:23 am

Texturing of a Softbody.

Post by xxwoLf »

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

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.
Post Reply