Results 1 to 3 of 3

Thread: Triangle cutouts in my cube

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    2

    Triangle cutouts in my cube

    When I run the program the left and right sides have cutouts in them. It's supposed to be a cube.
    http://pastebin.com/m6a338d5f
    I can't figure out the problem or what makes those sides different at all.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    374

    Re: Triangle cutouts in my cube

    The ordering of the vertices in your last two quads ('Right' and 'Left') is incorrect. I assume you know that you can't list vertices in any order. They must be listed in the order that traces around the outside of the quad (i.e. specifying the edges of the quad). In your last two quads you have specified edges that cut through the diagonal of the quad. The correction is simple, just switch the 3rd and 4th vertex commands in your 'Right' and 'Left' quads. BTW - if you run into a problem like this again, draw the object in wireframe, which shows the quad or poly edges clearly. Then things will make sense to you.
    Am I doing your homework for you?

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    2

    Re: Triangle cutouts in my cube

    Thank you, I can't believe I missed that.

Similar Threads

  1. OpenGL Android - Rotate objects other than a cube or triangle
    By androidDev in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-20-2016, 07:03 PM
  2. Drawing a cube and a triangle in different positions
    By many-as-one in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-11-2014, 12:33 PM
  3. Replies: 3
    Last Post: 10-09-2012, 09:39 PM
  4. triangle strip with a LINE triangle display error
    By Samme in forum OpenGL: Windows
    Replies: 22
    Last Post: 11-20-2008, 07:50 PM
  5. OT: fastest ray-triangle line -triangle intersection algo
    By V-man in forum OpenGL: Advanced Coding
    Replies: 23
    Last Post: 08-28-2002, 02:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean