Skip to content

Instantly share code, notes, and snippets.

🐩
🏃

Ricky Reusser rreusser

🐩
🏃
Block or report user

Report or block rreusser

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
View arrow-strip.js
'use strict';
var DEFAULT_COLOR = [0, 0, 0, 1];
var DEFAULT_ARROWHEAD_WIDTH = 8;
var DEFAULT_ARROWHEAD_LENGTH = 14;
var DEFAULT_LINE_WIDTH = 2;
module.exports = function (regl, opts) {
return regl({
vert: `
View index.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<title>---</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta charset=utf-8></head>
<body></body>
<script>
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
View demo.js
var controls = require('./');
var panel = window.panel = controls({
color: '#ff0000',
name: 'test',
count: 7,
activated: true,
shape: {
width: 640,
height: 480
View Makefile
src = int_sqrt.cc
jsobj = $(src:.cc=.js)
wasmobj = $(src:.cc=.wasm)
EMCC = emcc
EMFLAGS = -std=c++11 \
-O3 \
-s WASM=1 \
-s SIDE_MODULE=1 \
-s BINARYEN_ASYNC_COMPILATION=0
View Makefile
src = int_sqrt.cc
jsobj = $(src:.cc=.js)
wasmobj = $(src:.cc=.wasm)
EMCC = emcc
EMFLAGS = --bind -std=c++11
int_sqrt.js: $(src)
$(EMCC) $< -o $@ $(EMFLAGS)
View Makefile
src = int_sqrt.cc
jsobj = $(src:.cc=.js)
wasmobj = $(src:.cc=.wasm)
EMCC = emcc
EMFLAGS = --bind \
-std=c++11 \
-O2 \
-s WASM=1 \
-s SIDE_MODULE=1 \
View README.md

dynamic-typedarray

Introduction

This module wraps typed arrays with a minimal abstraction so that you can resize and append to them without reallocating and transferring data yourself.

Example

When initializing, you may pass an Array, a typed array, a size, or a dtype string. (Adding a dtype string will cast the data if necessary.) The following are equivalent ways to initialize a double precision dynamic typed array.

View index.js
const regl = require('regl')({extensions: ['oes_standard_derivatives']});
const glsl = require('glslify');
const camera = require('regl-camera')(regl);
const mesh = require('glsl-solid-wireframe')(require('bunny'));
const draw = regl({
frag: glsl`
#extension GL_OES_standard_derivatives : enable
precision mediump float;
#pragma glslify: grid = require(glsl-solid-wireframe/barycentric/scaled)
View LICENSE
The MIT License (MIT)
Copyright (c) 2018 Ricky Reusser
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, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
You can’t perform that action at this time.