F# 3D Math Library


Keywords
License
BSD-3-Clause
Install
Install-Package FsMath3D -Version 1.7.0

Documentation

FsMath3D

F# 3D Math Library for realtime applications

Purpose

An F# 3D math library that can be used to make 3D games and applications. FsMath3D uses OpenGL GLSL semantics and conventions, so it's easier to interface with OpenGL and OpenGL ES.

Convention

The Matrices are written in Column major order (GLSL default). This means that the matrix:

| m0 m3 m6 |
| m1 m4 m7 |
| m2 m5 m8 |

has the following layout in memory: [| m0 m1 m2 m3 m4 m5 m6 m7 m8 |]

Modules

The FsMath3D is composed of several modules:

  • Vector

    • vec2, vec3, vec4: 2D, 3D and 4D single precision floating point vectors (32 bits per component)
    • ivec2, ivec3, ivec4: 2D, 3D and 4D signed integer vectors (32 bits per component)
    • color4: rgba color with single precision floating point components
  • Matrix: Contains mat2, mat3, mat4: 2x2, 3x3 and 4x4 single precision floating point matrices (32 bits per component)

  • Quaternion: For the quat type: a 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 components)
    • isize2: 2D size structure (signed int components)
    • tri16, tri32: vertices indices (16 bits unsigned short integer and 32 bit unsigned integer respectively)
    • rect2: 2D rectangle (single precision floating point components)
    • irect2: 2D rectangle (signed integer components)
    • ray3: 3D ray (single precision floating point components)
    • plane: 3D plane (single precision floating point components)
    • tri3: 3D triangle with 3 vec3 to represent vertices.
  • Queries: Intersection and proximity geometric query functions.

LICENSE

New BSD license (compatible with commercial and opensource applications)