Boost logo

Geometry :

Subject: [ggl] Efficient rotation about a point
From: Stephen Leary (sleary)
Date: 2009-11-29 15:46:59


Nice summary of matrix transformations is available on wikipedia.

Essentially you can do any number of rotates and translates on your matrix
and then apply the result as a transformation to your space/feature. This is
generally why matrices get used alot because they are a very nice way of
storing the transformation history without needing to store all the
translated points.

Pretty much any linear transformation can be represented by a matrix. These
matrices can be built up through multiplications of matrices. The order you
multiply the matrices in matters as few matrices commute with others.
(Identity and null being the only ones i can think of off hand).

I think a set of factories to produce useful matrices would be more
approprate than extra methods (but that is my opinion)

Thoughts?

Stephen

On Sun, Nov 29, 2009 at 8:11 PM, Stephen Leary <sleary_at_[hidden]> wrote:

> Of course it can. you simply multiple a +translate by a rotate then
> multiply the result by a -translate. This gives you the matrix you need.
>
> Stephen
>
>
> On Sun, Nov 29, 2009 at 7:27 PM, Lee <lee_at_[hidden]> wrote:
>
>> Can a single matrix properly represent "-translate/rotate/+translate"
>>>
>>> ?
>>> I think the translation component of the matrix would be negated
>>> resulting in rotation about the origin, losing the "rotation about a point"
>>> behaviour. No?
>>>
>>
>> Stephen Leary wrote:
>>
>>> This is usually acomplished by producing a matrix that represents
>>> -translate/rotate/+translate then applying that matrix transform once. I
>>> havent checked to see if GGL supports matrix transforms but that is how i
>>> would approach this use case in "real life". The matrix gets built once and
>>> reused as many times as needed.
>>>
>>> Stephen
>>>
>>> On Sun, Nov 29, 2009 at 6:43 PM, Lee <lee_at_[hidden] <mailto:
>>> lee_at_[hidden]>> wrote:
>>>
>>> Hi,
>>>
>>> What is the best way (in terms of efficacy) to rotate a ring about
>>> a point in GGL?
>>> Looking at GGL it seems right now to require three separate passes
>>> over the point
>>> data: -translate/rotate/+translate. Can't this be done in some
>>> kind of single pass
>>> 'rotate_about_transformer'?
>>>
>>>
>> _______________________________________________
>> ggl mailing list
>> ggl_at_[hidden]
>> http://lists.osgeo.org/mailman/listinfo/ggl
>>
>
>
>
> --
> Stephen Leary
>

-- 
Stephen Leary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20091129/daf0b2c8/attachment.html

Geometry list run by mateusz at loskot.net