Oldschool

03-29-2008, 05:27 AM

I'm not sure if this has been answered before, but I dont know what I should search for to answer my problem, as Im not quite sure what is wrong.

Simply put, when I move the camera around, whenever an object is within view, it seems like only random faces of it is rendered.

Even gl-lines are rendered randomly, but if the camera is standing still, there is no flickering.

This leads me to belive there are some rounding/calculation/accuracy problem somewhere.

Since the resulting calculation from a specific angle always is the same, there is never flickering when the camera is still.

For this problem, I have tried to switch everything I use from floats to doubles, but with no difference.

My program uses extremely large objects (scaled big, not many polygons).

I use textured Quadric spheres.

I also translate the objects very far away (since they are so big).

This problem arose when I started making the objects really big, and translating them very far away.

My frustrum looks something like this

gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 0.1, 100000000.0);

And, the objects beeing translated are moved something like 50000000000000 (13 zeroes) or 5.0*10^13 if you prefer.

I'm guessing the problem lies here, but I dont know why it is a proble, nor what I can do to fix it.

Another interesting features, is that if objects are close to the centre of my scene (not translated far), they dont have this bug.

Of course, using smaller objects translated shorter is a solution, but it would not be a good solution for me, as I would like to be able to place objects where they are supposed to be.

Anyone got any ideas?

Simply put, when I move the camera around, whenever an object is within view, it seems like only random faces of it is rendered.

Even gl-lines are rendered randomly, but if the camera is standing still, there is no flickering.

This leads me to belive there are some rounding/calculation/accuracy problem somewhere.

Since the resulting calculation from a specific angle always is the same, there is never flickering when the camera is still.

For this problem, I have tried to switch everything I use from floats to doubles, but with no difference.

My program uses extremely large objects (scaled big, not many polygons).

I use textured Quadric spheres.

I also translate the objects very far away (since they are so big).

This problem arose when I started making the objects really big, and translating them very far away.

My frustrum looks something like this

gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 0.1, 100000000.0);

And, the objects beeing translated are moved something like 50000000000000 (13 zeroes) or 5.0*10^13 if you prefer.

I'm guessing the problem lies here, but I dont know why it is a proble, nor what I can do to fix it.

Another interesting features, is that if objects are close to the centre of my scene (not translated far), they dont have this bug.

Of course, using smaller objects translated shorter is a solution, but it would not be a good solution for me, as I would like to be able to place objects where they are supposed to be.

Anyone got any ideas?