Is it a custom home-made format ?
Actually, its a small collection of formats for :
- (Polygonal-)Meshes
- Materials
- Deformers/Modifiers: skinning and morphing
- Model: hierarchies and references the previous assemblies
- (KeyFrame-)Animations
These were developed especially to allow realistic characters with skeletal and facial animations, including lip-synchronization, but also for arbitrarily objects. They are used in two projects so far: a Virtual Beergarden and one called ‘Visual Attentive Presentation Agents’, I posted a link to a video here.
I wrote the exporters since COLLADA could not handle Morph-Targets/BlendShapes and Skinning on the same mesh before version 1.4 and even today not all COLLADA 1.4 exporters can handle this. However, COLLADA is getting more popular and better supported and since v1.4 contains all the needed information, a converter seems to be a good idea.
Gee. Im disappointed.
I read this as the OpenMall initiative.
I was hoping you guys were going to start a shopping center where I could come, take whatever I want, and if I feel like it make a donation.
Darn.
;D
Oh that’s the last thing in the world I want to - I mean to disappoint you Jeff
It is far from being complete or totally bug-free, but if you or anyone else want to take a look at the current state of my math-lib you can do this via svn:
url: https://svn.monoid.net/public/math/
username: jgo
password: member
This a read-only account, but if you Jeff or anyone else want to contribute, I would be glad to give you a read-write account.
Note: there is a single class (net.monoid.math.algebra.xml.sax.SAXExpressionContextReader), which has a dependency to another package. Since no other class needs it, just remove it before compilation.
Currently, everything is under the GPL, but I’m open to users. BSD may be a better solution.
A few things using it:
The lib contains some algebra and geometry classes, but I guess the Vector2-3 and Matrix2x2-4x4 ones are probably those of your main interest, so I will limit the description to them for now.
One goal was to separarte the operations and from the data-structures. Therefore all these mentioned Vector and Matrix classes have abstract ‘getters’ and ‘setters’ for their elements, whereby the set ‘set’ operation is optional. Further they use doubles instead of floats.
public abstract class Vector2 {
// NO class attributes
public abstract double getX();
public abstract void setX(double x) throws UnsupportedOperationException;
public abstract double getY();
public abstract void setY(double y) throws UnsupportedOperationException;
// Lots of methods follow
}
Similiar to the java.awt.geom.Point2D class every class has a concrete implementations which uses float and double attributes.
This also allows an easy derivation for others referencing to an array or nio-buffer are possible, as well as sparse matrices,…
public abstract class Vector2 {
// stuff from above
public static Float extends Vector2 {
public float x;
public float y;
public double getX() { return x; }
public void setX(double x) { this.x = (float) x; }
..
}
}
Note that speed was not the primary goal using the abstract and therefore virtual getters. Probably, the performance could be increased by overriding all methods (add, multipy,…) in the concrete classes, so that these access the attributes directly instead using the properties and using floats in the special case. However, IMHO a stable implementation comes first and I’m also far too lazy cloning all the methods. (if this would be desired generation of the code would definetly desirable ;))
Finally, let’s come to the operations. Most methods have two overloads like the following example shows:
public Vector2 add(Vector2 right);
public <T extends Vector2> T add(Vector2 right, T sum)
The first one creates a new vector for the result of the operation and the second one puts it into the last arguement (and also returns this). Generics allow the usage of the second one’s eturn-value without casting:
Vector2.Float a = new Vector2.Float(1.0f, 2.0f);
Vector2.Float b = new Vector2.Float(3.0f, 4.0f);
// returns a new vector, which doesn't need to be a Vector2.Float
Vector2 c = a.add(b);
// put the result in the last arguement and return it. using the genrics,
// the compiler knows that return type is the same that was specified
// as last arguement
Vector2.Float d = a.add(b, new Vector2.Float());
Another goal was that some methods can be used to create mathematical expression, which can be evaluated at any time instead of putting the result into a variable. The usage is as follows:
Vector2.Float a = new Vector2.Float(1.0f, 2.0f);
Vector2.Float b = new Vector2.Float(3.0f, 4.0f);
// the returned Vector's getX method returns a.getX() + b.getX()
Vector3 c = a.sum(b);
assert( c.getX() == 4.0f );
a.x = 3.0f;
assert( c.getX() == 6.0f );
This is particular usefull for large matrices, since the computation result consumes only two references (== two WORDs) and temporarily plus one times the size of an single element.
Please tell me your opinion and ask if you have any questions.
Sorry maybe my next dev.java.net project will be that. If Sun wants to be a sponsor, of course ;D ;D