Skip to content

0x1ED1CE/VML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Vector Matrix Library

LICENSE

VML is a simple 3D math library intended for game development.

Features

  • Single header library written in C99
  • 2D and 3D vector functions
  • 3x3 and 4x4 matrix functions

How to use

Include library

#define VML_IMPLEMENTATION
#include "vml.h"

Returning a scalar value

float vector_a[3] = {1,2,3};
float scalar_b;

vml_vec3_mag(vector_a,&scalar_b); // scalar_b = ||vector_a||

Adding two vec3's

float vector_a[3] = {1,2,3};
float vector_b[3] = {4,5,6};

vml_vec3_add(vector_a,vector_b,vector_a); // vector_a = vector_a+vector_b

Multiplying mat4 with vec3

float matrix_a[16] = VML_MAT4_IDENTITY;
float vector_b[3]  = {1,2,3};

vml_mat4_vec3_mul(matrix_a,vector_b,vector_b}; // vector_b = matrix_a*vector_b

Refer to vml.h to see rest of the functions.

License

This software is free to use. You can modify it and redistribute it under the terms of the MIT license. Check LICENSE for further details.

About

A 3D math library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages