Re: Info Request- File Format Converter

Discussion in 'C++' started by Jeremy Cowles, Jul 29, 2003.

  1. > As I am not the most adept
    > programmer in either C or C++, I am inquiring for any good resources
    > for parsing data and/or writing a file converter?


    Here is the best source for file format information EVER:

    http://www.wotsit.org/

    HTH,
    Jeremy
     
    Jeremy Cowles, Jul 29, 2003
    #1
    1. Advertising

  2. Thanks for the info

    I am ,though, familiar with the file strucutre of both the existing
    and target file formats. I am wondering though if there is any good
    information for parsing data. To let you know, the file formats that I
    am attempting to convert from is POVRAY and the file format that I
    want to convert to is Radiance. Primarily, I want to convert triangles
    and smooth triangles along with materials, luminaires and camera
    information to the Radiance format. An example of this would be the
    following:

    triangle {
    < -153.306564, -12.000000, 261.533325 >,
    < -736.000000, 0.000000, 261.533325 >,
    < -212.806580, 0.000000, 261.533325 >
    texture { CHIEFMAT_1 }
    }

    mesh {// Surface # 3261
    smooth_triangle {
    < -595.605225, 80.125015, 261.533325 >, <0.000000, 0.000000,
    1.000000>,
    < -595.480225, 80.000015, 261.533325 >, <0.000000, 0.000000,
    1.000000>,
    < -595.480225, 20.000000, 261.533325 >, <0.000000, 0.000000,
    1.000000>
    texture { CHIEFMAT_8 }
    }

    I know for the smooth_triangle, to translate to Radiance the format
    will be:

    CHIEFMAT_8 plastic polygon
    0
    0
    12 -595.605225 261.533325 80.125015
    -595.480225 261.533325 80.000015
    -595.480225 261.533325 20.000000

    Likewise, I know that for the triangle object, the Radiance format
    translated shall be:

    CHIEFMAT_1 plastic polygon
    0
    0
    12 -153.306564 261.533325 -12.000000
    -736.000000 261.533325 0.000000
    -212.806580 261.533325 0.000000


    I am quite certain that it is quite possible to write code that can
    translate the scene data. What I think will be the challenge is to
    write the code such that it is robust enough to handle slight changes
    in the sequencing of object data (i.e. there may be uv data prior or
    after to the entry of vertex points for the triangle and
    smooth_triangle objects). I guess I look at this like attempting to
    write a book. The hardest part is writing the first line. After that
    it should be fairly straight forward. What I am looking for is any
    good information (books, downloadable documents) that can give some
    general techniques as to how to write a robust scene translator in C
    or C++. It need not be specific to my situation for it to be useful to
    me.

    Thanks

    Marcus

    "Jeremy Cowles" <> wrote in message news:<xruVa.70149$>...
    > > As I am not the most adept
    > > programmer in either C or C++, I am inquiring for any good resources
    > > for parsing data and/or writing a file converter?

    >
    > Here is the best source for file format information EVER:
    >
    > http://www.wotsit.org/
    >
    > HTH,
    > Jeremy
     
    Marcus Jacobs, Jul 29, 2003
    #2
    1. Advertising

  3. Marcus,

    > What I am looking for is any
    > good information (books, downloadable documents) that can give some
    > general techniques as to how to write a robust scene translator in C
    > or C++.


    This seems like it would be too specialized to write a book about. You
    should look into Regular Expressions, if you find a regEx parser library,
    the rest of the app should be a breeze.

    HTH,
    Jeremy



    "Marcus Jacobs" <> wrote in message
    news:...
    > Thanks for the info
    >
    > I am ,though, familiar with the file strucutre of both the existing
    > and target file formats. I am wondering though if there is any good
    > information for parsing data. To let you know, the file formats that I
    > am attempting to convert from is POVRAY and the file format that I
    > want to convert to is Radiance. Primarily, I want to convert triangles
    > and smooth triangles along with materials, luminaires and camera
    > information to the Radiance format. An example of this would be the
    > following:
    >
    > triangle {
    > < -153.306564, -12.000000, 261.533325 >,
    > < -736.000000, 0.000000, 261.533325 >,
    > < -212.806580, 0.000000, 261.533325 >
    > texture { CHIEFMAT_1 }
    > }
    >
    > mesh {// Surface # 3261
    > smooth_triangle {
    > < -595.605225, 80.125015, 261.533325 >, <0.000000, 0.000000,
    > 1.000000>,
    > < -595.480225, 80.000015, 261.533325 >, <0.000000, 0.000000,
    > 1.000000>,
    > < -595.480225, 20.000000, 261.533325 >, <0.000000, 0.000000,
    > 1.000000>
    > texture { CHIEFMAT_8 }
    > }
    >
    > I know for the smooth_triangle, to translate to Radiance the format
    > will be:
    >
    > CHIEFMAT_8 plastic polygon
    > 0
    > 0
    > 12 -595.605225 261.533325 80.125015
    > -595.480225 261.533325 80.000015
    > -595.480225 261.533325 20.000000
    >
    > Likewise, I know that for the triangle object, the Radiance format
    > translated shall be:
    >
    > CHIEFMAT_1 plastic polygon
    > 0
    > 0
    > 12 -153.306564 261.533325 -12.000000
    > -736.000000 261.533325 0.000000
    > -212.806580 261.533325 0.000000
    >
    >
    > I am quite certain that it is quite possible to write code that can
    > translate the scene data. What I think will be the challenge is to
    > write the code such that it is robust enough to handle slight changes
    > in the sequencing of object data (i.e. there may be uv data prior or
    > after to the entry of vertex points for the triangle and
    > smooth_triangle objects). I guess I look at this like attempting to
    > write a book. The hardest part is writing the first line. After that
    > it should be fairly straight forward. What I am looking for is any
    > good information (books, downloadable documents) that can give some
    > general techniques as to how to write a robust scene translator in C
    > or C++. It need not be specific to my situation for it to be useful to
    > me.
    >
    > Thanks
    >
    > Marcus
    >
    > "Jeremy Cowles" <> wrote in message

    news:<xruVa.70149$>...
    > > > As I am not the most adept
    > > > programmer in either C or C++, I am inquiring for any good resources
    > > > for parsing data and/or writing a file converter?

    > >
    > > Here is the best source for file format information EVER:
    > >
    > > http://www.wotsit.org/
    > >
    > > HTH,
    > > Jeremy

    >
     
    Jeremy Cowles, Jul 29, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Birtle
    Replies:
    2
    Views:
    2,103
    John Saunders
    Oct 16, 2003
  2. Jeffrey
    Replies:
    3
    Views:
    504
    Robert
    Apr 17, 2005
  3. Nicolas Matringe

    Another Verilog to VHDL converter request

    Nicolas Matringe, Feb 5, 2007, in forum: VHDL
    Replies:
    11
    Views:
    3,966
    Nicolas Matringe
    Feb 7, 2007
  4. Randy Kramer
    Replies:
    2
    Views:
    404
    Randy Kramer
    Jan 12, 2007
  5. Wesley
    Replies:
    1
    Views:
    155
    Wesley
    Apr 15, 2014
Loading...

Share This Page