Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: opengl gml per face normal and per face vertex question

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2006
    Location
    MI
    Posts
    3

    opengl gml per face normal and per face vertex question

    Hi,

    I am trying to make it in my program so that I display what it looks like with per face normals without per vertex normals and vice versa. I am not calculating these attributes manually, I am using the GML class by Nate Robbins and his glmFacetNormals(.obj, degrees) and glmVertexNormals(.obj) for the .obj files I am using. Whenever I take away glmFacetNormals() for a particular .obj file, I get a run time error that kills the program it says asstertion fails: facet norms so I am unable to display what it would look like with just per vertx normals. Does anyone know how to fix this? I appreciate your help, thanks

    FRo

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: opengl gml per face normal and per face vertex question

    Maybe try vertex normals. There may only be one present.

    If you're using a buggy or undocumented lib it may be time to roll your own or use something like collada.

    Drawing an object with normals is simple, just draw a line from tehe vertex coordinate to the vertex coordinate+normal position. If you're drawing the object then I assume you are using the normals, so if this is in someone elses code then I suggest you take a look at their drawing code, if you do the drawing then you already have the verts & normals. Either way you really should be able to grab this if you're coding in a meaningful way near the OpenGL level.

    For facet normals calculation just take the normalized cross product of two edges on the triangle (winding is important it will determine direction - inside or outside).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •