Skip to content

this web assembly module implements all the basic computationally heavy calculations needed for webgl.

License

Notifications You must be signed in to change notification settings

phantom22/webgl-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webgl-wasm

This module implements essential data structures for 3D environments, including 2D/3D/4D vectors, 3x3/4x4 matrices, quaternions, and methods for operations on scalar types like i32, f32, and f64.

It efficiently computes:

  • Rotation matrices/quaternions for any XYZ-order Euler angles.
  • Transformation matrices for scaling, rotation (Euler angles), and translation.
  • Transformation matrices from rotation matrices or quaternions.
  • View matrices.
  • Perspective and orthographic projection matrices.
  • Combined view-projection matrices (perspective and orthographic).
  • Viewport matrices.

Memory allocation follows two patterns:

  • malloc_<structure>: Allocates memory.
  • new_<structure>: Allocates memory and initializes values.

Both functions return the memory offset for use in dest/from arguments.


The provided example demonstrates how to set up a TypeScript environment (recommended for type safety) and implement the imports required by the WebAssembly module.

About

this web assembly module implements all the basic computationally heavy calculations needed for webgl.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published