Skip to content

Instantly share code, notes, and snippets.

View smakhtin's full-sized avatar

Vadim Smakhtin smakhtin

View GitHub Profile
@smakhtin
smakhtin / Fastcopy.cs
Created May 9, 2012 12:27
Fast copy data from one bytearray to another
// fastcopy.cs
// compile with: /unsafe
using System;
class Test
{
// The unsafe keyword allows pointers to be used within
// the following method:
static unsafe void Copy(byte[] src, int srcIndex,
byte[] dst, int dstIndex, int count)
@smakhtin
smakhtin / OpenNISlices.txt
Created May 31, 2012 12:58
Vector3D slices in OpenNI Skeleton
Head 012
Neck 345
LeftShoulder 678
LeftElbow 9-10-11
LeftHand 12-13-14
RightShoulder 15-16-17
RightElbow 18-19-20
RightHand 21-22-23
Torso 24 25 26
LeftHip 27 28 29
@smakhtin
smakhtin / ObjectTrackingNode.cs
Created May 31, 2012 13:00
GPU Object Tracking in EmguCV
#region usings
using System;
using System.ComponentModel.Composition;
using System.Drawing;
using System.Threading;
using VVVV.PluginInterfaces.V2;
using VVVV.Utils.VMath;
using VVVV.Core.Logging;
material tv/frame
{
technique
{
pass
{
ambient 0.215686 0.215686 0.215686
diffuse 0.215686 0.215686 0.215686 1
specular 0.172549 0.172549 0.172549 70
emissive 0 0 0
@smakhtin
smakhtin / sequence.lua
Created June 5, 2012 13:35 — forked from notintricate/sequence.lua
sequence playback
-- access to the scene objects
local scene = getCurrentScene()
-- define keyboard input
local inputManager = getInputManager()
local keyboard = Keyboard(inputManager:getDevice(TIINPUT_KEYBOARDDEVICE))
-- dynamically create the texture objects for image sequence
local Textures = {}
@smakhtin
smakhtin / gist:2889491
Created June 7, 2012 15:37
Allow Unity to run in background
Application.runInBackground = true;
@smakhtin
smakhtin / CurvesTransferer.cs
Created June 12, 2012 10:20
Create a copy of read-only mesh animation in Unity (by neodrop)
using UnityEditor;
using UnityEngine;
public class CurvesTransferer
{
const string duplicatePostfix = "_copy";
static void CopyClip(string importedPath, string copyPath)
{
AnimationClip src = AssetDatabase.LoadAssetAtPath(importedPath, typeof(AnimationClip)) as AnimationClip;
@smakhtin
smakhtin / SceneController.lua
Created June 14, 2012 15:45
DFusion scene controller
-- Test
-- Tracking variables
local trackingIndex = -1
local trackingKeyFrameIndex = -1
local MLTPlugin = getMLTPluginManager()
local errorStatus = eOk
--Core variables
@smakhtin
smakhtin / public_plan.material
Created June 15, 2012 12:33
Alpha Keying Material
material plan/lambert1
{
technique
{
pass
{
scene_blend alpha_blend
vertex_program_ref Deferred_vs
{
@smakhtin
smakhtin / script.lua
Created June 15, 2012 16:16
DFusion Scene Controller Fixed
-- Test
-- Tracking variables
local trackingIndex = -1
trackingKeyFrameIndex = -1
trackingStatus = 0
local MLTPlugin = getMLTPluginManager()
local errorStatus = eOk