An implementation of David Eberly's mesh clipping algorithm with demo program in odin. See comment at top of file for controls.
| package audio | |
| import "core:fmt" | |
| // https://miniaud.io/docs/ | |
| import ma "vendor:miniaudio" | |
| // 0 - Use native channel count of the device | |
| AUDIO_CHANNELS :: 0 | |
| AUDIO_SAMPLE_RATE :: 0 |
| // Port of some collision functions to Odin by Jakub Tomšů. | |
| // | |
| // from Real-Time Collision Detection by Christer Ericson, published by Morgan Kaufmann Publishers, © 2005 Elsevier Inc | |
| // | |
| // This should serve as an reference implementation for common collision queries for games. | |
| // The goal is good numerical robustness, handling edge cases and optimized math equations. | |
| // The code isn't necessarily very optimized. | |
| // | |
| // There are a few cases you don't want to use the procedures below directly, but instead manually inline the math and adapt it to your needs. | |
| // In my experience this method is clearer when writing complex level queries where I need to handle edge cases differently etc. |
| let totalSize = 0; | |
| for (let key in localStorage) { | |
| if (localStorage.hasOwnProperty(key)) { | |
| let keySize = new Blob([key]).size; // Size of the key | |
| let valueSize = new Blob([localStorage[key]]).size; // Size of the value | |
| totalSize += keySize + valueSize; | |
| } | |
| } |
If you've ever used a 3D editor, then you've most likely used a certain thing called "Gizmo", Gizmos are essentially transformation modifiers that's within a world, they let you modify the object's position, orientation and scale. The implementation of a Gizmo is actually fairly straightforward for the most part (or may not be depending on how your application handles things internally, but at the fundamental level it's simple).
This article would only cover Translations and Rotations, Scaling is very easy to implement after understanding how the first two work. And also this may give you a hint into how Blender's robust implementation of Gizmo works as well!
https://lotusspring.substack.com
This code was written without the intention of being publicly shared. Not much effort was put into beautification or anything like that, one big file that does it all! Some effort is requried on your part to make this compile.
I heavily dislike python and consider the code wasteful slop. I have very little python experience, so there are likely much better ways of writing the python portion. Exercise caution!

