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 5 of 5

Thread: obj file - processing data

Threaded View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    24

    obj file - processing data

    I'm working on obj loader. I want to draw an object using glDrawElements (smooth shading). Here are my assumptions:

    - the number of normals <= the number of vertices (I don't need to average normals, only arrange them with relation to vertices indices using normal indices before sending to a gpu. Then the number of normals = the number of vertices)
    - the number of normals > the number of vertices ( It indicates that I need to average normals (according to smoothing groups if present) and arrange them with relation to vertices indices using normal indices before sending to a gpu. Then the number of normals = the number of vertices)
    - the number of tex coords <= the number of vertices (I need to arrange tex coords with relation to vertices indices using tex coords indices before sending to a gpu. Then the number of tex coords = the number of vertices)
    - the number of tex coords > the number of vertices - In this case I can't use glDrawElements so I process normals as above and then arrange vertices, normals and tex coords using their indices. Data will be properly duplicated and then I will have to use glDrawArrays.

    Please verify my assumptions and let me know whether I'm right or wrong.
    Last edited by Triangle; 10-02-2012 at 09:12 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
  •