3 ms·
Hey Lincoln, I'm the guy who made Penumbra. A few thoughts: 1. Frames are not a unit of time. In the :update and :display callbacks you're given both the tot
by prospero 16y ago
Hey Lincoln, I'm the guy who made Penumbra. A few thoughts:
1. Frames are not a unit of time. In the :update and :display callbacks you're given both the total elapsed time and elapsed time since the last frame (in seconds); use those to calculate the positions of objects.
2. I think the major confusion you have is what the (anim ...) macro should return. The answer's actually pretty straightforward: a function which takes the current time, and returns the position for that time. That function will be stored in the global state of the application, and sampled every time you draw a frame.
If you want to change an animation, all you need to do is swap out the animation in one of the callbacks. These callbacks don't have to necessarily be in response to user actions; look at how app/periodic-update is used in the Tetris and Asteroids examples.
If you have any further questions, the mailing list is at http://groups.google.com/group/penumbra-lib http://groups.google.com/group/penumbra-lib.
- RodgerTheGreat 16y agoThis sort of response is why I love Hacker News.