I've added an object and a camera attached to it (a 3rd person camera) to the terrain demo, and I've set simple movement controls.
the problem is that when I'm using the simple camera attached to the object, the terrain changes to a very angulous detail (all the elevations turn into piramid shape).
however when use the fps camera in free mode (without attaching it to the object), with the exact same terrain settings, the terrain looks smooth just like it was supposted to be (like in the terrain demo).
does anyone knows what's happening and how can I fix this?
thanks,
ice
here's my code (jirr - java):
__________________________
Code: Select all
// terrain scene node
ITerrainSceneNode terrain = smgr.addTerrainSceneNode("../media/terrain.bmp");
terrain.setScale(new vector3df(40, 3, 40));
terrain.setMaterialFlag(E_MATERIAL_FLAG.EMF_LIGHTING, false);
terrain.setMaterialTexture(0, driver.getTexture("../media/terrain_texture.jpg"));
terrain.setMaterialTexture(1, driver.getTexture("../media/detailmap3.jpg"));
terrain.setMaterialType(E_MATERIAL_TYPE.EMT_DETAIL_MAP);
terrain.scaleTexture(1.0f, 20.0f);
// object creation
IAnimatedMesh mesh = smgr.getMesh("../media/barrel01.3ds");
IAnimatedMeshSceneNode object = smgr.addAnimatedMeshSceneNode(mesh);
object.setMaterialFlag(E_MATERIAL_FLAG.EMF_LIGHTING, false);
object.setPosition(new vector3df(1000, 150, 2500));
object.setScale(new vector3df(1, 0.1f, 0.7f));
// attach a camera to the object
ICameraSceneNode camera = smgr.addCameraSceneNode();
camera.setPosition(new vector3df(0, 350, -150));
camera.setTarget(object.getPosition());
camera.setFarValue(12000.0f);
object.addChild(camera);