Results 1 to 6 of 6

Thread: 'Red Book' Query

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    Melbourne, VIC, Australia
    Posts
    8

    'Red Book' Query

    Just wondering if anyone has read (or is reading) the Third Edition of the 'OpenGL Programming Guide' (AKA 'Red Book').

    If so i have a question relating to Example 2-6 (page 61-62). It is regarding Polygon stippling. Anyway, I just wanted to know how the hex numbers in the 'fly' array represent the picture of the fly. I understand about converting the Hex to Binary and a '1' is drawn and nothing is drawn where a '0' occurs. But I just can't physically see the pattern of the fly appearing within these Hex numbers?

    Can anyone help me out? I would appreciate it!

    Cheers,

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: 'Red Book' Query

    You need to watch the Matrix a few more times, once you get good enought with coding you can see the results without even running the program....

    Once you become one with the computer you will be able to see the fly in the hex code...




    Originally posted by meez:
    Just wondering if anyone has read (or is reading) the Third Edition of the 'OpenGL Programming Guide' (AKA 'Red Book').

    If so i have a question relating to Example 2-6 (page 61-62). It is regarding Polygon stippling. Anyway, I just wanted to know how the hex numbers in the 'fly' array represent the picture of the fly. I understand about converting the Hex to Binary and a '1' is drawn and nothing is drawn where a '0' occurs. But I just can't physically see the pattern of the fly appearing within these Hex numbers?

    Can anyone help me out? I would appreciate it!

    Cheers,

  3. #3
    Guest

    Re: 'Red Book' Query

    I have an older copy of the book, and the "fly" is on p. 60 for me.
    If you would write out the bits of each byte sequentially you will see that the "1s" make the white lines and the "0s" make the black.
    The first line is all zeros, so that will be all black. The second line, first number, is 0x03, which is 0000000000000011 in binary bits. The second number is 0x80, which is 0000100000000000, the third is 0x01 which is 0000000000000001. The fourth is 0xC0, which is 0000110000000000. The previous page ( page 59 for my book ) has a picture of this with the binary values labeled, though the colors are reversed from the picture on p. 60 with 1s being black and 0s being white ( don't know why they chose this contradiction ). Good luck,
    stereo_barryo

  4. #4
    Guest

    Re: 'Red Book' Query

    Sorry, my previous post was done using a byte for each hex digit when it is really a nybble. Thus 0x01 is 00000001, 0xc0 is 11000000, etc.

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    Melbourne, VIC, Australia
    Posts
    8

    Re: 'Red Book' Query

    Hey thanks for that. Makes a lot more sense now. I'll just have to convert a few of the Hex Values to binary to see if i can see a pattern occuring.

    Cheers,

    Originally posted by stereo_barryo:
    Sorry, my previous post was done using a byte for each hex digit when it is really a nybble. Thus 0x01 is 00000001, 0xc0 is 11000000, etc.

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    Melbourne, VIC, Australia
    Posts
    8

    Re: 'Red Book' Query

    Thanks,

    Yeah, i'm just going to have to convert some numbers to binary and look at it that way! Just until i get more used of hex numbers anyway.

    Thanks for your help!

    Originally posted by nexusone:
    You need to watch the Matrix a few more times, once you get good enought with coding you can see the results without even running the program....

    Once you become one with the computer you will be able to see the fly in the hex code...





Similar Threads

  1. FBO query
    By PropPutty in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-30-2010, 12:19 PM
  2. GPU Query
    By loriordan in forum OpenCL
    Replies: 1
    Last Post: 11-20-2009, 01:00 PM
  3. VBO Map-Unmap query
    By DWilson in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-22-2008, 02:14 PM
  4. Occlusion query
    By V-man in forum OpenGL: Advanced Coding
    Replies: 18
    Last Post: 09-05-2006, 06:55 AM
  5. Query GPU capabilities
    By k_szczech in forum OpenGL: General
    Replies: 9
    Last Post: 05-15-2006, 01:36 PM

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