i try to use this Engine first time. I know about 3D
programming and wrote some programms with DirectX.
Now I am glad to see an Engine who takes some of the work. ^^
But now by Question:
I have an *.3ds Model. Just a white Box without Textures.
I want to set up a Point-Light with Per-Pixel-Lighting.
If I set up a Light in Irrlicht, it is Per-Vertex-Lighting???
What goes wrong?
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace video;
using namespace scene;
using namespace gui;
using namespace io;
#pragma comment(lib, "Irrlicht.lib")
int main(void)
{
IrrlichtDevice *Device = createDevice(video::EDT_DIRECT3D9,
core::dimension2d<s32>(800,600), 32,
false, false, false, 0);
Device->setWindowCaption(L"Irrlicht Test!");
IVideoDriver *Driver = Device->getVideoDriver();
ISceneManager *SceneManager = Device->getSceneManager();
IAnimatedMesh *Mesh = SceneManager->getMesh("F:/TestModel.3ds");
if (!Mesh)
{
Device->drop();
return -1;
}
SceneManager->getMeshManipulator()->
makePlanarTextureMapping(Mesh->getMesh(0), 0.003f);
ISceneNode *Node = SceneManager->addMeshSceneNode(Mesh->getMesh(0));
ILightSceneNode *Light = SceneManager->addLightSceneNode(Node,
vector3df(0, 0, 1.2), SColorf(0.5, 1, 0.5), 0.3);
if (!Light)
{
Device->drop();
return -1;
}
Node->setMaterialType(EMT_SOLID);
ICameraSceneNode *Camera = SceneManager->addCameraSceneNodeFPS(0, 100, 1);
Camera->setPosition(vector3df(2,2,2));
Camera->setTarget(vector3df(0,0,0));
Camera->setNearValue(1);
Camera->setFarValue(5);
Camera->setFOV(1.55);
Device->getCursorControl()->setVisible(false);
while (Device->run())
{
Driver->beginScene(true, true, 0xff000088);
SceneManager->drawAll();
Driver->endScene();
}
Device->drop();
return 0;
}