Hey Spintz, awesome demos BUT i can't get the code to work!

It compiles ok and i applied those 32-16bit changes but it still doesn't work... It seems to be that rather than running the terrain strips parallel, it just sticks em on top of each other
I was using 0.6 but i switched because i thought it was the problem and the same thing happens with 0.7.1

I've got an ATI Radeon 9600XT and i'm using .net 2003 and i've tried *all* driver options yet there's no difference... See further down for my test app's main function (it uses the textures from your demos cause i wanted to make sure it all worked) If you want i can also upload my engine source somewhere too (or parts of it)
This is annoying me because i really do want to use this terrain system because it's so damn good! I could use LibMini but it'd be better to get this one working...
PS. I have added other addons to my irrlicht's source. (RTS camera, MD3 loader and skydome support)
Code: Select all
#include <irrlicht.h>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice *device =
createDevice(video::EDT_DIRECTX9, core::dimension2d<s32>(640, 480),32);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
// driver->setTextureCreationFlag(video::ETCF_OPTIMIZED_FOR_QUALITY,true );
scene::IGeoMipMapSceneNode *node = smgr->addGeoMipMapSceneNode(0,-1,5,17,
core::vector3df ( 0.0f, 0.0f, 0.0f ),
core::vector3df ( 0.0f, 0.0f, 0.0f ),
core::vector3df ( 100.0f, 0.0f, 100.0f ));
node->LoadHeightMap("freeworld04.bmp");
node->setMaterialTexture(0,driver->getTexture("grassdetail.bmp"));
node->setMaterialTexture(1,driver->getTexture("freeworld04_lightmap.bmp"));
node->setMaterialFlag(video::EMF_LIGHTING,false);
// node->setMaterialFlag(video::EMF_WIREFRAME,true);
node->setMaterialType(video::EMT_LIGHTMAP);
scene::ITriangleSelector *selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
video::SMaterial material;
material.Texture1 = 0;
material.Lighting = false;
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,100,100,100));
smgr->drawAll();
core::line3d<f32> line;
line.start = camera->getPosition();
line.end = line.start + (camera->getTarget() - line.start).normalize() * 1000.0f;
core::vector3df intersection;
core::triangle3df tri;
if (smgr->getSceneCollisionManager()->getCollisionPoint(line, selector, intersection, tri))
{
driver->setTransform(video::ETS_WORLD, core::matrix4());
driver->setMaterial(material);
driver->draw3DTriangle(tri, video::SColor(0,255,0,0));
}
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
wchar_t tmp[1024];
swprintf(tmp, 1024, L"Terrain Example - Irrlicht Engine (fps:%d) Triangles:%d",
fps, driver->getPrimitiveCountDrawn());
device->setWindowCaption(tmp);
lastFPS = fps;
}
}
device->drop();
return 0;
}
It seems weird that the demos work fine yet my compiled versions f00k
