[racket] rotate an image using 2htdp/image

From: Paul Ojanen (engineer at alum.mit.edu)
Date: Mon Jul 19 22:49:36 EDT 2010

Here's an example I have that shows what Stephen suggested.  It's overly
complicated with the trig, but the rotation is a small object overlaid on a
larger circle.

Specifically, the blue circle background is rotating back-and-forth and the
small red circle is along for the ride.  But it looks like the red circle is
doing something cooler all by itself.


#lang scheme

(require 2htdp/universe)

(require 2htdp/image)

(define (render t)

  (rotate (* 90 (cos (* t .06)))

          (overlay/xy (circle 15 "solid" "red")

                      -85 -170 (circle 100 "solid" "blue"))))

(big-bang 1 (on-tick add1) (on-draw render))





From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org]
On Behalf Of Mathew Kurian
Sent: Monday, July 19, 2010 4:38 PM
To: users at racket-lang.org
Subject: [racket] rotate an image using 2htdp/image


Just want to clear up things....the how can adjust the pinhole or the
rotation center?

 And Stephen Bloch, can you explain in a bit more detail...seems like that
is exactly what i am looking for...but i am having challenging understanding
the concept.

 I am making trying to make a shooter game and move the mans arm up and
down. What is the best way I can achieve this?


PS: All this is in 2htdp/image



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100719/f726a690/attachment.html>

Posted on the users mailing list.