Results 1 to 4 of 4

Thread: parsing question for obj reader

  1. #1
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    201

    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
    Senior 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
    Senior Member Regular Contributor
    Join Date
    May 2002
    Posts
    189

    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
    Senior 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

Similar Threads

  1. Cad model File reader
    By Andy Suma in forum OpenGL: User Software
    Replies: 8
    Last Post: 02-16-2009, 05:32 AM
  2. wavefront obj reader library
    By marco_dup1 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-01-2005, 08:24 AM
  3. Lightwave reader
    By Zuraffo in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 07-02-2003, 11:30 AM
  4. quake2 map reader
    By Bruno in forum OpenGL: Advanced Coding
    Replies: 32
    Last Post: 07-31-2000, 08:55 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