Results 1 to 4 of 4

Thread: what kind of gl command manipulate face normals

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

    what kind of gl command manipulate face normals

    is there any command manipulate face normals,i assume glNormal*() but i ve no idea how to use it.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: what kind of gl command manipulate face normals

    You can transform them with a matrix or something more exotic in the vertex shader, or you can do it on the CPU and then specify them with glNormal*(). If you use the fixed pipeline in most cases the GL will handle the transformation for you.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    458

    Re: what kind of gl command manipulate face normals

    Just use glNormal before calling to glVertex, and change it for every faces.

  4. #4
    Member Newbie
    Join Date
    Jan 2011
    Location
    Lincoln, UK
    Posts
    36

    Re: what kind of gl command manipulate face normals

    Or if your using vertex arrays, you can enable the normal array and set the pointer to your array before drawing.

    for example:

    Code :
    glEnableClientState(GL_NORMAL_ARRAY);    //enable the normal array
    glNormalPointer(GL_FLOAT, 0, myNormals);    //set the normal array to the array holding your normal data
     
    glDrawElements(GL_QUADS, 4, GL_UNSIGNED_BYTE, myIndices); //draw the object
    glDisableClientState(GL_NORMAL_ARRAY); //disable the normal array

    for more info on the above commands, there is plenty of info on google.

Similar Threads

  1. face normals or vertex normals
    By infinitecmdz in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 02-21-2004, 07:29 AM
  2. vertex normals or face normals
    By infinitecmdz in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-20-2004, 09:35 AM
  3. is it possible to have vertex normals or even face normals using triangle strips nt
    By wildeyedboyfromfreecloud in forum OpenGL: Advanced Coding
    Replies: 63
    Last Post: 03-19-2002, 11:42 PM
  4. Face normals
    By lsdi in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-15-2002, 01:52 AM
  5. Face Normals vs. Vertex Normals
    By detzel in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 03-05-2001, 10:50 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