• Login
sketchucation logo sketchucation
  • Login
ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

Strange GL draw method behavior

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 2 Posters 403 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.
  • D Offline
    Didier Bur
    last edited by 2 Oct 2008, 16:16

    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 2 Oct 2008, 19:04

      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
      • D Offline
        Didier Bur
        last edited by 2 Oct 2008, 20:04

        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 2 Oct 2008, 22:39

          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
          • D Offline
            Didier Bur
            last edited by 3 Oct 2008, 21:10

            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
            1 / 1
            • First post
              2/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement