Skip to content

Instantly share code, notes, and snippets.

@noio
noio / flowmap.py
Created October 5, 2011 19:07
PARU Class for Scientific Visualization of LMS.
### Imports ###
# Python
import os
import logging
import math
import sys
import itertools
import random
function DrawAcube(location, scale)
newcube = createCube(scale, location);
cubert(:,1) = reshape(newcube(:,:,1), 1, 30);
cubert(:,2) = reshape(newcube(:,:,2), 1, 30);
cubert(:,3) = reshape(newcube(:,:,3), 1, 30);
calip = importdata('calibrationpoints.mat');
matrix = Create3DMatrix(calip.XYZ, calip.xy);
to2d = cubert * matrix
void Engine::InitSDL(){
//Start SDL
if (SDL_Init( SDL_INIT_EVERYTHING ) != 0){
cerr << "SDL_Init() Failed: " <<
SDL_GetError() << endl;
exit(1);
}
SDL_CreateWindowAndRenderer(res_width_, res_height_, SDL_WINDOW_OPENGL, &window_, &renderer_);
//
// Run the game loop
//
void Engine::Run(){
Loop();
}
//========= Privates ==========//
#include "engine.h"
#include <iostream>
#include "libs/Matrices.h"
#include "utility.h"
using std::cout;
using std::cerr;
@noio
noio / motogif.sh
Created August 22, 2014 15:23
mo(vie) to gif
#!/bin/bash
W=0
DROP=1
F=2
while getopts ":w:d:f:" opt; do
case $opt in
w)
@noio
noio / gist:61520ffaf56daf9fb272
Created March 6, 2015 19:59
Cut Fragments from Sprite
#!/usr/bin/env python
import sys, os
import numpy as np
from matplotlib import cm
from scipy import ndimage, misc, spatial
OKGREEN = '\033[92m'
WARNING = '\033[93m'
ENDC = '\033[0m'
@noio
noio / gist:8c76cf72a74bcd343ff8
Created March 6, 2015 20:00
Create Fragments from Sprite
#!/usr/bin/env python
import sys, os
import numpy as np
from matplotlib import cm
from scipy import ndimage, misc, spatial
OKGREEN = '\033[92m'
WARNING = '\033[93m'
ENDC = '\033[0m'
IEnumerator Shoot() {
while (true)
{
Debug.Log("Shoot!");
yield return new WaitForSeconds(1.0f);
}
}
void WalkAwayMan() {
Debug.Log("Walking Away");
@noio
noio / gist:66a914ae152eda3a170b
Created June 22, 2015 08:25
Replace Sprites in Animation
public static Sprite GetSpriteWithWordReplaced(Sprite sprite, string word, string replaceBy)
{
string assetPath = AssetDatabase.GetAssetPath(sprite);
string spriteName = sprite.name;
string newName = spriteName.Replace(word, replaceBy);
string newPath = assetPath.Replace(word, replaceBy);
foreach (Object assetObject in AssetDatabase.LoadAllAssetsAtPath(newPath))
{
Sprite newSprite = assetObject as Sprite;