Results 1 to 2 of 2

Thread: about normal again

  1. #1
    Member Contributor
    Join Date
    Nov 2011
    Posts
    52

    about normal again

    Hi,
    if i want to assign a normal to a triangle,then,
    Code :
    glBegin(GL_TRIANGLES);
    for (i = 0; i < 20; i++) {
    glNormal(normals[i]);
    glVertex3fv(&amp;vdata[tindices[i][0]] [0]);
    glVertex3fv(&amp;vdata[tindices[i][1]] [0]);
    glVertex3fv(&amp;vdata[tindices[i][2]] [0]);
    }
    glEnd();
    and,if i want use indexd array,then i have to have normals array with same size as vertices array!I have a little confused,are these normals redundant ??

  2. #2
    Senior Member Regular Contributor imported_tksuoran's Avatar
    Join Date
    Mar 2008
    Location
    Cambridge, UK
    Posts
    223

    Re: about normal again

    From GPU point of view, per vertex attributes are required, and as such they are not redundant. If you use begin-end, driver (software) will perform duplication for you. If you use index array, you have to do duplication yourself. So modern OpenGL API more closely matches the current GPU.

Similar Threads

  1. Is this normal!?
    By Rodrix in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-20-2007, 03:11 AM
  2. what is a "normal" for?
    By fabianspring in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-09-2002, 01:36 PM
  3. Normal per vertex or normal per face ??
    By arieb in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-23-2001, 11:33 AM
  4. Normal per vertex or normal per face ??
    By arieb in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-23-2001, 03:25 AM
  5. Normal Vertex vs. Normal Face
    By in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-16-2001, 01:42 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