1.1.19 • Published 2 years ago
@jingwood/graphics-math v1.1.19
js-graphics-math
Math library for JavaScript 2D/3D graphics rendering.
Classes
The following classes available under src folder.
- Vector2
- Vector3
- Matrix3
- Matrix4
- Quaternion
- BoundingBox 2D
- BoundingBox 3D
- KDTree for 2D points
- KDTree for 3D points
- KDTree for 3D triangles
- OCTree for 3D triangles
- Ray
- Color3 (RGB)
- Color4 (RGBA)
Functions
Functions below available at src/functions.js.
Base math functions
- clamp (1D/2D/3D)
- smoothstep
- angleToArc
Distance measuring
- distancePointToPoint (2D/3D)
- distancePointToLine (2D)
- distancePointToLineSegment (2D)
- distancePointToRect (2D)
- distancePointToPolygon (2D)
- findNearestPointToLineSegement (2D)
- findNearestPointToPolygon (2D)
Intersecting test
- lineIntersectsLine (2D)
- lineIntersectsRect (2D)
- lineIntersectsPolygon (2D)
- rectIntersectsRect (2D)
- rectIntersectsPolygon (2D)
- checkLineParallel
Containing test
- rectContainsPoint (2D)
- triangleContainsPoint (2D)
- polygonContainsPoint (2D)
- polygonContainsRect (2D)
- calcPolygonArea (2D)
Ray test
- rayIntersectsPlane (3D)
- rayIntersectsTriangle (3D)
- rayIntersectsSphere (3D)
- rayIntersectsBox (3D)
Vertex interpolation
- calcVertexInterpolation (3D) Calculate the interpolated vertex coordinate on a specified point of a 3D triangle with vertex coordinates.
Software uses this library
- tarumae-viewer - Optimized WebGL engine for Showcase application https://github.com/bulbinc/tarumae-viewer
Related Libraries
- cpp-graphics-module (A C++ version of this library) https://github.com/jingwood/cpp-graphics-module
License
Released under MIT License.
Copyright (C) Jingwood & unvell.com, all rights reserved.
1.1.19
2 years ago
1.1.18
3 years ago
1.1.17
3 years ago
1.1.16
3 years ago
1.1.15
4 years ago
1.1.14
4 years ago
1.1.13
4 years ago
1.1.12
4 years ago
1.1.11
4 years ago
1.1.10
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago