Results 1 to 6 of 6

Thread: Huge 2D array of changing Pixels

  1. #1
    Guest

    Huge 2D array of changing Pixels

    I am looking for a methode to display 800x800 pixels in 2D. Each of these 640000 Pixels do permanetly change its value (on or off). Is there another method that GL_POINS and Vertex2f(); to do this. I doubt that it would be fast enough, because I would have to recalculate the X and Y component of the vector of 640000 pixels all the time. So a lot of calculus, until one frame is drawn. I apprechiate your helpt a lot!

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: Huge 2D array of changing Pixels

    upload the pixel data as a texture and draw a quad.

    or use glDrawPixels to draw the contents of your pixel buffer.

  3. #3
    Guest

    Re: Huge 2D array of changing Pixels

    Have you ever done this? How can I make a texture out of so many coordinates?

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    586

    Re: Huge 2D array of changing Pixels

    Use glDrawArrays. If you are using the same memory for the 2D array - you simply recalculate the vertex positions and call glDrawArrays after a call to glVertexPointer pointing to the start of your data. Also there is a glColorPointer, glNormalPointer and several others to point to an array of colors for your points. You enable each array separately using glEnableClientState with the apporpriate parameter. Draw arrays are much faster than separate glVertex calls.

  5. #5
    Guest

    Re: Huge 2D array of changing Pixels

    Hmm? I am not the big memory-crack, so I am not sure. Practically this will look like this: Data will come int via the serial interface or USB. I think I`ll have an X-coordinate and Y-coordinate and a value for each 640000 pixel. So what`s your way? First making a Array[200,200] and sorting the values in. Right??

  6. #6
    Guest

    Re: Huge 2D array of changing Pixels

    I meant Array[800,800]

Similar Threads

  1. Find max element in a huge array in kernel
    By -=MASTER=- in forum OpenCL
    Replies: 2
    Last Post: 04-16-2017, 06:43 AM
  2. Changing alpha of pixels on a texture?
    By PP2005 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-28-2011, 06:21 AM
  3. vertex array objects and huge meshes
    By caaso in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-12-2011, 07:04 AM
  4. Questions about mapping huge array to GPU
    By lua in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 09-08-2005, 01:26 AM
  5. Array with pixels
    By rainday in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-24-2002, 05:08 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