Skip to content

Instantly share code, notes, and snippets.

View gonnavis's full-sized avatar

Vis gonnavis

View GitHub Profile
<script src="https://cdnjs.cloudflare.com/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>
<script>
var vConsole = new VConsole();
</script>
@gonnavis
gonnavis / object-watch.js
Created November 27, 2020 06:37 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet
.\[]{}^$()?=!<>|:*+
- if in [a-z]
, if in {,}
Object.keys(THREE)[Object.values(THREE).findIndex(n=>n===1001)]
let uniforms = THREE.UniformsUtils.merge([
THREE.ShaderLib.standard.uniforms,
{
diffuse: { value: new THREE.Color(1, 1, 1) },
cameraLengthInverse: { value: 0 },
},
]);
let material = new THREE.ShaderMaterial({
lights: true,
vertexColors: true,
// http://glslsandbox.com/e#61476.1
float hash( float n ){
return fract(sin(n)*1751.5453);
}
float hash1( vec2 p ){
return fract(sin(p.x+131.1*p.y)*1751.5453);
}
vec3 hash3( float n ){
@gonnavis
gonnavis / bonus.html
Created October 16, 2021 04:47 — forked from BlueMagnificent/bonus.html
Javascript 3D Physics Tut 2 Bonus
<html>
<head>
<meta charset="utf-8">
<title>Move JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
@gonnavis
gonnavis / contact_pair_test.html
Created October 17, 2021 01:13 — forked from BlueMagnificent/contact_pair_test.html
Javascript 3D Physics Tut 3 Contact Pair Test
<html>
<head>
<meta charset="utf-8">
<title>Collision JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
@gonnavis
gonnavis / contact_manifold_check_two.html
Created October 17, 2021 11:52 — forked from BlueMagnificent/contact_manifold_check_two.html
Javascript 3D Physics Tut 3 contact manifold check two
<html>
<head>
<meta charset="utf-8">
<title>Collision JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>