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 UnityEngine; | |
public class MovingPlatform : MonoBehaviour { | |
public float timeInterval = 5f; | |
public AnimationCurve XMotion; | |
public AnimationCurve YMotion; | |
public AnimationCurve ZMotion; | |
public bool PingPong = true; | |
float platformTime; |
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 System.Collections.Concurrent; | |
using UnityEngine; | |
using WacomMTDN; | |
// Simple Wacom Multitouch Unity Integration built from the Wacom's DotNet Example: | |
// https://developer-docs.wacom.com/display/DevDocs/Feel+Multi-touch+Sample+Code+Downloads | |
// WacomMTDN.dll can be found at: https://drive.google.com/file/d/1fvoRfIev28fKMvTrfF9IBZkAaWow5UJ4/view?usp=sharing | |
public class WacomMultiTouchProvider : MonoBehaviour { |
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
// Run at http://sketch.paperjs.org | |
function graphData(data){ | |
// Define the colors of the different species | |
let colors = { | |
'setosa': '#7fc97f', | |
'versicolor':'#beaed4', | |
'virginica':'#fdc086' | |
} | |
// Graph each datum |
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
import numpy as np | |
import cv2 | |
import face_alignment | |
# Initialize the face alignment tracker | |
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, flip_input=True, device="cuda") | |
# Start the webcam capture, exit with 'q' | |
cap = cv2.VideoCapture(0) | |
while(not (cv2.waitKey(1) & 0xFF == ord('q'))): |
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
import numpy as np | |
import cv2 | |
import face_alignment | |
# Initialize the chip resolution | |
chipSize = 300 | |
chipCorners = np.float32([[0,0], | |
[chipSize,0], | |
[0,chipSize], | |
[chipSize,chipSize]]) |
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
# Fitting Google's "Turbo" Palette with a Cosine Approximation | |
# https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html | |
# Inspired by: https://observablehq.com/@mbostock/turbo | |
# Compare: https://i.imgur.com/5GW6Se2.png | |
# First import the usual suspects | |
import numpy as np | |
from scipy.optimize import curve_fit | |
import matplotlib.pyplot as plt |
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
import numpy as np | |
import cv2 | |
import pyperclip | |
from PIL import ImageFont, ImageDraw, Image | |
laplacian = False | |
density = 17 | |
font_size_y = 18 | |
blur = 5 # Must Be Odd |
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 is just an example script for converting hand motions to PWM Servo Angles 1-255 | |
// Designed to be used with UnityModules - https://github.com/leapmotion/UnityModules | |
using Leap; | |
using Leap.Unity; | |
using UnityEngine; | |
public class HandAngleParser : MonoBehaviour { | |
private const int N_FINGERS = 5; | |
private const int N_ACTIVE_BONES = 2; |
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
export default opencascade; // Optional Line | |
declare function opencascade<T>(target?: T): Promise<T & typeof opencascade>; | |
declare module opencascade { | |
function destroy(obj: any): void; | |
function _malloc(size: number): number; | |
function _free(ptr: number): void; | |
const HEAP8: Int8Array; | |
const HEAP16: Int16Array; | |
const HEAP32: Int32Array; | |
const HEAPU8: Uint8Array; |
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 class provides Debug Utilities. */ | |
class Debug { | |
/** Reroute Console Errors to the Main Screen (for mobile) | |
* @param {Worker} worker */ | |
constructor(worker) { | |
// Route Worker Errors Here | |
worker.registerCallback("error", this.fakeError.bind(this)); | |
// Intercept Main Window Errors as well |
OlderNewer