Here is my code and the output am getting is a messed up mesh.. Can you please point out the mistake???
Code: Select all
#include <irrlicht.h>
#include <iostream>
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") //// To Disable the console window ////
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
// The irrlicht device is the most important of all, running irrlicht: //
IrrlichtDevice *device = createDevice( EDT_DIRECT3D9 ); /// will create an irrlicht device with DIRECTX rendering.
IVideoDriver* video = device->getVideoDriver(); /// grabs the Video Driver from the irrlicht device.
ISceneManager* smgr = device->getSceneManager(); /// That code pretty much grabs the scene manager from the irrlicht device. the scene manager is how
/// you will handle irrlicht from here on out, from creating a cube to adding complex animators.
IMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IMeshSceneNode* node = smgr->addMeshSceneNode( mesh );
ICameraSceneNode* cam = smgr->addCameraSceneNode(0, vector3df(0,30,-45));
while(device->run() && device) {
video->beginScene(true, true, video::SColor(255,0,0,255));
smgr->drawAll();
video->endScene();
}
}