Hi Paul and all,

I agree with you simplification, but I'm not sure it'll keep write(read(A))==A. 
For instance:
- Read a model with a rotation (Y to Z-up for instance). Your +y facing plane 
will be then +z facing.
- Write the model. Model is still rotated and will be +z in the file, thus 
having write(read(A))!=A.

This is why I suggested writers should "undo" what is done during the reading 
by applying the opposite transform given by the read options. Of course one 
could have control over those things by changing options between reading and 
writing, but it's then the user's choice. It's surely the same when writing 
first and then reading.

Am I wrong?

Cheers,

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- "Paul Martz" <[email protected]> a écrit :

> To simplify things, I'd propose the following:
> 
>   - I don't think we need options to control writing. Your app can do
> 
> any required transformation with a NodeVisitor before calling osgDB to
> 
> write. The plugin should just write the scene graph passed to it.
>   - For reading, we just need rotation and scale options. "rotate
> <axis> 
> <degrees>" and "scale <x> <y> <z>". Those alone will handle changes to
> 
> orientation, handedness, and unit scaling.
>   - If the format stores an up vector, handedness, and unit
> information, 
> then the import plugins for those few formats need some kind of 
> "convertTo" option, sort of like FLT's "convertToMeters" (which scales
> 
> the model from its native units).
> 
> As an addendum to the last point, regarding Ulrich's comment, an
> import 
> plugin can only convert to right-handed if it knows the handedness of
> 
> the model. Which formats store that information? And to clarify, 
> OpenGL's "right-handed" rule is only the default for the definition of
> a 
> front face. Your application and your models may or may not use this 
> convention, and I think it would be wrong for a plugin to do such a 
> conversion automatically, assuming it knows something about the 
> convention you are using.
> 
> Finally, in principle, I agree: write( read( A ) ) should equal A. But
> I 
> want to re-emphasize this can only be true in the context of
> coordinate 
> systems. (100% equality in round-trip model conversions is essentially
> 
> an impossibility.)
> 
> Paul Martz
> Skew Matrix Software LLC
> _http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
> +1 303 859 9466
> 
> 
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to