Draw a tile on Floor
-
ansu832001
- Posts: 95
- Joined: Thu Mar 01, 2007 6:39 am
Draw a tile on Floor
Can anyone help me on how to draw a Floor??it is ok even if iam able to draw a single tile
Use the scene manager method addHillPlaneMesh to create a planar mesh. Create a mesh scene node from that.
Code: Select all
core::dimension2df tileSize(10.f, 10.f);
core::dimension2di tileCount(100, 100);
f32 hillHeight = 0.f;
core::dimension2df hillCount(0.f, 0.f);
core::dimension2df textureRepeat;
textureRepeat.Height = tileCount.Height / tileSize.Height;
textureRepeat.Width = tileCount.Width / tileSize.Width;
scene::IAnimatedMesh* mesh =
smgr->addHillPlaneMesh("floor", tileSize, tileCount, 0, hillHeight, hillCount, textureRepeat);
if (mesh)
{
scene::IMeshSceneNode* floor = smgr->addMeshSceneNode(mesh->getMesh(0));
floor->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
floor->setMaterialFlag(video::EMF_LIGHTING, false);
}
Code: Select all
sm->getSceneCollisionManager()->getCollisionPoint(
line, metaSelector, end, triangle)
can you brief how to rotate the plane to my triangle angle.
Code: Select all
sm->getSceneCollisionManager()->getCollisionPoint(
line, metaSelector, end, triangle) 