Skip to content

Instantly share code, notes, and snippets.

@RH2
RH2 / gist:27e234371bba664c8eb7
Last active August 29, 2015 14:10
blender to canvas 530am
import bpy
def niceNumber(x):
sizeMul=200
x= float(x)*sizeMul
return int(x)
print("//////////////////////////")
verts = []
faces = []
@RH2
RH2 / rh2.stl
Created December 6, 2014 11:31
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RH2
RH2 / gist:cb41d25f4c9ccfd5e2b0
Last active August 29, 2015 14:10
line bounce
<html>
<head>
<title></title>
<style type="text/css">
body,html{
background-color: hsl(0,0%,50%);
margin:0px;
padding: 0px;
}
canvas{
@RH2
RH2 / gist:1aa0cf3427ec099059d1
Last active August 29, 2015 14:10
tmpvar & rh2 javascript particles (update 557PM)
<html>
<head>
<title></title>
<style type="text/css">
body,html{
background-color: hsl(0,0%,50%);
margin:0px;
padding: 0px;
}
canvas{
@RH2
RH2 / gist:f49b00deef45eff50289
Last active August 29, 2015 14:09
version three
import bpy
import math
import mathutils
import random
from mathutils import Vector,Euler,Matrix,Quaternion
print("RUNNING")
def my_handler(scene):
targetObject= bpy.data.objects['T']
for ob in bpy.data.groups['B'].objects:
dist = (ob.location-targetObject.location).length
@RH2
RH2 / gist:802b5d80ff2f6b785b72
Last active August 29, 2015 14:08
cTrigger (customTrigger)
using UnityEngine;
using System.Collections;
public class cTrigger : MonoBehaviour {
public bool overlap = false;
public bool overlapLastFrame = false;
public bool changed = false;
void Update(){
if(overlap!=overlapLastFrame){
@RH2
RH2 / gist:a77a6f72531e17f257ce
Created November 7, 2014 23:01
parkour --sample
//NewFullyDynamicParkour.js
#pragma strict
var ClimbMax : float;
var VaultMax : float;
var VaultMin : float;
var distanceToGoFwd : float = 0.7;
private var CanVault : boolean;
private var CanClimb : boolean;
using UnityEngine;
using System.Collections;
using System;
public class storyFrame : IComparable<storyFrame> {
public string path_background;
public string path_textBackground;
public string path_character;
public string text;
#BEGIN GPL LICENSE BLOCK
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@RH2
RH2 / gist:9cbce87b41495c833488
Last active June 17, 2018 04:59
rotates object to point at another object.
import bpy
import math
import mathutils
from mathutils import Vector,Euler,Matrix,Quaternion
print("RUNNING")
def my_handler(scene):
if hasattr(bpy.data.groups, 'B'):
for ob in bpy.data.groups['B'].objects:
targetObject= bpy.data.objects['Camera']