FsMath3D is an F# 3D geometry library for games and other realtime 3D applications.
FsMath3D adheres to the OpenGL GLSL semantics and conventions, so that it's easier to interface with OpenGL and OpenGL ES.
Matrices are stored in contigous memory as 1D arrays of a corresponding type in column-major order, which is the GLSL default. For example, the following matrix
is represented in memory as
[| a₁ ; a₂ ; a₃ ; b₁ ; b₂ ; b₃ ; c₁ ; c₂ ; c₃ |]
FsMath3D consists of the following modules:
-
vec2, vec3, vec4
: 2D, 3D and 4D vectors, single-precision (32-bit) floating point.ivec2, ivec3, ivec4
: 2D, 3D and 4D vectors, signed 32-bit integer.color4
: rgba color with single-precision floating point components.
-
Matrix.
mat2, mat3, mat4
: Square 2×2, 3×3 and 4×4 single-precision floating point matrices. -
Quaternion. The
quat
type: the quaternion with 4 single-precision floating point components. -
Transform. GLU equivalent functions to transform vectors or create transformation matrices.
-
Geometry: Geometric primitives:
size2
: 2D size structure, single-precision floating point.isize2
: 2D size structure, signed 32-bit integer.tri16, tri32
: vertex indices, 16- and 32-bit unsigned integers.rect2
: 2D rectangle, single-precision floating point.irect2
: 2D rectangle, signed 32-bit integer.ray3
: 3D ray, single-precision floating point.plane
: 3D plane, single-precision floating point.tri3
: 3D triangle with threevec3
vertices.
-
Queries. Intersection and proximity geometric query functions.
FsMath3D is licensed under the terms of the New BSD Three-Clause License
(SPDX-License-Identifier:
BSD-3-Clause
),
permitting the library's use and redistribution, contingent on license compliance,
in both commercial and non-commercial applications, either binary-only or open-source.
Copyright © 2015‒2018 Wael El Oraiby