Huge world with anxious vertexes...

Started by blue_tomato, August 06, 2006, 14:10:13

Previous topic - Next topic

blue_tomato

I am rendering an earth scale object, and have run into some precision problems. When the camera is close to the surface the vertexes are getting anxious, and are shaking and shivering.

Further away the movement seems very smooth though, and if I scale down the world by a factor of 100 there are no issues either (However, I really would like to keep the current scale if possible, as scaling down has numerous side effects it would take much efforts to weed out)...

So, I imagine this happens because of the lack of precision during the matrix transformation. This is the code I use to set up the view matrix:

       GLU.gluLookAt(camera.origin.x, camera.origin.y, camera.origin.z,
                camera.origin.x-camera.front.x*10.f, camera.origin.y-camera.front.y*10.f, camera.origin.z-camera.front.z*10.f,
                camera.up.x, camera.up.y, camera.up.z
        );


The camera/world coordinates are in the scale of 60.000.000.

I read somewhere this is a known problem, and there is a fix for it by modifying the way openGL handles the camera transformation.

Unfortunately I am an OpenGL newbie, so I have no idea how to do this.

Help would be much appreciated! :)