Boost logo

Geometry :

Subject: [ggl] Efficient rotation about a point
From: Mateusz Loskot (mateusz)
Date: 2009-12-03 07:01:16

Lee wrote:
> Barend Gehrels wrote:
>>> I wonder, is there really any benefit in having composable-matrix
>>> + ublas_transformer over having composable (affine) transformers?
>>> As a user, I'm looking at the existing rotate/translate/scale
>>> transformers and being frustrated by the thought "if only I could
>>> compose these things!". Is matrix + ublas_transformer really the
>>> answer to that?
>> We don't want to duplicate functionality from uBlas or another
>> matrix library, but use it.
> Understood.


Yesterday I added new affine transformation example to the SVN trunk.
As haven't published the trunk yet, I attached it.
The program 06_transformation_svg_example.cpp shows how to use
perform transformations (translate, scale, rotate) against simple
polygon (triangle). It also shows quick (a bit brute force) way how to
compose more than one transformations and apply them together in single
pass. The example composes translate and rotate.

The output is written to SVG file (see attached
06_transformation_svg_example.svg), so it's easy to check results.

Note, this example was written in rush tested using Visual C++ 8.0
(VS2005) only, so bugs expected :-)

Hopefully it will help you to achieve your goals.

Best regards,

Mateusz Loskot,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 06_transformation_svg_example.cpp
Type: text/x-c++src
Size: 6242 bytes
Desc: not available
Url :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 06_transformation_svg_example.svg
Type: image/svg+xml
Size: 1183 bytes
Desc: not available
Url :

Geometry list run by mateusz at