[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Time-based interpolation :: jitter problem
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Time-based interpolation :: jitter problem
- From: Alexandre Quessy <alexandre@xxxxxxxxxx>
- Date: Fri, 19 Jun 2009 00:35:13 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 19 Jun 2009 00:35:16 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tlsObIDXjfxSXRtNk/A4s+LqvMU1fxnenUhy1Wwm4DI=; b=Nizf6WnH6KroJjL2dyrWblWt1P3yvpaLgIwyE0kl3SoY7f3ubo30bHcy25McEgo+Hb nng5SLSTeIaMp4toVS0z0wgWPCtPXEBD1h2f2dEq7KtDrLiTgX90zO/HoyTEqpqln2aJ ANmy85gbdVjZH9QnqRu0oE5lHGIsjWiR/P97M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=Pqk3IFTKRdl+MfmVRzSpgL+BuiwRmWP8IcsoGHI1flV+g748+e0HR+gkwN/Y2pGR+t QiaTukudYdNxb69wyfEgcqULhV/Pon2WaIszQGDKIanA/GaAZwYzvbIIv9nb7g7EqWCD 0dC6dkwiWpu4JggjGDSgsYifKSkyFpHdsoDqw=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi !
I am trying to use an interpolation based on time.time() to create
smooth animations with Pygame and OpenGL.
The idea is to get time-based motion tween, instead of frame-based.
It seems like there is still jitter in my interpolation. The motion is
not uniform.
Anyone can propose a more accurate way to measure time
(human-perceived time, not CPU time) than time.time()?
...or maybe it is my Tween class code that is wrong. It is based on
the excellent Robert Penner easing equations. Maybe there is something
wrong with my Tween.tick(t) method.
Can you guys take a look ?
You can download my tweening test here :
http://alexandre.quessy.net/static/pygame/tween_progress.tar.gz
(this code is part of toonloop.com)
--
Alexandre Quessy
http://alexandre.quessy.net/