Skip to content

Just Math - A collection of pure math demos for computer graphics.

License

Notifications You must be signed in to change notification settings

bing55xuan/just_math

 
 

Repository files navigation

just_math

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. This repository consists of 'libmin', a minimal utility library for math and graphics, along with several math examples for various concepts.

Copyright 2007-2022 (c) Quanta Sciences, Rama Hoetzlein, htpp://ramakarl.com. MIT License.
Contact: ramahoetzlein@gmail.com

Sample Gallery

Just Math Samples

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.
  • Basis - Orthonormal bases. Transformation from one space to another using bases.
  • BeliefProp - Belief propagation. Demonstrated on a 3D grid domain with speedups.
  • Cells - Cellular membrane simulation. Simulated with physics using circles for cells.
  • Deform - 3D spatial deformations, including bending, twisting and folding.
  • InvK - Inverse Kinematics using quaternions. Demo of robot and human arm IK.
  • 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.
  • Flightsim - NEW 2023. Simple force-driven flight simulator.

Libmin

Libmin stands for minimal utility library for computer graphics. Libmin combines multiple useful functions into a single library, but with no external dependencies. Projects with BSD and MIT Licenses have been merged into libmin. The full library is MIT Licensed. Copyrights may be appended but should not be modified or removed. The functionality in Libmin includes:

  • Vectors, 4x4 Matrices, Cameras (vec.h, camera.h)
  • Quaternions (quaternion.h)
  • Stateful Mersenee Twister RNG (mersenne.h)
  • Event system (event.h, event_system.h)
  • Drawing in 2D/3D in OpenGL core profile (nv_gui.h)
  • Smart memory pointers for CPU/GPU via OpenGL/CUDA (dataptr.h)
  • Image class, with multiple image loaders (image.h, png/tga/jpg/tiff)
  • Directory listings (directory.h)
  • Http connections (httlib.h)
  • Time library, with nanosecond accuracy over millenia (timex.h)
  • Widget library, very basic GUI (widget.h)

How to Build

Platforms:
Win10, Visual Studio 2019 - definitely
Win10/11, VS{other} - probably
Linux - yes, libmin and math_belief_prop only
Mac - unknown
Dependencies: OpenGL only, CUDA is optional (flag at cmake time)

Cmake build options should default to BUILD_OPENGL=ON, BUILD_CUDA=off, BUILD_CONSOLE=off.
Keep these settings. CUDA and/or Console mode are not yet well supported.

Step 1) Cmake and build Libmin.

Windows: cmake -S \just_math\libmin -B \build\libmin

Linux: cmake -DBUILD_OPENGL=OFF (you may need to create a libmin\bin folder and copy liblibmin.so into libmin\bin\libmind.so and libmin\bin\libmin.so)

The binary (build) path should be outside of the source \just_math folder.
You must successfully build libmin before proceeding to step 2.

Step 2) Cmake and build sample.

Windows: cmake -S \just_math\raycast -B \build\raycast

Linux: cmake -DBUILD_OPENGL=OFF -DBUILD_CONSOLE=ON -DLIBMIN_ROOT_DIR={abspath}

The binary (build) path should be outside of the source \just_math folder.
Build and run the sample.

Contributions

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, ramahoetzlein@gmail.com

License

MIT License
Copyright 2007-2022 (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.
Individual portions of libmin are listed here with their original licensing.
Copyright listing for Libmin:

Copyright (c) 2007-2022, Quanta Sciences, Rama Hoetzlein. MIT License (image, dataptr, events, widget)
Copyright (c) 2017 NVIDIA GVDB, by Rama Hoetzlein. BSD License (camera3d, tga, gui, str_helper, vec, mains)
Copyright (c) 2020 Yuji Hirose. MIT License (httplib.h)
Copyright (c) 2005-2013 Lode Vandevenne. BSD License (LodePNG, file_png)
Copyright (c) 2015-2017 Christian Stigen Larsen. BSD License (mersenne)
Copyright (c) 2002-2012 Nikolaus Gebhardt, Irrlicht Engine. BSD License (quaternion)

Contact: Rama Hoetzlein at ramahoetzlein@gmail.com

About

Just Math - A collection of pure math demos for computer graphics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 50.0%
  • C++ 35.4%
  • JavaScript 11.0%
  • CMake 2.4%
  • Python 0.8%
  • Shell 0.3%
  • Batchfile 0.1%