Code: Select all
irr::scene::ICameraSceneNode *cam = smgr->addCameraSceneNodeMaya(0, -1500.f, 200.f, 150.f, -1, 3.f, true);
cam->setTarget(model->getAbsolutePosition());
// add lights
scene::ILightSceneNode* light1 = smgr->addLightSceneNode(0, core::vector3df(100, 100, 100), video::SColorf(1.0f, 1.0f, 0.8f, 0.0f), 400.0f);
scene::ILightSceneNode* light2 = smgr->addLightSceneNode(0, core::vector3df(100, 100, 100), video::SColorf(1.0f, 1.0f, 0.8f, 0.0f), 400.0f);
while(device->run())
{
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(255, 100, 101, 140));
light1->setPosition(cam->getPosition() + core::vector3df(50, -50, 50)); //left side light
light2->setPosition(cam->getPosition() + core::vector3df(-50, -50, 50)); //right side light
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
}
Mat