This file contains hidden or 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 https://math.stackexchange.com/questions/296794/finding-the-transform-matrix-from-4-projected-points-with-javascript/339033#339033 | |
| // and http://jsfiddle.net/dFrHS/1/ | |
| function adj(m) { // Compute the adjugate of m | |
| return [ | |
| m[4]*m[8]-m[5]*m[7], m[2]*m[7]-m[1]*m[8], m[1]*m[5]-m[2]*m[4], | |
| m[5]*m[6]-m[3]*m[8], m[0]*m[8]-m[2]*m[6], m[2]*m[3]-m[0]*m[5], | |
| m[3]*m[7]-m[4]*m[6], m[1]*m[6]-m[0]*m[7], m[0]*m[4]-m[1]*m[3] | |
| ]; | |
| } |
This file contains hidden or 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
| #target illustrator | |
| var document = app.activeDocument; | |
| var maxLength = prompt ("maximum length of a path", 10, "destroy them with lasers!"); | |
| for (i=0 ; i< document.pathItems.length; i++) | |
| { | |
| var ipath = document.pathItems[i] | |
| if( ipath.hidden == true )continue; | |
| var l = 0; | |
| for( var j = 0; j < ipath.pathPoints.length - 1; j++ ){ | |
| var p0 = ipath.pathPoints[j].anchor; |
This file contains hidden or 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
| /** | |
| original code https://gist.github.com/Dan-Piker/f7d790b3967d41bff8b0291f4cf7bd9e | |
| need to declare the following: | |
| uniform vec3 origin; | |
| uniform float p; | |
| uniform float q; | |
| uniform float t; | |
| */ |
This file contains hidden or 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
| import { | |
| BufferAttribute, | |
| Group, | |
| InstancedBufferAttribute, | |
| InstancedBufferGeometry, | |
| Mesh, | |
| MeshStandardMaterial, | |
| Vector3, | |
| } from "three"; | |
| import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js"; |
This file contains hidden or 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
| import os | |
| import argparse | |
| import cv2 | |
| import numpy as np | |
| from tqdm import tqdm | |
| from math import ceil, sqrt | |
| def atlasFromFolder( name, src, dst, tile, packChannels, quality ): | |
| if src[:-1] != "/": |
This file contains hidden or 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
| import os | |
| import cv2 | |
| import numpy as np | |
| folder = "./cat/" | |
| files = os.listdir(folder) | |
| files.sort( ) | |
| dst = np.ones( (143,143), np.float ) | |
| for i, (f) in enumerate( files ): | |
| img = cv2.imread(folder + f, cv2.IMREAD_UNCHANGED) | |
| img = cv2.cvtColor( img, cv2.COLOR_BGR2GRAY ) |
OlderNewer