Skip to content

Instantly share code, notes, and snippets.

View paniq's full-sized avatar

Leonard Ritter paniq

View GitHub Profile
@paniq
paniq / morph.glsl
Created July 1, 2014 04:52 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
const float strength=0.1;
void main() {
vec2 p = gl_FragCoord.xy / resolution.xy;
I tried to write a bit about my short contacts with
Haskell and why I don't really like it, but that's
just going to attract an angry mob; besides, my
experiences are too brief to really build a
solid opinion I would be able to defend.
So instead I'll write a bit about why I think that
our problems go deeper than any text-based
programming language could solve.
Noodles Model
=============
For my noodles graph programming I ended up rewriting the model.
I used to have several separate classes for each type: Type, Function, Call,
Argument, Result, Module, Scope, Link.
Then I realized I first need to have an extensible data descriptor model which
is general enough to permit building the above classes as specialized data - and
Below I collected relevant links and papers more or less pertaining to the subject of tetrahedral meshes.
It's an ever-growing list.
------------------------------
Relevant links:
http://en.wikipedia.org/wiki/Types_of_mesh
http://en.wikipedia.org/wiki/Tetrahedron
http://en.wikipedia.org/wiki/Simplicial_complex
@paniq
paniq / miller_111.py
Last active January 29, 2024 17:44
The FCC Coordinate System
"""
a demo of how to convert from cubic to a rhombohedral isometric lattice, which
is equivalent to tetrahedral / octahedral packing, but without the headache
of having to manage two separate primitives or interlaced grid structures
as with the face-centered cubic lattice, which produces an equivalent structure.
an integer conversion from tetrahedral to cartesian coordinates is as easy as
tx = y+z
@paniq
paniq / qr_solve.c
Created February 17, 2015 12:44
R8Lib-Based Reference Singular Value Decomposition Least Squares Solver (LGPL)
# include <stdlib.h>
# include <stdio.h>
# include <math.h>
# include <time.h>
# include "qr_solve.h"
//# include "test_ls.h"
# include "r8lib.h"
/******************************************************************************/
#define HERMITE_O_SHARP 0.9f
#define HERMITE_O_CORNER 0.7f
vec3_t dfm_hermite_feature(vec3_t com, DFMHermite *samples, int count) {
if (count < 2) return com;
float min_oa = 1e+20f;
int n0,n1;
for (int i = 0; i < count; ++i) {
@paniq
paniq / decocube.glsl
Created February 17, 2015 23:59
Decocube
// example for an implicit surface that is not lipschitz continuous
float decocube(vec3 p) {
float r = (0.8*0.8);
float a = ((p.x+p.y)-r);
float b = ((p.y+p.z)-r);
float c = ((p.z+p.x)-r);
vec3 u = (p-1.0);
float q = ((a*a)+(u.z*u.z));
float s = ((b*b)+(u.x*u.x));
@paniq
paniq / miller_101.py
Last active April 12, 2024 16:02
The BCC Coordinate System
"""
a demo of how to convert from cubic to BCC lattice, analog to the tetrahedral
or FCC lattice, but without the headache of having to manage an interlaced grid
structure as with the usual approach, at the expense of a diagonally skewed
non-cubic bounding box in cartesian coordinates.
an integer conversion from bcc to cartesian coordinates is as easy as
x = -tx+ty+tz
@paniq
paniq / dcsp.txt
Last active December 6, 2015 11:19
Dual Contouring with Sphere Packing
after a sleepness night of faces, edges and vertices rotating in my head I got
this idea this morning:
"Dual Contouring with Sphere Packing"
sample volume of implicit function on vertices and edges of the FCC lattice;
we get a set of hermite points denoting planes crossing the FCC edges, and
spherical center points that are either "inside" or not.
create vertices in voronoi diagram of lattice: the rhombic dodecahedral honeycomb,