 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jeremy Cowles Guest
|
Posted: Tue Jul 29, 2003 1:15 pm Post subject: Re: Info Request- File Format Converter |
|
|
| Quote: | 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
|
|
| Back to top |
|
 |
Marcus Jacobs Guest
|
Posted: Tue Jul 29, 2003 8:31 pm Post subject: Re: Info Request- File Format Converter |
|
|
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" <jeremy.stop-spam-now.cowles (AT) asifl (DOT) com> wrote
| Quote: | 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
|
|
|
| Back to top |
|
 |
Jeremy Cowles Guest
|
Posted: Tue Jul 29, 2003 8:50 pm Post subject: Re: Info Request- File Format Converter |
|
|
Marcus,
| Quote: | 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" <marcdevon (AT) hotmail (DOT) com> wrote
| Quote: | 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"
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
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|