lamberta / html5-animation Goto Github PK
View Code? Open in Web Editor NEWFoundation HTML5 Animation with JavaScript example code and book exercises.
Home Page: http://lamberta.github.io/html5-animation/
License: MIT License
Foundation HTML5 Animation with JavaScript example code and book exercises.
Home Page: http://lamberta.github.io/html5-animation/
License: MIT License
The code for the 04-wave-1.html in the book is missing the line
angle+= yspeed;
So the ball does not move vertically.
Hello,
Your book is excellent, Thank You for writing it.
Books like yours have been my source of education for web development.
I just noticed a small thing on page 63 of the pdf file and thought I would bring it to your attention.
"Breaking that down, you get 36 + 64, or 100 = dist**2.
With some basic algebra, you can reduce that to .100 = dist.
/* I believe this sentence should be omitted */
And from that, you can easily figure out that the distance between the two objects is 10."
Thank You again for your work.
Jim
Hi Billy, great book.
On page 228, there's a couple of equations
x1 = (x-centerX) * cos(rotation) - (y-centerY) * sin(rotation)
y1 = (y-centerY) * cos(rotation) + (x-centerX) * sin(rotation)
I tried coding these up and it certainly rotates the point, but it is offset by (-centerX, -centerY)
Should the equations be these?
x1 = centerX + [(x-centerX) * cos(rotation) - (y-centerY) * sin(rotation)]
y1 = centerY + [(y-centerY) * cos(rotation) + (x-centerX) * sin(rotation)]
Cheers,
Ed
nice works.
Ben Joff, 2006
[This question was sent to me via email, excerpts reposted here with permission.]
I have been playing with the code below [Chapter 8, Example 11] ... When the canvas renders the lines, they're on top of the balls, but in the example before (where an array is not used) the balls are drawn on top. I was trying to figure out how to draw the line underneath like the first example. Going through the code I am not sure where ballB
gets defined. var ballA = balls[i-1];
defines ballA
but how is ballB
defined? Is it a key from the array? And if so why is ballA
defined?
Thank you!
Peter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.