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

Thread: parsing question for obj reader

  1. #1
    Junior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    205

    parsing question for obj reader

    for anyone who knows a wavefront obj file knows that sometimes in the same file you may have a face like this f 1/2/3 or a face like this f 1//3 or f 1. The first is a face with a vertex, texture and a normal. The second is a face with a vertex and a normal and the third is a face with just a vertex.

    i would like some sugestions as to how I go about checking for these differences. for right now my reader only reads faces with only a vertex or a face with all three.
    thanks for the help.

    p.s i know there have been alot of questions about object reader and i have read them all. None of them however check for these differences.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: parsing question for obj reader

    Just keep some flags. Face data always comes at the end, so if you read some vertices and normals set a vertex and normal flag so you know to only read in those face indices.

    Old GLman

  3. #3
    Junior Member Regular Contributor
    Join Date
    May 2002
    Posts
    183

    Re: parsing question for obj reader

    I have to disagree with you GL Man. Face data does NOT always come at the end. It comes at the end of the current group.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: parsing question for obj reader

    Your right, forgot about that. But it doesnt really matter, face data comes after verts, tex coords, and normals. Either way, keep some flags.

    Old Glman

Posting Permissions

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