Skip to content

Instantly share code, notes, and snippets.

Elie Michel eliemichel

Block or report user

Report or block eliemichel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eliemichel
eliemichel / hscript
Last active Jul 16, 2018
Fade out offset
View hscript
// Fade in
{
float x0 = ch("../PARAM/start_crossfade_frame");
float x1 = ch("../PARAM/end_crossfade_frame");
float a1 = 0.01;
float a0 = a1 / (2 * (x1 - x0));
float b1 = a0 * (x1 - x0) * (x1 - x0) - a1 * x1;
return if($FF < x0, 0, if($FF < x1, a0 * ($FF - x0) * ($FF - x0), a1 * $FF + b1));
}
// Fade out
View autoRotateMaya.py
"""
autoRotate
==========
Align the selected edge to the world X axis of the scene by rotating the whole mesh.
Usage
-----
Select exactly one edge, then run the script.
View autoTransformBlender.py
"""
autoRotate
==========
(Blender edition -- also available for Maya)
Align the selected edge to the world X axis of the scene by rotating the whole mesh.
Usage
-----
View bufA.glsl
// Copyright (c) 2017 - Élie Michel
// License: CC BY 3.0
// Please credit even if you are just re-using the particle system.
// Sync with 'Image' buffer
const float dt = 0.001;
mat3 particleSpaceMatrix(vec2 origin, vec2 velocity) {
vec3 O = vec3(origin, 1.);
vec3 X = normalize(vec3(velocity, 0.));
View sphere.glsl
struct Ray {
vec3 origin;
vec3 direction;
};
bool intersectRaySphere(out vec3 intersection, in Ray ray, in vec3 center, in float radius) {
vec3 o = center - ray.origin;
float d2 = dot(ray.direction, ray.direction);
float r2 = radius * radius;
View rain-drops-280.glsl
#define a(p) textureLod(iChannel0, p, 2.5)
#define t texture(iChannel1,
void mainImage( out vec4 c, vec2 g )
{
c = a(g /= iResolution.xy);
vec2 x = vec2(20);
vec4 n = t round(g*x - .3) / x);
vec2 z = g*x * 6.3 + (t g * .1).rg - .5) * 2.;
x = sin(z) - fract(iTime * (n.b + .1) + n.g) * .5;
View shadertoy-ldSBWW.glsl
// Author: Élie Michel
// License: CC BY 3.0
// July 2017
void mainImage( out vec4 f, in vec2 c )
{
vec2 u = c / iResolution.xy,
n = texture(iChannel1, u * .1).rg; // Displacement
f = textureLod(iChannel0, u, 2.5);
View papHelper.js
/**
* Extrait de code à exécuter dans la console du navigateur pour ajouter
* sous les prix le prix au mètre-carré et le prix par chambre dans les
* résultats de logement sur pap.fr
* Fonctionne au 17/04/2017, mais puisque le code est très ad-hoc il faudra
* sûrement le mettre à jour à chaque màj de pap.fr
*
* Existe aussi pour seloger.com :
* https://gist.github.com/eliemichel/1c6f27be406a22a0d5114020c616d3e8
*
View selogerHelper.js
/**
* Extrait de code à exécuter dans la console du navigateur pour ajouter
* sous les prix le prix au mètre-carré et le prix par chambre dans les
* résultats de logement sur seloger.com
* Fonctionne au 17/04/2017, mais puisque le code est très ad-hoc il faudra
* sûrement le mettre à jour à chaque màj de seloger.com
*
* Existe aussi pour pap.fr :
* https://gist.github.com/eliemichel/e292bae7b439e15cf7da37ae518f08dc
*
View getNearestUCDPulse.py
def getNearestUCDpulse(azimuth, elevation, h3D):
"""
retrieves the impulse response from h3D that is closest to the specified
azimuth and elevation (in degrees)
h3D is the array containing all HRTFs for a given subject (left or right)
"""
elmax = 50
elindices = np.arange(elmax)
elevations = -45 + 5.625 * elindices
You can’t perform that action at this time.