[ODE] Please correct my code (about Transform Geometry)~

ÃÖÁöÇö honestee at empal.com
Thu Feb 5 16:49:49 MST 2004


I have a problem..and I don't know what is problem..T_T...
I tested Transform Geometry to make a chair...
But It wouldn't work as I expect...

I have a two box...
First one is what doesn't use Transform Geometry...it is just ordinary box...so It works good..
Second one uses Transform Geometry....This wouldn't work! T_T (it penetrate ground-_-;;)

I created second box like this :

	gs_bodyBigBox = dBodyCreate(gs_worldID);

	dMass massBigBox;
	dMassSetBox(&massBigBox, 1, 1.0f, 1.0f, 1.0f);
	dMassAdjust(&massBigBox, 0.1f);

	dBodySetPosition(gs_bodyBigBox, -1.0f, 7.0f, 0.0f);

	gs_geomBigBox = dCreateBox(0, 2.0f, 2.0f, 2.0f);
	dGeomTransformSetCleanup(gs_geomBigBoxT, 1);
	gs_geomBigBoxT = dCreateGeomTransform(gs_spaceID);
	dGeomTransformSetGeom(gs_geomBigBoxT, gs_geomBigBox);
	dGeomSetPosition(gs_geomBigBox, 0.0f, 0.0f, 0.0f);
	dBodySetMass(gs_bodyBigBox, &massBigBox);

	dGeomSetBody(gs_geomBigBoxT, gs_bodyBigBox);

and rendered like this :

	float matBigBox[4*4];
	float matBigBoxT[4*4];
	float matBigBoxE[4*4];
	ODEGeomGetTransform(matBigBoxT, gs_geomBigBoxT);
	dGeomID geomE = dGeomTransformGetGeom(gs_geomBigBoxT);
	ODEGeomGetTransform(matBigBoxE, geomE);
	Mat44Mul(matBigBox, matBigBoxE, matBigBoxT);
	SetModelViewMatrix(matBigBox, v);

	SetColor(1.0f, 1.0f, 1.0f, 1.0f);
	RenderBox(2.0f, 2.0f, 2.0f);



Please TEACH ME what is problem to play with this boxes happily~ (^^)

p.s. refer to :
source snip : http://www.honestee.net/test.cpp
exe test file : http://www.honestee.net/test.exe







---------------------------------------------------------------------
Get your own 30MB free email at http://www.empal.com


More information about the ODE mailing list