I’m trying to build a “multiple transition” routine, using the transition library, for a smooth effect of acceleration. But something isn’t adding up.
The following code as follows:
transition.to( object, { time=4000, x=object.x-128, transition=easing.inQuad } )
transition.to( object, { time=8000, delay=4000, x=object.x-256 } )
What this basically does is start an “accelerate” transition for 4 seconds. Thus, the “inQuad” easing. After that (note the delay on the second transition), a “normal” movement occurs for 8 seconds.
I’m using the common speed formula, which is: SPEED = DISTANCE / TIME
Using this equation, I determine the speed that the object should be moving at the end of the first transition. Then, using that speed, I reverse-calculate the time it should take for the second transition to reach its point. This should, in theory, produce an acceleration for 4 seconds, followed by 8 seconds of a steady movement at the same speed the object was moving after the first transition.
But there is definitely something wrong. The transition is not smooth. The “inQuad” easing does not reach the correct value by the end. It’s too fast at the ending time. And thus, when the second transition begins, there is a noticeable skip and slow-down. Does anybody know why the “inQuad” easing is not reaching the proper end value? I know this is a fairly technical question, perhaps best answered by Ansca, but I’d like to know why this is occuring so I can properly calculate a second transition for perfectly smooth motion.
Any ideas?
[import]uid: 9747 topic_id: 4180 reply_id: 304180[/import]