var script document createElement script script type text javascript script src https cdnjs cloudflare com ajax libs gl matrix 2 6 0 gl matrix min js document head appendChild script script onload function let m mat4 create console log m console log String m console log m instanceof Float32Array m instanceof Float32Array let v vec4 create console log v console log String v v x 2 console log v let r vec4 create vec4 transformMat4 r v m console log r console log list all methods available in vec4 for let key in vec4 console log key m 4 4 m 5 5 console log String m see https glmatrix net docs for detailed information on the various matrix libraries vec2 vec3 vec4 mat2 mat3 mat4 etc end onload Different versions e g 3 4 2 https cdnjs cloudflare com ajax libs gl matrix 3 4 2 gl matrix min js Also GitHub page https github com toji gl matrix utm_source cdnjs utm_medium cdnjs_link utm_campaign cdnjs_library As show here you can also import components more modular import as glMatrix from https cdn jsdelivr net gh toji gl matrix src common js import as vec3 from https cdn jsdelivr net gh toji gl matrix src vec3 js import as vec4 from https cdn jsdelivr net gh toji gl matrix src vec4 js import as quat from https cdn jsdelivr net gh toji gl matrix src quat js import as mat4 from https cdn jsdelivr net gh toji gl matrix src mat4 js others import as glMatrix from common js import as mat2 from mat2 js import as mat2d from mat2d js import as mat3 from mat3 js import as mat4 from mat4 js import as quat from quat js import as quat2 from quat2 js import as vec2 from vec2 js import as vec3 from vec3 js import as vec4 from vec4 js list all vec3 elements for let key in vec3 console log vec3 key console log ready
cdnjs utm_medium cdnjs_link utm_campaign cdnjs_library As show here you can also import components more modular import as glMatrix from https cdn jsdelivr net gh toji gl matrix src common js import as vec3 from https cdn jsdelivr net gh toji gl matrix src vec3 js import as vec4 from https cdn jsdelivr net gh toji gl matrix src vec4 js import as quat from https cdn jsdelivr net gh toji gl matrix src quat js import as mat4 from https cdn jsdelivr net gh toji gl matrix src mat4 js others import as glMatrix from common js import as mat2 from mat2 js import as mat2d from mat2d js import as mat3 from mat3 js import as mat4 from mat4 js import as quat from quat js import as quat2 from quat2 js import as vec2 from vec2 js import as vec3 from vec3 js import as vec4 from vec4 js list all vec3 elements for let key in vec3 console log vec3 key console log ready