HTML5 Animation: Examples and Code from Simple to Complex
Join the DZone community and get the full member experience.
Join For FreeDeep down, animation in HTML5 isn't fundamentally different from any other kind of computer graphics programming. You use math to describe objects, and then to describe alterations of those objects. In HTML5, you'll be doing these calculations in JavaScript, and outputting the results to an HTML5 Canvas.
But Canvas opens the animation door to many new web developers -- many of whom haven't done (much or any) animation before, however comfortable they are with JavaScript.
The book Foundation HTML5 Animation with JavaScript is written for such developers -- also for experienced Flash developers looking to head toward HTML5, as Adobe is already doing.
But even without the book, you can browse all the examples, with source code, from how to setup a Canvas, to small necessities like 'listening for keyboard events', to basic animation geometry (will take you back to high school), to specific rendering techniques, basic physics, object deformation, complex collisions, etc.
Simplified TOC:
- Basic Animation Concepts
- Basics of JavaScript for Animation
- Trigonometry for Animation
- Rendering Techniques
- Velocity and Acceleration
- Boundaries and Friction
- User Interaction: Moving Objects Around
- Easing and Springing
- Collission Detection
- Coordinate Rotation and Bouncing Off Angles
- Billiard Ball Physics
- Particle Attraction and Gravity
- Forward Kinematics: Making Things Walk
- Inverse Kinematics: Dragging and Reaching
- 3D Basics
- 3D Lines and Fills
- Backface Culling and 3D Lighting
- Matrix Math
- Tips and Tricks
Straightforward examples, incremental difficulty, really informative code. Walks you from 'I sort of know JavaScript syntax' to creating squishy, bouncy 3D balls in Canvas.
Definitely worth checking out.
Opinions expressed by DZone contributors are their own.
Comments