Advertisement

OpenGl precision

Started by April 16, 2003 02:37 AM
2 comments, last by gotchaman 21 years, 10 months ago
Hello boys and girls, I''m coding a graph paper like 2D grid in openGl with realtime mouse controls for zooming and panning. I found out that it all works nicely when I''m around the origin but if I pan very far, several thousands of units away from the origin, then the lines start wobbling slightly and precision seems to be an issue. I checked my code many times and it looks like it''s more of a precision problem although I am using doubles all over the place and drawing the graph lines with glVertex2d to make sure there isn''t a float/double precision issue. Do you see what I mean ? Any idea on why this is happening ? Cheers, e.
if you are running this on a consumer level video card then it''s quite likly that the values are being truncated to floating point precision. Also know that extremly long lines/large triangles will cause accuracy problems with frustum clipping.

| - Project-X - my mega project.. getting warmer - | - adDeath - an ad blocker I made - | - email me - |
Advertisement
Thanks for your reply.
The thing is that the lines are drawn from the very edge of the viewport so there is no clipping issue. I am using an nVidia Quadro 4 750XGL which is quite an expensive card actually. Any other idea?
Precision issues are not directly related to the OpenGL API itself, it is the driver and the hardware that define the precision.

Whether you send double-precision or single-precision floating-point value does not ensure that this precision will be used. You may call glVertex2d but for optimization reasons the driver or the hardware may truncate the values to single-precision.

This topic is closed to new replies.

Advertisement