Hey, i read a post on using billboards for 2D objects in 3D space but don't billboards ONLY face the camera?
I don't want a screen space 2d rectangle or a billboard (if billboards only face forward)
Is there a way to render a texture to a plane? I'm looking for something that renders a 2D object that i can scale/rotate as if it were a 3D mesh. In Ogre i used the Mesh Manager to create a plane and then just mapped a texture to it as it was an entity.
Is there a way to do something similar with Irrlicht?
2D Plane in 3D (not a 2D overlay)
You can create a plane mesh using the addHillPlaneMesh() method provided by the scene manager. That will get you an IAnimatedMesh*. You will want to get an IMesh* from that, and then make an IMeshSceneNode with that.
Code: Select all
core::dimension2df tileSize(10.f, 10.f);
core::dimension2df tileCount(10, 10);
scene::IAnimatedMesh* am = smgr->addHillPlaneMesh("plane", tileSize, tileCount);
if (am)
{
scene::IMeshSceneNode* msn = smgr->addMeshSceneNode(am->getMesh(0));
// msn->setPosition(...);
// msn->setScale(...);
// msn->setRotation(...);
msn->setTexture(0, driver->getTexture("../../media/water.jpg"));
msn->setMaterialFlag(video::EMF_LIGHTING, false);
}