Rotation as an animation

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
richardPVP
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Fri May 13, 2011 4:54 pm

Rotation as an animation

Post by richardPVP » Wed May 18, 2011 2:57 pm

I want an image of a circle with a pattern on it to rotate on screen. (The context is looking down on the north pole of the earth - an irregular pattern on the circle representing the ice- and seeing the earth rotate, showing where it is daylight and where it is night-time.)

I have tried using a photographic image and using a repeat of the rotate function moving 1 degree each time but the image quality just degrades as the image rotates. I also have failed to get a graphic to move using the rotate function.

Could someone please offer some guidance.

Many thanks

Richard

SparkOut
Posts: 2220
Joined: Sun Sep 23, 2007 4:58 pm

Re: Rotation as an animation

Post by SparkOut » Wed May 18, 2011 3:03 pm

rotate by is a command, and performs an operation on the target object to change the renderable data. Repeated issues of the rotate command will be destructive to the original image.

the angle of an image is a property that you can set, where it has no effect on the image data but is used by the rendering engine to display the image at a particular angle of rotation.

Rather than

Code: Select all

rotate image "theWorldFromAbove" by 1
you could

Code: Select all

set the angle of image "theWorldFromAbove" to the angle of image "theWorldFromAbove" + 1
HTH
SparkOut

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Rotation as an animation

Post by Surbhit29 » Mon Aug 27, 2012 11:16 am

Hi SparkOut,

Is it possible to rotate group of objects? Is it posible to treat a group of objects as one object and then rotate all of them to a particular angle?
For eg. If I have an object "Oval" and in that different other objects such as Rectangle, line, polygon etc. Now is there any way to rotate the Oval as well as the objects inside it all at once?

Surbhit

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2483
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Rotation as an animation

Post by jmburnod » Thu Aug 30, 2012 9:33 am

Hi Surbhit,
s it possible to rotate group of objects?
Yes.Have a look to the stack in attachment
It work with polygons only but that is maybe a start for your experiments

Best regards

Jean-Marc
Attachments
RotateGroupPolyByAngle.livecode.zip
rotate a group of polygons
(1.61 KiB) Downloaded 65 times

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Rotation as an animation

Post by Surbhit29 » Thu Aug 30, 2012 1:53 pm

Thanks Jean-Marc
That helped a lot. :)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”