TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Animations From First Principles (in 5 minutes)

108 pointsby RojerGSover 1 year ago

9 comments

noelwelshover 1 year ago
Looks really nice. A few things that I think might make the presentation a bit clearer:<p>1. Using polar coordinates makes the maths a lot cleaner than using Cartesian coordinates. However you then either need to explain polar coordinates, or you assume people remember polar coordinates from high school which is often not the case in my experience.<p>2. I think the positioning of the points is a little bit opaque. I was expecting to see (r * cos theta, r * sin theta) and it took me by surprise to see an addition in there. Either just noting that stupid computer graphics libraries don&#x27;t put the origin at the center, or adding that translation later (which is a chance to talk about function composition) might be beneficial.<p>(I&#x27;ve written my own take on this same topic, starting at <a href="http:&#x2F;&#x2F;www.creativescala.org&#x2F;creative-scala&#x2F;polygons&#x2F;" rel="nofollow noreferrer">http:&#x2F;&#x2F;www.creativescala.org&#x2F;creative-scala&#x2F;polygons&#x2F;</a> It will take a little bit more than 5 minutes to get through it :-) It&#x27;s really fun and you can do a huge amount with parametric curves.)
评论 #37430776 未加载
throwaway5947over 1 year ago
Not to be confused with “the twelve”:<p><a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Twelve_basic_principles_of_animation" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Twelve_basic_principles_of_a...</a>
toppyover 1 year ago
I like clarity of your examples. You could draw an inspiration from Daniel Shifman&#x27;s book &quot;Nature of code&quot; (<a href="https:&#x2F;&#x2F;natureofcode.com&#x2F;book&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;natureofcode.com&#x2F;book&#x2F;</a>) - see chapters 2 and 3 for instance.
评论 #37430013 未加载
RojerGSover 1 year ago
Hey there, OP here.<p>I jotted down some thoughts on how I think about (simple) animations and how to create them with some programming (in Python). I&#x27;d love to hear your thoughts on my write up and also what directions you suggest I take these personal explorations in.
bmerover 1 year ago
I do not understand how this is from &quot;first principles&quot;?
评论 #37430519 未加载
评论 #37429072 未加载
评论 #37432353 未加载
tantalorover 1 year ago
This is very accessible. With a few tiny changes it could run in JS in the browser, in a fiddle or something. Then reader could tweak the code and see changes without having to run pygame.
评论 #37430006 未加载
danbrucover 1 year ago
Drawing a circle by drawing circles - tiny ones, they will just look like single pixels - might be confusing to some, including me. I would suggest connecting adjacent points with lines, that is conceptually not really harder than just drawing the points and it will always give you a complete curve even if a step jumps across a couple of pixels.
ttfkamover 1 year ago
Not to be confused with the 12 principles of animation.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;uDqjIdI4bF4" rel="nofollow noreferrer">https:&#x2F;&#x2F;youtu.be&#x2F;uDqjIdI4bF4</a><p>mathspp.com will help with making an animation programmatically. The video I linked will help the animation be more compelling for the viewer.
HanClintoover 1 year ago
Looks great! Really nicely illustrated!