Results 1 to 3 of 3

Thread: is it possible to use "default" values vor array?

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    2

    is it possible to use "default" values vor array?

    Hello
    I got a simple question for my first OpenGL project,
    Actually i want to create some kind of flat mesh, for a 2D game thingy, and it works fine for now.
    But my question is: is it anyhow possible to send an array for the vertex cords only with X and Y coordinates?
    because Z is allways the same, for each layer (so that i would just translate the worldmatrix for each layer)
    For saving 1/3 of memory for the vertex data
    Is this anyhow possible?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,651

    Re: is it possible to use "default" values vor array?

    Quote Originally Posted by AnniKa
    is it anyhow possible to send an array for the vertex cords only with X and Y coordinates? ... For saving 1/3 of memory for the vertex data.
    Sure, just use "2, GL_FLOAT" when you're calling glVertexAttribPointer or glVertexPointer (depending on whether you are using generic vertex attributes or legacy vertex attributes).

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    2

    Re: is it possible to use "default" values vor array?

    oh! cool.
    so easy!
    ty

Similar Threads

  1. Switching between "arcball" and "fps-style" camera rotation
    By bsabiston in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 10-31-2017, 12:37 PM
  2. Replies: 4
    Last Post: 08-28-2013, 01:23 PM
  3. Replies: 1
    Last Post: 10-26-2012, 02:19 AM
  4. Replies: 1
    Last Post: 03-25-2010, 03:36 PM
  5. "best" linux dist for a "Gelato" render farm?
    By ArtificialArtOfficial in forum OpenGL: Linux
    Replies: 10
    Last Post: 12-23-2007, 01:02 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