Need help with simpla programm...

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.
Post Reply
Lupinius
Posts: 11
Joined: Thu Apr 30, 2009 8:50 pm
Location: Emden, Germany

Need help with simpla programm...

Post by Lupinius »

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 »

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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Lupinius
Posts: 11
Joined: Thu Apr 30, 2009 8:50 pm
Location: Emden, Germany

Post by Lupinius »

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 »

Ah - ok. Then it would probably also work if you add an additional lightscene node.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply