June 2021
Intermediate to advanced
304 pages
7h 49m
English
In this chapter, you’ll learn how to use WebAssembly with the HTML canvas element to create fast and efficient animations in a web application. We’ll manipulate pixel data inside the WebAssembly linear memory, and then transfer that pixel data in linear memory directly onto the HTML canvas. We’ll continue with our random collider objects example (Listing 6-16) by generating the objects in JavaScript linear memory and then using WebAssembly to move these objects, detect collisions, and render them. Because the number of possible collisions grows exponentially with the number of objects, this kind of graphical collision ...
Read now
Unlock full access