The code below renders a gray scene with a black model(ss is below), but for some reason, the model is incomplete. I imported the .3ds file back into 3dsmax to make sure I exported it correctly, and the entire model is there. Wondering if it has something to do with the code (which seems unlikely to me)
http://img296.imageshack.us/my.php?image=renderzt0.png
Also to check if the results I am getting are correct for the model that is there, when using "node->setMaterialFlag(EMF_LIGHTING, false);" should the model then just be a flat gray color (a bit darker than the background so it is still visible)
Code: Select all
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main() {
IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<s32>(640, 480));
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive("C:\\Documents and Settings\\Greg Computer\\Desktop\\city.zip");
scene::IAnimatedMesh* mesh = smgr->getMesh("city.3ds");
scene::ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0), 0, -1, 128);
if (node)
node->setPosition(core::vector3df(-1300,-144,-1249));
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
while(device->run())
{
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,200,200,200));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
else
device->yield();
}
device->drop();
return 0;
}