quickly ; my app merge newton and irrlicht, got a vehicle on a terrain. All the scene is prepared before entering the rendering loop. 3 cameras are set up there ; cockpit cam, fps cam and a mayacam. Then the vehicle is created and the cockpit cam is attached to it. What I see is that there is a LOD problem using only the cockpit cam (can switch bethween cam at run time). It seems that the reference camera position for the LOD rendering stayed at the origin of the terrain(not the point of view) and if I move the vehicle far away, I sometime drive under the ground and the landscape is ugly(low lod). But the vehicle still collide coerently with the terrain. Don't know if it's clear there...
anyone noticed that ?
THX.
terrain LOD problem with camera
I've read my code again and did not find something wrong but anyway I'am not an experienced C++ coder.
To help you Spintz, my heightmap is scaled 400 times on both x&y axes. I've tried other cam class found and this furum and all show the same pb as soon as attach those one to the vehicle. (vehicle : parent node + 2 billboard for the cam pos and cam dir).
did you find anything ?
To help you Spintz, my heightmap is scaled 400 times on both x&y axes. I've tried other cam class found and this furum and all show the same pb as soon as attach those one to the vehicle. (vehicle : parent node + 2 billboard for the cam pos and cam dir).
did you find anything ?
in file CTerrainSceneNode.cpp change line 232 from:
core::vector3df cameraPosition = SceneManager->getActiveCamera()->getPosition ( );
to
core::vector3df cameraPosition = SceneManager->getActiveCamera()->getAbsolutePosition ( );
The problem with your code is that you set your camera as child, and in that case getPosition() returns the offset from the parent not the position in global space... getAbsolutePosition will help IMHO.
core::vector3df cameraPosition = SceneManager->getActiveCamera()->getPosition ( );
to
core::vector3df cameraPosition = SceneManager->getActiveCamera()->getAbsolutePosition ( );
The problem with your code is that you set your camera as child, and in that case getPosition() returns the offset from the parent not the position in global space... getAbsolutePosition will help IMHO.