Just Math - A collection of pure math demos.
The goal of Just Math is to provide both a visual example and code demonstrations of specific concepts in computer graphics, mathematics, simulation and AI.
Copyright 2007-2023 (c) Quanta Sciences, Rama Hoetzlein, htpp://ramakarl.com. MIT License.
Contact: [email protected]
Each sample in Just Math demonstrates a specific concept in code and visually. The samples provided are briefly described:
- 3DDDA - 3D Differential Analyzer. March through a volume to identify voxels on a line.
- ANN - Artificial Neural Network learning the sine function.
- Basis - Orthonormal bases. Transformation from one space to another using bases.
- Bilinear Patch - Fast raytracing of a bilinear patch (curved quad defined by 4x points).
- Cells - Cellular membrane simulation. Simulated with physics using circles for cells.
- Deform - 3D spatial deformations, including bending, twisting and folding.
- Gcoder - Generation of CNC toolpath g-code from depth images.
- InvK - Inverse Kinematics using quaternions. Demo of robot and human arm IK.
- Obj Materials - Reads and renders 3D meshes (.obj) with their material (.mtl) definitions.
- QuatSquad - Quaternion Squad. A C1 continuous method for interpolating orientations.
- QuatTrajectory - Trajectory interpolation of both position and orientation, using B-Splines, Bezier Curves, and Catmull-Rom splines for position. Slerp or Squad for orientation.
- Raycast - Rendering of a 3D volume with an opacity-based volume integral, on CPU.
- Voxelizer - Voxelization of triangle into a volume, using several methods.
- WangTiles - Sampling of spatial distribution functions with scale invariance.
- WangTiles3D - Alternative demo of Wang Tiles for 3D geometry instancing over a density map landscape.
UPDATES:
Dec 5, 2023 - Build steps confirmed working with latest libmin repo and Visual Studio 2019 in Dec 2023 for all samples. Removed libmin from this repo and put into its own separate repository.
Sep 16,2023 - Obj materials sample added.
Aug 12,2023 - G-coder sample added.
Mar 13,2023 - Bilinear Patch intersection sample added.
Feb 7, 2023 - Artificial Neural Network sample added. PS: For fun I wrote the original wikipedia article for Tensor (machine learning).
Platforms:
- Win10, Visual Studio 2019/2022 - definitely
- Win10/11, VS{other} - probably
- Linux - should work, post any issues
Dependencies:
- Libmin - minimal utilitiy libary for graphics.
- OpenGL
- CUDA is optional (flag at cmake time)
Step 1) Build Libmin
Cmake and build Libmin from here
Libmin repo: https://github.com/ramakarl/libmin
The binary (build) path should be outside of the \libmin repo folder as follows.
Windows:
1.1) cmake CMakeLists.txt -B..\build\libmin {options}
1.2) Open and compile the generated \build\libmin\libmin.sln in Visual Studio 2019+
Linux:
1.1) cmake CMakeLists.txt -B../build/libmin {options}
1.2) make ../build/libmin
By default, you should not need to specify any additional options for just_math samples.
Options (multiple may be specified):
-DBUILD_OPENGL=true/false - for interactive apps, required for just_math (default=true)
-DBUILD_GLEW=true/false - for interactive apps, required for just_math (default=true)
-DBUILD_CUDA=true/false - for GPU-based apps (default=false)
-DBUILD_OPENSSL=true/false - for secure network apps (default=false)
-DBUILD_BCRYPT=true/false - for secure network apps (default=false)
-DUSE_NVTX - for Nvidia Nsight timeline-based profiling, cpu & gpu (default=false)
-DUSE_PROFILE_NET - profile network code (default=false)
You must successfully build libmin before proceeding to step 2.
Step 2) Build sample
Cmake and build a sample.
The binary (build) path should be outside of the source \just_math folder as follows (-B option).
Windows:
2.1) cmake -S \just_math\{sample_name} -B \build\{sample_name} -DLIBMIN_PATH=\build\libmin
2.2) Open and compile the generated \build{sample_folder}{sample_name}.sln in Visual Studio 2019+
Linux:
2.1) cmake -S \just_math\{sample_name} -B \build\{sample_name} -DLIBMIN_PATH=/build/libmin
2.2) make \build\{sample_name}
All samples are apps that make use of libmin.
Provide the Libmin location:
- Specify the installed path of libmin as LIBMIN_PATH during cmake. eg.
-DLIBMIN_PATH=/usr/local/libmin/
- If that doesn't work, also specify the path to the source repository with LIBMIN_REPO. eg.
-DLIBMIN_REPO=/libmin
Build and run the sample.
I am interested in building a community around simple, well documented, math codes, in pure C/C++ for CPU (no shaders), with interactive graphical demos (not just youtube videos) that are MIT/BSD Licensed. If you have similar interests contact me at: Rama Hoetzlein, [email protected]
MIT License
Copyright 2007-2023 (c) Quanta Sciences, Rama Hoetzlein, ramakarl.com
The Just Math samples are MIT Licensed.
Libmin is MIT Licensed with contributions from other BSD and MIT licensed sources.
Contact: Rama Hoetzlein at [email protected]