sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Strange GL draw method behavior

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 454 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Didier BurD Offline
      Didier Bur
      last edited by

      Hi,
      Don't know if it has been discussed before but I have found no response to this question:
      Why view.draw GL_QUADS always draws the quads with a black color ?

      This doesn't work:

      view.drawing_color="red"
      view.draw_line p1,p4
      view.draw GL_QUADS , [p1,p2,p3,p4]
      view.draw GL_QUADS, [p5,p6,p7,p8]
      

      line is red but quads are black 😞
      Anyone encountered this before ?

      DB

      1 Reply Last reply Reply Quote 0
      • J Offline
        jhauswirth
        last edited by

        This is just a guess, but polygons need normals to do lighting, so the default normals are probably causing the bad lighting.
        Let's say the normals default to 0,0,0- then that would give you a 0,0,0 for color.

        1 Reply Last reply Reply Quote 0
        • Didier BurD Offline
          Didier Bur
          last edited by

          Changing the point's ordering doesn't solve the problem, so it seems not to be a question of normal.
          Same goes with GL_TRIANGLES.

          DB

          1 Reply Last reply Reply Quote 0
          • J Offline
            jhauswirth
            last edited by

            The real question is how do you specify the normals? You're just giving GL_QUADS the vertices.

            1 Reply Last reply Reply Quote 0
            • Didier BurD Offline
              Didier Bur
              last edited by

              Hi,
              Nothing specified in the docs concerning normals. Doc is so sparse you know... πŸ‘Ž I guessed that passing points in a counterclockwise order was orienting the normal up (assuming that these points are on an horizontal plane) ?
              You can notice that once drawn, quads are visible from both sides. Is the normal useless or am I completely wrong ?

              DB

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement