Re: [eigen] about Transform API

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


to update the list,  this proposal is now implemented and fully
working (rev 854987).
An example:

Quaternionf q;
Vector3f axis;
Vector3f vec;
Transform3f t1;
// ...

Transform3f t2 = Translate3f(tx,ty,tx) * AngleAxis3f(M_PI/2,axis)
                            * t1 * Scaling(sx,sy,sz) * Translate(vec) * q;

all these products are optimized (assuming the compiler is able to
optimize unnecessary temporaries)

The classes Translate and Scaling features also operator*(Vector)  and
 inverse() which might be useful to write generic algorithms taking
any kind of transformations as input.


On Thu, Aug 28, 2008 at 4:03 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> Let's keep the rotate()/scale()/translate() methods because this is what
> OpenGL people expect first. Then let's also keep the pre... methods too.

just for your information: all these GL functions (glTranslate,
glRotate, glScale, glLoadIdentity, glLoadMatrix, glMultMatrix,
glpush/PopMatrix, etc...)  are going to be removed in OpenGL and have
already been removed in OpenGL ES  2.0.

What remains is something like "glUniformMatrix4fv(matrix_name, data)"
where "matrix_name" is whatever you want.....
(but this not at all an argument against the translate/rotate/scale
functions which are nice to have)

> I wonder about the shear() methods. Any use case? I know Qt has them but
> that's not reason enough :)

I think this is quite useful in 2D, e.g., all drawing softwares
support shear....

gael.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/