Skip to content

Queatz/glmpython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installing

After cloning glm from https://github.com/g-truc/glm cd to the glm direcory and clone this repository.

To use the header file for the C-API, move the parsed python.hpp into the main glm include dir. For a global glm install it should look like:

#include <glm/python.hpp>

The source relies on Parseme being installed. Get it here: https://github.com/Queatz/Parseme

Do dir(glm) to see a list of supported types and function.

Basic Usage

>>> import glm
>>> a = glm.vec3()
>>> a
glm.vec3(0, 0, 0)
>>> a.brg = .3, 1, .5
>>> a
glm.vec3(1, 0.5, 0.3)
>>> b = glm.vec4(.7, a)
>>> b
glm.vec4(0.7, 1, 0.5, 0.3)
>>> c = b.yz
>>> c
glm.vec2(1, 0.5)
>>> c / glm.vec2(2, .5)
glm.vec2(0.5, 1)
>>> 

About

GLM math library for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published