Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.2
    • Fix Version/s: not determined
    • Component/s: j3d-core-utils
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      621

      Description

      The face is in x,z plane and rotates counter clockwise when viewed from the
      direction of (0,-1,0). The face has one concave part, otherwise it is rectangle.
      When I remove the concave part, the normals are flipped to the correct
      orientation.

      I'll attach a simple Java class to demonstrate the problem. In the class there are
      four lines marked with // hide. When these lines are commented, the normals are
      flipped.

        Activity

        Hide
        paasiala added a comment -

        Created an attachment (id=379)
        Sample code to duplicate the problem

        Show
        paasiala added a comment - Created an attachment (id=379) Sample code to duplicate the problem
        Hide
        paasiala added a comment -

        The problem seems to be caused by the fact that the face starts with a concave
        turn. If I order the points so that they start from a convex part, I get correct
        results. If I have the following points:

        <code>
        Point3d[] p1 =

        { new Point3d(51.8,15.5,0.0), new Point3d(51.8,15.5,3.0), new Point3d(17.0,15.5,3.0), new Point3d(17.0,15.5,0.0), new Point3d(36.3,15.5,0.0), // hide new Point3d(36.3,15.5,2.7), // hide new Point3d(37.5,15.5,2.7), // hide new Point3d(37.5,15.5,0.0), // hide // Hole new Point3d(18.6,15.5,0.1), new Point3d(18.6,15.5,2.6), new Point3d(20.0,15.5,2.6), new Point3d(20.0,15.5,0.1), }

        ;
        </code>

        the normals are generated properly.

        Pasi

        Show
        paasiala added a comment - The problem seems to be caused by the fact that the face starts with a concave turn. If I order the points so that they start from a convex part, I get correct results. If I have the following points: <code> Point3d[] p1 = { new Point3d(51.8,15.5,0.0), new Point3d(51.8,15.5,3.0), new Point3d(17.0,15.5,3.0), new Point3d(17.0,15.5,0.0), new Point3d(36.3,15.5,0.0), // hide new Point3d(36.3,15.5,2.7), // hide new Point3d(37.5,15.5,2.7), // hide new Point3d(37.5,15.5,0.0), // hide // Hole new Point3d(18.6,15.5,0.1), new Point3d(18.6,15.5,2.6), new Point3d(20.0,15.5,2.6), new Point3d(20.0,15.5,0.1), } ; </code> the normals are generated properly. Pasi
        Show
        paasiala added a comment - With "Newell's method" I found an algorithm that could be used to calculate the face normals. One link to that is here: http://books.google.fi/books?id=xmW_u3mQLmQC&pg=RA1-PA231&lpg=RA1-PA231&dq=%22Newell%27s+method%22&source=bl&ots=Z5Y8ESLdMl&sig=G3aaVTpZNLLZ2zzZHI1WjsueugM&hl=fi&ei=6xxkSv-QBone-QaXmvD0DA&sa=X&oi=book_result&ct=result&resnum=7

          People

          • Assignee:
            java3d-issues
            Reporter:
            paasiala
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: