Re: Playing an image sequence in reverse
Status: Alpha
Brought to you by:
cwalther
From: Urs H. <ur...@an...> - 2009-09-27 09:59:35
|
Hi > I'm trying to run a JPEG image sequence in reverse order, but am > running into problems: > > Code: > [...] > animpos = math.mod(animpos - 1, 101) > [...] I guess this line is the problem. According to the Lua 5.0 reference, math.mod just uses the mod operator from ANSI C. If I remember correctly, ANSI C does define the result of it on a negative number as implementation specific, so, depending on the plattform the software runs on, math.mod(-1, 101) could be -1 or 100. By replacing the above line with if animpos < 0 then animpos = 100 end should give what you want. However, because of laziness, I have not tested it! Greetings Urs |