<< Tools
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 java.awt.image.BufferedImage; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import javax.imageio.ImageIO; | |
import java.util.Base64; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; |
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
float getVFov(float hFov, float w, float h) { | |
float hFovRad = hFov * PI / 180; | |
float vFovRad = 2 * atan(tan(hFovRad/2) * h/w); | |
return ceil(vFovRad * 180 / PI); | |
} | |
void setup() { | |
println("horizontal FOV 90 -> " + getVFov(90, 16, 9) + " vertical FOV (16:9)"); | |
} |
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
// https://forums.oculusvr.com/community/discussion/57052/quill-fbx-to-unity3d#latest | |
Shader "Unlit/Quill Shader" { | |
Properties { | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } |
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
>>> gps() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "<stdin>", line 4, in gps | |
File "/home/nick/GitHub/ros_unreal/tools/AirSimClient/AirSimClient.py", line 563, in getGpsLocation | |
return GeoPoint.from_msgpack(self.client.call('getGpsLocation')) | |
File "/home/nick/.local/lib/python3.5/site-packages/msgpackrpc/session.py", line 41, in call | |
return self.send_request(method, args).get() | |
File "/home/nick/.local/lib/python3.5/site-packages/msgpackrpc/future.py", line 45, in get | |
raise error.RPCError(self._error) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
background: black; | |
margin: 0px; | |
} |
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 val = "" + Math.round(effect("Point Control")("Point")[0]); | |
var returns = ""; | |
for (var i=val.length-1; i>=0; i--) { | |
returns += val[Math.abs(val.length-1-i)]; | |
if (i!=0 && i%3 == 0) returns += ","; | |
} | |
returns; |
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
#def writeSvg(strokes=None, name="test.svg", minLineWidth=3, camera=None): | |
#def writeSvg(filepath=None, minLineWidth=3, camera=None, fps=12, start=0, end=73): | |
def writeSvg(filepath=None): | |
minLineWidth=3 | |
camera=None | |
fps=None | |
start=None | |
end=None | |
#~ | |
#if not strokes: |
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 nervoussystem.obj.*; | |
PImage img; | |
boolean record = false; | |
void setup() { | |
size(600, 400, P3D); | |
img = loadImage("fox.png"); | |
img.loadPixels(); | |
noStroke(); |
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
# https://stackoverflow.com/questions/10908877/extracting-a-zipfile-to-memory | |
# https://stackoverflow.com/questions/11914472/stringio-in-python3 | |
# https://docs.python.org/2/library/zipfile.html | |
import zipfile | |
from io import BytesIO | |
class InMemoryZip(object): | |
def __init__(self): |