This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ygl.openrndr.demos | |
import org.openrndr.application | |
import org.openrndr.color.rgb | |
import org.openrndr.draw.LineCap | |
import org.openrndr.draw.renderTarget | |
import org.openrndr.extra.compositor.compose | |
import org.openrndr.extra.compositor.draw | |
import org.openrndr.extra.compositor.post | |
import org.openrndr.extra.fx.blur.FrameBlur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "Delegate.h" | |
#include "Delegates/IDelegateInstance.h" | |
#include "LogMacros.h" | |
#include "UnrealTypeTraits.h" | |
namespace Private | |
{ | |
template <bool, class T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import * | |
# a performant solution would store a prefix sum of line lengths to | |
# a sidechannel and then use that to do a bsearch; on the GPU, | |
# you'd do a sum tree / histopyramid as a preprocessing step | |
def find_point(points, d): | |
d = d | |
for i in range(1, len(points)): | |
x0,y0 = points[i-1] | |
x1,y1 = points[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __MATRIX_INCLUDED__ | |
#define __MATRIX_INCLUDED__ | |
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) | |
float4x4 inverse(float4x4 m) { | |
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; | |
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; | |
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; | |
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this code is licensed CC-0 https://creativecommons.org/publicdomain/zero/1.0/ . use as you see fit.*/ | |
function distance(a, b) { | |
/* Find the Euclidean distance between two 2-dimensional points. | |
* | |
* a: the first point. | |
* b: the second point. | |
* | |
* returns: the distance. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ncp = require('ncp').ncp; | |
var copyobj = require('../package.json').copy; | |
for (var prop in copyobj) { | |
ncp(copyobj[prop].src, copyobj[prop].dest, function (err) { | |
if (err) { | |
return console.error(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set dFolder to "~/Desktop/screencapture/" | |
do shell script ("mkdir -p " & dFolder) | |
set i to 0 | |
repeat 960 times | |
do shell script ("screencapture " & dFolder & "frame-" & i & ".png") | |
delay 30 -- Wait for 30 seconds. | |
set i to i + 1 | |
end repeat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { | |
if (p < 0.5) | |
return 0.5 * pow(2*p, g); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/* **************** | |
* Sample Usage * | |
**************** | |
// prerequisite : put a gameobject with the ADSR script on it in your scene | |
// this enables the update loop that transparently updates Envelope objects | |
NewerOlder