[racket] image.ss: can one make a rotation-invariant middle?

From: Yaron Minsky (yminsky at gmail.com)
Date: Sat Feb 5 23:18:06 EST 2011

Sorry for the noise: I think I answered my own question.  You basically
stick a pinhole in the image you want to place at its desired center, you
put a pinhole on the scene at the place you want the image to go, and you
use overlay/pinhole to place the image (or place-image/align, and use
'pinhole as the x-place and y-place.)

I'm still a little confused by the use of place-image/align, since it seems
like you need to utter the location that you're pinning the image to twice,
once in the coordinates for place-image/align, and once in the pinhole you
place on the scene.  But it does seem to work.


On Sat, Feb 5, 2011 at 10:05 PM, Yaron Minsky <yminsky at gmail.com> wrote:

> In playing around with image.ss, I've run into the following problem: the
> center of an image does not appear to be rotation invariant.  Thus, if you
> use place-image/align in order to place a triangle, say, that you then
> rotate continuously, you will see the triangle wobble as its effective
> center moves around.
> Is there any way around this?  I tried using pinholes, but pinholes seem to
> require that all images involved have pinholes, which is not quite what I'm
> going for.  What I really want to do is to declare a stable center for an
> image, but I can't quite figure out how to do that.
> y
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110205/962903c4/attachment.html>

Posted on the users mailing list.