cannot use BillboardTextSceneNode and draw3dLine together
Posted: Fri Nov 14, 2008 4:26 am
hi everyone
i cannot use billboardtext scene and draw3dline line together ,example below
i it really cannot is there other way to do it?
thanks
i cannot use billboardtext scene and draw3dline line together ,example below
i it really cannot is there other way to do it?
thanks
Code: Select all
#include <irrlicht.h>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
// create device
IrrlichtDevice* device = createDevice( video::EDT_OPENGL, core::dimension2d<s32>(640, 480),
16, false, false, true);
if (device == 0)
return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
scene::ICameraSceneNode * cam = smgr->addCameraSceneNodeMaya();
cam->setPosition(core::vector3df(50,50,50));
cam->setTarget(core::vector3df(0,0,0));
gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont();
// if i not include this billboardtextscene node i can draw the 3d line
scene::ITextSceneNode*n = smgr->addBillboardTextSceneNode(font,L"yahoo",0,core::dimension2d< f32 >(10,10),
core::vector3df(0,0,0),20,video::SColor(100,100,100,100),video::SColor(100,100,100,100));
while(device->run())
{
driver->beginScene(true, true, video::SColor(255,255,255,255));
smgr->drawAll(); // draw the 3d scene
driver->draw3DLine(core::vector3df(0,0,0), core::vector3df(50,0,0),
video::SColor(255,255,0,0));
driver->draw3DLine(core::vector3df(0,0,0), core::vector3df(0,50,0),
video::SColor(255,0,255,0));
driver->draw3DLine(core::vector3df(0,0,0), core::vector3df(0,0,50),
video::SColor(255,0,0,255));
driver->endScene();
}
device->drop();
return 0;
}