Rotating images
Randall Reetz
randall at randallreetz.com
Sat Apr 25 14:54:13 EDT 2009
The main reason that a flexible interpreter is better than requiring number rounding in code is that the same code would result in better performance in future versions of the engine (smoothed fractional positioning and rotation).
But you dont need to keep two sets of data... Just do all of your work in fracional numbers and "round(x)" your final points and angles as you hand them to the positioner and the rotater.
Randall
-----Original Message-----
From: "James Hurley" <jhurley0305 at sbcglobal.net>
To: use-revolution at lists.runrev.com
Sent: 4/25/2009 7:09 AM
Subject: Re: Rotating images
> --------------------------
>
> Message: 12
> Date: Fri, 24 Apr 2009 17:49:05 -0700
> From: Scott Rossi <scott at tactilemedia.com>
> Subject: Re: Rotating images
> To: Revolution Mail List <use-revolution at lists.runrev.com>
> Message-ID: <C617AC11.411B3%scott at tactilemedia.com>
> Content-Type: text/plain; charset="US-ASCII"
>
> Recently, Randall Reetz wrote:
>
>> Can one rotate images by degree or fraction of degree?
>
> You should be able to rotate an image simply by using:
>
> set the angle of img "myCoolImage" to 45
>
> The docs say the numeric value is an integer so like most position-
> based
> things in Rev you can only use whole numbers, no fractions. Until
> Rev gets
> subpixel positioning, we won't be able to accomplish fine
> positioning of
> graphics and images.
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design
>
Scott (and Randall),
I've been playing with moving images around a loop while keeping the
image oriented along the tangent and found some strange things about
the input that RR allows.
It turns out that RR will truncate a fractional angle for you. (See
script below.)
It will also accept fractional input to "move image from pt1 to pt2"
where the two points have fractional items, but will not accept a
fractional input to "Move image to tPt" if tPt contains fractional
items.
Nor will RR accept fractional input to setLoc but there will be no
error message. It just interest a return into the list of points and
you get a gap in the line, or nothing if all the points are fractional.
I put in a request many years ago asking that RR do all the truncating
in the engine. Sooo much simpler. If that request is still active, I
would appreciate your vote. (The trouble is that I means I have to
keep two sets of books for the graphic points, one for calculating the
tangent angle and one for setting the graphic points to display the
graphic.)
So in summary:
Accepts fractional input:
Move object from pointA to pointB
Set angle of image to tAngle
Does not accept fractional input:
Move object to tPoint
[truncated by sender]
More information about the use-livecode
mailing list