If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Lupinius
Posts: 11 Joined: Thu Apr 30, 2009 8:50 pm
Location: Emden, Germany
Post
by Lupinius » Sun May 03, 2009 1:34 pm
After a bit 2D I wanted to try something in 3D. But my Code doesn't work:
Code: Select all
#include <irrlicht.h>
using namespace irr;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#endif
int main() {
IrrlichtDevice *device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800, 600));
video::IVideoDriver *driver = device->getVideoDriver();
scene::ISceneManager *smgr = device->getSceneManager();
scene::IMesh *ship = smgr->getMesh("ship.x");
scene::ISceneNode *node = 0;
if (ship) {
node = smgr->addMeshSceneNode(ship);
}
if (node) {
node->setPosition(core::vector3df(0, 0, 0));
} else {
return 1;
}
smgr->addCameraSceneNodeMaya();
while (device->run()) {
driver->beginScene();
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
The application returns 0, so the mesh is being loaded.
CuteAlien
Admin
Posts: 9935 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Sun May 03, 2009 2:22 pm
First test the model in the meshviewer example. Does it show there?
Then use an FPS camera, it's easier to move around with that. I suppose right now your camera sits on the object and so it might be clipped by the near clipping plane.
Lupinius
Posts: 11 Joined: Thu Apr 30, 2009 8:50 pm
Location: Emden, Germany
Post
by Lupinius » Sun May 03, 2009 3:05 pm
I tried it with a FPS camera before, but now I tried to disable light and it works.
CuteAlien
Admin
Posts: 9935 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Sun May 03, 2009 3:20 pm
Ah - ok. Then it would probably also work if you add an additional lightscene node.