|
|
Thomas Lake wrote:
> I would like to expand my small Java utility mesh2udo to encompass other
> file formats. I've been looking at the specs for several different file
> formats:
>
> http://www.tnt.uni-hannover.de/js/soft/compgraph/fileformats/
> http://astronomy.swin.edu.au/~pbourke/3dformats/
>
> There is a lot to absorbe there and I haven't read enough to implement any
> of them. However before I do I though it would be good to have an object
> oriented frame work to build on, Java being an OO language. I was thinking
> of making a superclass lets call it MeshFileFormat that would model all the
> properties common to all file formats. This is where all the vertex data
> about the mesh would be stored. Then I could extend this class for each file
> format I want to implement. This should also make it easier to convert from
> one file format to another because all the file format classes extend a
> common class. Can anyone who has OO experience let me know if this sounds
> like a good strategy, or can you think of a better way?
>
It might be a sensible approach, but beware of simplifications made by each
formats. Some may only support triangles whereas someother may have polygons
(more than just 3 vertices per basic surface).
And worst of all, some of the format might be self-descripting about there contents.
Try first to ignore any possible texture/uv mapping, because it is really
a headache to convert (especially from polygon to only triangle), so all
you should need is:
vertex
segment
normal
triangle/polygon
object
That's look pretty simple, but the complexity comes from the relation
between them in each format.
I wish you good luck.
--
Non Sine Numine
http://grimbert.cjb.net/
Puis, s'il advient d'un peu triompher, par hasard,
Post a reply to this message
|
|