Announcement

Collapse
No announcement yet.

Correct way of handling large XY coordinate values

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Correct way of handling large XY coordinate values

    We recently converted our application from IJL (local coordinates) to XYZ (world coordinates). We have a root transform that relocates the scene graph to be about (0,0,0), however since the coordinate values are so large, we are running into all sorts of problems with regard to display and picking. This is most likely due to the float limit in OpenGL. Our XYZ values can be in the tens of millions. Whenever we zoom in close on an object like a surface, and rotate the scene, the scene flickers and becomes very jumpy. Also, the ray pick action does not return anything. Also, poly-lines are not displayed correctly on the surfaces and/or they jump around.

    What is the correct way to resolve this problem?

    Thanks,

    Jack

  • #2
    Originally posted by jackcook View Post
    We recently converted our application from IJL (local coordinates) to XYZ (world coordinates). We have a root transform that relocates the scene graph to be about (0,0,0), however since the coordinate values are so large, we are running into all sorts of problems with regard to display and picking. This is most likely due to the float limit in OpenGL. Our XYZ values can be in the tens of millions. Whenever we zoom in close on an object like a surface, and rotate the scene, the scene flickers and becomes very jumpy. Also, the ray pick action does not return anything. Also, poly-lines are not displayed correctly on the surfaces and/or they jump around.
    It's probably partly due to the graphics hardware being single precision, but also partly due to Open Inventor using single precision arithmetic in SbViewVolume and SoRayPickaction.

    One thing I forgot to mention in our previous conversation -- it's worth trying a simple experiment to see if the viewing jitters and picking work any better. Just set the environment variable OIV_DOUBLE_PRECISION to true (1) using SoPreferences or any equivalent method. This enables some experimental code that keeps viewing/picking parameters in single precision, but does the arithmetic in double precision for some (but not all) cases. There may be a small performance penalty for picking.

    Question: You said your XYZ values can be in the 10's of millions (geocentric meters?). That's before the root transform, right? What is the range of "local coordinates" relative to the root transform position?

    Comment


    • #3
      The 10's of millions is the larger case. Some of the XYZ coordinates for our smaller projects are in the range of:

      42,000 - 90,500
      7,791,695 - 7,844,600
      1,000 - 4,000

      and

      201,887 - 287,259
      172,768 - 316,146
      500 - 3,000

      The root transform simply shifts these coordinates such they straddle (0,0). Therefore, the numbers are not too large, it's only when we zoom in real close and try to rotate/pick that we experience problems.

      The XY's are geological coordinates (feet or meters) relative to a coordinate system.

      With regard to the OIV_DOUBLE_PRECISION, do you know if this is available in 8.5.x?

      Thanks,

      Jack

      Comment


      • #4
        Originally posted by jackcook View Post
        With regard to the OIV_DOUBLE_PRECISION, do you know if this is available in 8.5.x?
        Yes, it is.

        Comment


        • #5
          I have created an iv file which duplicates the problem in the scene viewer. Unfortunately the size exceeds the upload limits of this forum. I can make it available if anyone is interested.

          - Jack

          Comment


          • #6
            Originally posted by jackcook View Post
            I have created an iv file which duplicates the problem in the scene viewer. Unfortunately the size exceeds the upload limits of this forum. I can make it available if anyone is interested.
            Sure, it would be great to have an example to experiment with.
            Please upload it to the "incoming" directory on our ftp site (ftp.vsg3d.com) and email me the file name. Note you won't be able to list the contents of this directory.

            Comment


            • #7
              Originally posted by mikeheck View Post
              Sure, it would be great to have an example to experiment with.
              Please upload it to the "incoming" directory on our ftp site (ftp.vsg3d.com) and email me the file name. Note you won't be able to list the contents of this directory.
              Done. ShellExample.iv

              Thanks.

              Comment

              Working...
              X