Skip to Main Content
WebGL Beginner's Guide
book

WebGL Beginner's Guide

by Diego Cantor, Brandon Jones
June 2012
Beginner content levelBeginner
376 pages
8h 32m
English
Packt Publishing
Content preview from WebGL Beginner's Guide

Time for action – using point sprites to create a fountain of sparks

  1. Open the file ch10_PointSprites.html in an HTML5 browser.
    Time for action – using point sprites to create a fountain of sparks
  2. This sample creates a simple fountain of sparks effect with point sprites. You can adjust the size and lifetime of the particles using the sliders at the bottom. Play with them to see the effect it has on the particles.
  3. The particle simulation is performed by maintaining a list of particles that comprises of a position, velocity, and lifespan. This list is iterated over every frame and updated, moving the particle position according to the velocity and applying gravity while reducing the remaining lifespan. Once a particle's ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming 3D Applications with HTML5 and WebGL

Programming 3D Applications with HTML5 and WebGL

Tony Parisi

Publisher Resources

ISBN: 9781849691727Other