Skip to content

Instantly share code, notes, and snippets.

View RomainKurtz's full-sized avatar

Romain Kurtz RomainKurtz

View GitHub Profile
@RomainKurtz
RomainKurtz / distanceAB
Last active September 2, 2015 09:16
Compute the distance between 2 points (Vector3 : x,y,z) in 3D space
//For compute the distance between 2 points (Vector3 : x,y,z) in 3D space
function distanceAB(v1, v2) {
var dx = v1.x - v2.x;
var dy = v1.y - v2.y;
var dz = v1.z - v2.z;
return Math.sqrt(dx * dx + dy * dy + dz * dz);
}
@RomainKurtz
RomainKurtz / centerAB
Last active September 2, 2015 09:16
Compute the center of two points (vector3: x,y,z) in 3D space
//To compute the center of two points (vector3: x,y,z) in 3D space
function centerAB (A,B){
var x = ((A.x+B.x)/2);
var y = ((A.y+B.y)/2);
var z = ((A.z+B.z)/2);
return new THREE.Vector3(x,y,z);
}
@RomainKurtz
RomainKurtz / MySingleton.js
Last active September 20, 2015 19:51 — forked from jasonwyatt/MySingleton.js
Singleton Pattern with Require JS
define(function(){
var instance = null;
function MySingleton(){
if(instance !== null){
throw new Error("Cannot instantiate more than one MySingleton, use MySingleton.getInstance()");
}
this.initialize();
}
var app = require('express')();
var __dirname = "./public/"
/* serves main page */
app.get("/", function(req, res) {
res.sendfile( __dirname +'index.html');
});
app.post("/user/add", function(req, res) {
@RomainKurtz
RomainKurtz / adn-css-render-demo.html
Created February 24, 2016 18:28 — forked from leefsmp/adn-css-render-demo.html
CSS3D Renderer Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ADN CSS3D Demo</title>
<style>
body {
background-color: #ffffff;
margin: 0;
overflow: hidden;
function rotatePoint(point, center, angle){
angle = (angle ) * (Math.PI/180); // Convert to radians
var rotatedX = Math.cos(angle) * (point.x - center.x) - Math.sin(angle) * (point.y-center.y) + center.x;
var rotatedY = Math.sin(angle) * (point.x - center.x) + Math.cos(angle) * (point.y - center.y) + center.y;
return new THREE.Vector2(rotatedX,rotatedY);
}
public void StartLoadingPhoto(){
IEnumerator coroutine = LoadPhoto("http://website/photo.png");
StartCoroutine(coroutine);
}
IEnumerator LoadPhoto(string url)
{
string url = url;
Texture2D tex;
tex = new Texture2D(4, 4, TextureFormat.DXT1, false);
@RomainKurtz
RomainKurtz / casparcg_ndi_instructions.md
Created June 25, 2017 19:41
How to get NDI output to work in CasparCG

How to get NDI output to work in CasparCG

  1. Install NewTek Network Video Send.exe
  2. Install NewTek NDI AirSend Updater.exe
  3. The AirSend Updater has a bug, and will not properly copy the x64 version of the DLL to the correct place. So, you'll need to manually copy C:\Program Files\NewTek\NewTek NDI AirSend Updater\Processing.AirSend.x64.dll to C:\Windows\System32\, overwriting the existing file.
  4. Restart your PC.
  5. Configure the CasparCG Server to use a Newtek iVGA output. Even though it says iVGA, it will actually be outputting NDI thanks to the updated AirSend DLLs.
  • You can do this manually by adding a `` consumer to your casparcg.config, or you can do it via the third-party [Caspar
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class AlignCameraView : MonoBehaviour {
public bool Enable;
public static List<AlignCameraView> list;