haxiomic / vector-math

Shader-math in haxe: library for GLSL vector operations, complete with swizzles and all
MIT License
39 stars 7 forks source link

Transformation matrices #6

Closed hansagames closed 3 years ago

hansagames commented 3 years ago

Hi, not really an issue, but more question. I was trying to use vector-math instead of gl-matrix framework, and all was good until I realised that transformation matrices are missing here (scale, translate, rotate...), also perspective matrix as well.

Now wondering what would be best place to add them , as they don't belong to glsl api.

Could they be added here or its better to make extra lib that uses vector-math and implements missing parts.

haxiomic commented 3 years ago

Hey :) I think perspective / orthographic are a bit out of scope because they depend on the target graphics pipeline (they encode details about the coordinate system and depth range) so these are better suited as part of a graphics engine lib

Ultimately the aim with this lib is to build more advanced systems on top like Geometric Algebra, so I’m cautious of building in Linear Algebra concepts like transformation matrices because that would conflict with GA. Later on however I hope to add LinearAlgebra.hx that will have all that good stuff :)

Best thing for now I think is to take a look at the gl-matrix’s implementations and port those. You could also take a look at three.js’s Matrix4 for another reference

hansagames commented 3 years ago

Hey thanks, thats what I was thinking :) so better to create haxe lib on top of vector-math with missing functionality