|
-
Jun 9th, 2010, 03:01 AM
#1
Thread Starter
Not NoteMe
Interpolating a rectangle [Resolved]
I have a rectangle defined by it's bottom left coordinates, and a width and height.
I have a destination rectangle, and i want to interpolate between the 2.
I've done this in a linear fasion by doing linear interpolation on the 4 values (x,y,w,h).
Unfortunately this is no good for what i want as the rectangle represents a 2D viewport.
If the destination rectangle is much smaller than the initial size (which is often is) then to start with the width/height changes by a small percentage, but by the end it's changing by a much larger percentage.
As a result the animation looks like it starts of slowly zooming in, gradually speeding up.
What i want is a smooth zooming in. I guess that would meen for each time step i want the rectangle to change by a constant percentage.
I've got no idea of the maths involved though, so any help would be much appreciated.
Last edited by SLH; Jun 21st, 2010 at 04:03 AM.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|