Improving TransformGroup / Transform3D

I have to say that im looking at the Xith3d engine code at the moment to know how im going to build my own engine. Im probably going to change everything including the vecmath api that is a little confusing for me (the method naming) and doesn’t support much about nio buffers. I also want to make the render process more independent of the scenegraph and the engine sheduler and task manager more independent of the renderer (that is the renderer is not the engine controller). So im planning to change everything however i understand if you want to keep it backwards compatible. I think this is possible without removing any methods from the older classes.

So to keep backward compatibility my revised sugestion would be:

  • Create a new class called Transform and expand it with a new hierarchy of transformations.

Transform = A generic transformation.
AffineTransform = An affine generic transformation.
TranslationAffineTransform = A translation.
ScaleAffineTransform = Scaling.
RotationAffineTransform = Rotation.
ShearAffineTransform = Shearing.
Projection = A projection.
PerspectiveProjection = A non-affine perspective projection.
OrtigraphicTransform = A non-affine ortographic projection.

This way you can build a rotation for example with whatever arguments you want.


TranslationAffineTransform transl = new TranslationAffineTransform(x,y,z,angle);
TranslationAffineTransform transl = new TranslationAffineTransform(new Vector3f(---) ,angle);
TranslationAffineTransform transl = new TranslationAffineTransform(new Vector4f(---) ,angle);
TranslationAffineTransform transl = new TranslationAffineTransform(new AxisAngle4f(---));
TranslationAffineTransform transl = new TranslationAffineTransform(new Quaternion4f(---));
TranslationAffineTransform transl = new TranslationAffineTransform(new Matrix3f(---) );
TranslationAffineTransform transl = new TranslationAffineTransform(new Matrix4f(---) );

I don’t think this would break anything since it would be new code and nothing would be removed.

  • Enrich TransformGroup with new methods to make it easier to work with (so the user doesn’t have to deal with “middle-man” classes if he doesn’t need to and for the most common operations):

TransformGroup tg = new TransformGroup();
tg.setIdentityTransform();
tg.setTransform(transform);
tg.setTranslation(transform);
tg.setRotation(transform);
tg.setScale(transform);
tg.setShear(transform);
tg.getTransform(transform);
tg.getTranslation(transform);
tg.getRotation(transform);
tg.getScale(transform);
tg.getShear(transform);
tg.transform(transform);
tg.swapTransform(transform);
tg.rotate(transform);
tg.scale(transform);
tg.shear(transform);
tg.translate(transform);

Do you mean you want to adapt the Xith3D engine to your needs (=contribute to it) or do a separate project ?

If there’s too much issue with backward compatibility you can do a fork (Xith 2 ?) and I’d be happy to join. BUT that’s just an idea probably even not good…

[quote="<MagicSpark.org [ BlueSky ]>,post:22,topic:27554"]
Do you mean you want to adapt the Xith3D engine to your needs (=contribute to it) or do a separate project ?

If there’s too much issue with backward compatibility you can do a fork (Xith 2 ?) and I’d be happy to join. BUT that’s just an idea probably even not good…
[/quote]
I haven’t commited to any design yet. Im mostly trying to learn how Xith3d works in deep and then do my own engine with the most flexible design. My engine is planed to be open source and flexible enough for most games including complex crpgs with their own unique char systems. Im also building some free pd content (models and textures) that can be used by anyone for a generic phantasy seting so my time is a bit divided by moding and coding. I can post something here when i have it. At the moment im changing vecmath tuple class completely. I will post my ideas in another thread in these forums.