1) Remove the quake map. That's right. The demo loads a bsp file, which is a pre-light terrain+object mesh. I want to remove this from the demo. If I comment out the
line, the demo starts normally, there's no terrain or castle loaded (as you'd expect), but the fireball shooting doesn't work anymore (pressing space or clicking mouse does nothing. No sound, no graphics). I can't for the life of me figure out why.quakeLevelMesh = (scene::IQ3LevelMesh*) sm->getMesh("maps/20kdm2.bsp");
2) Add coordinates to the infobox. Currently there's a
Code: Select all
swprintf(tmp, 255, L"%ls fps:%3d triangles:%0.3f mio",
driver->getName(),
driver->getFPS(),
(f32) driver->getPrimitiveCountDrawn( 1 ) * ( 1.f / 1000000.f )
);
Code: Select all
core::vector3df camPosTest = smgr->getActiveCamera()->getAbsolutePosition();
3) Add a terrain. Like for instance something like this :
Code: Select all
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(path+"terrain.bmp",
0, // parent node
-1, // node id
core::vector3df(0.f, 0.f, 0.f), // position
core::vector3df(0.f, 0.f, 0.f), // rotation
core::vector3df(1.f, 1.f, 1.f), // scale
video::SColor ( 255, 255, 255, 255 ), // vertexColor
5, // maxLOD
scene::ETPS_17, // patchSize
8 // smoothFactor
);
terrain->setMaterialFlag(video::EMF_LIGHTING, true);
terrain->setMaterialTexture(0,
driver->getTexture(path+"texture.jpg"));
terrain->setMaterialTexture(1,
driver->getTexture(path+"details.png"));
terrain->setMaterialType(video::EMT_DETAIL_MAP);
terrain->scaleTexture(1.0f,20.0f);
terrain->setMaterialTexture(2,
driver->getTexture(path+"lightmap.jpg"));
4) Add an object. Even if you don't have a terrain, you should be able in principle to load an extra object. Or so I'd think. Something like
Code: Select all
scene::IMesh* newtowerm;
scene::IMeshSceneNode* newtower;
newtowerm =smgr->getMesh("newtower.x");
newtower = smgr->addOctTreeSceneNode(newtowerm);
newtower->setPosition(core::vector3df(70,35,510));
newtower->setRotation(core::vector3df(0,30,0));
newtower->setMaterialFlag(video::EMF_LIGHTING, true);
I've been working for a few days trying to grasp what I'm doing wrong with all these, but I'm not getting very far. I'm pretty well convinced by now it's ridiculously obvious stuff that I'll notice on my own probably in 2011, so if somebody would take the time to point it out it'd be much appreciated. Thanks.