Skip to content

Instantly share code, notes, and snippets.

View victorbstan's full-sized avatar

Victor Stan victorbstan

  • Remote
View GitHub Profile
(function($) {
// SIMPLE BOX
// make your own lightbox cuz they all suck
var imgSrc
, $simpleBox;
window.fitImg = function() {
var $img = $("#simple-box img");
@victorbstan
victorbstan / DoPlanesIntersectAtSinglePoint.cs
Created February 4, 2023 16:04 — forked from StagPoint/DoPlanesIntersectAtSinglePoint.cs
Find intersection point of three planes in C# for Unity
private bool planesIntersectAtSinglePoint( Plane p0, Plane p1, Plane p2, out Vector3 intersectionPoint )
{
const float EPSILON = 1e-4f;
var det = Vector3.Dot( Vector3.Cross( p0.normal, p1.normal ), p2.normal );
if( det < EPSILON )
{
intersectionPoint = Vector3.zero;
return false;
}
@victorbstan
victorbstan / ConvexHull.cs
Created February 4, 2023 21:58 — forked from YclepticStudios/ConvexHull.cs
Convex hulling algorithm for Unity; converts a point cloud into triangle indices for meshing.
/**
* ============================================================================
* MIT License
*
* Copyright (c) 2016 Eric Phillips
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,