I'm thinking about creating interface similar to Loader, but working in
other direction. Having such interface would allow writing basic
converters in java3d very easily - instead of n->1 formats (all formats
to j3d) we would get n->n.

1) Geometry
I think it is easiest part. Static utility could be created, which would
take any java3d geometry and convert it back to GeometryInfo.
GeometryInfo can be later asked to convert into best format
(index/unindexed, normals etc) and only one routine would have to be
written in 'saver', GeometryInfo(preferred format) -> native format,
instead of working with all java3d geometry types.

2) TransformGroups/etc
Should be quite simple, but all graph would have to be traversed
manually from 'saver'.

3) Special classes (Morph, AlternateAppearance)
Just ignore if not supported by format.

4) Appearances
Could be tricky. Materials are simple, Rendering/PolygonAttributes also
if format supports it (in other case ignore). Biggest problem is with
textures. Even ignoring them would not make 'saver' useless, but I
suppose it could be solved - draw them to temporary BufferedImages and
then use JAI/custom saver to serialize them to disk. This can be a
problem for formats which require textures in separate files - I don't
think that just passing OutputStream to 'saver' would be enough. Some
kind of file-access interface would be needed (could be as simple as
OutputStream openStream(String name), which for default case would work
with current directory if allowed). Another problem is with texture
coordinates generation. It would be nice to be able to output this
explicte if target format requires it. But I don't think there is a way
to get generated coords out of java3d right now ?


It is obvious that complicated stuff could not be written in all
formats. For example some of them does not support textures, some of
them support only one of them. Not to mention cube maps or more
complicated combine options. But anyway, I think it would be really,
really nice addition to java3d and j3dfly/j3dedit.

Artur

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to