Re: [eigen] about Transform API |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: "Benoît Jacob" <jacob@xxxxxxxxxxxxxxx>
- Subject: Re: [eigen] about Transform API
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Sun, 31 Aug 2008 00:26:56 +0200
- Cc: eigen@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=tFNYLdml8XwXWuyU/FdCt4i2Hw5wlXePva8jlzQTars=; b=OdctygYKJ1yKIFAAcAq6TxOyR0jog2KIXv69WIses5NZAqX6mbjvM6LJOuXR8s05Yw rohkwQBwG5Q54aeT1Gk20lqbZuF3Mr6SrWRJZRb1TKS5e/qRouZarw9VsuJysqo2k1qd xTcHNPDJKTSy8cV+cU7ha7TKqNA/qhCkz8mbI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=XZ32YpM49fBPtZeZ9KiI107KNyCZ2+MWTCtVeBsLYrgvzdtjkvPjuS4d1NtoyzEwTN AhegDGdqT/NsTwg4uhH5zsncRxgXMf2ck2IIcSATwRW6mBG9ay8Tem7r8YuJBmvNyA76 w3qKqNUOknLbl7CtW8FM5A3Kwb6jRKaoCdjyY=
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.