Skip to content

Instantly share code, notes, and snippets.

glPushMatrix();
glTranslatef(panX, panY, panZ);
glRotatef(rvX, 0, 1, 0); // rotate around y
glRotatef(rvY, 1, 0, 0); // rotate around x
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, (GLuint)mapBalls[i].mapTexture.textureName[0]);
gluSphere(sphere, 200, 30, 30);
@kitschpatrol
kitschpatrol / ofTexture2D.cpp
Created January 30, 2011 23:57
you might need this to get the texture 2D object glut wants
#include "ofTexture2D.h"
#include "ofUtils.h" // for nextPow2()
#include "ofAppRunner.h" // for getWidth()
ofTexture2D::ofTexture2D(){
textureName[0] = 0;
bFlipTexture = false;
textureTarget = GL_TEXTURE_2D;
@kitschpatrol
kitschpatrol / ColorUtil.as
Created March 18, 2011 01:55 — forked from nsdevaraj/ColorUtil.as
fixed syntax errors
package
{
import flash.geom.ColorTransform;
public class ColorUtil
{
/**
* RGBColorTransform Create an instance of the information.
* @ Param rgb RGB integer value that indicates (0x000000 - 0xFFFFFF)
* @ Param amount of fill adaptive value (0.0 - 1.0)
* @ Param alpha transparency (0.0 - 1.0)
«Widget Factory»
«Eric Mika − Fall 2005»
«EXECUTE ALL TO PLAY»
[using System
System.Windows.Forms
System.Drawing
Packages.SimpleClasses
System.Collections]
«Basic class for game objects
 Provides:
 − Basic fields for position and motion
− Tracking of what game objects exist in the game
 − Initialize method
 − draw and tick generic procedures
To customize:
− Make sure your game calls [initialize-game-objects] when it starts
− Create a new subclass of GameObject
 − Add an initialize method, if needed
 Remember to use [call-next-method], if you do.
 − Add methods for draw and tick
»
[define all-game-objects “List of all objects currently in play”
[new ArrayList]]
@kitschpatrol
kitschpatrol / gist:914873
Created April 12, 2011 03:42
arduino serial communication code for the vhs cannon
if (Serial.available() >= 3) {
// read and send stuff
// Incoming Packet Has form:
// Byte 1: Mic Display Level (0 - 10)
// Byte 2: VHS Display Level (0 - 10)
// Byte 3: Mix Display Level (0 - 10)
setMicLevelBar(Serial.read());
setVHSLevelBar(Serial.read());
setMixLevelBar(Serial.read());
/*
* controlPanel.h
* vhsCannon
*
* Created by Eric Mika on 12/13/10.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include "controlPanel.h"
controlPanel::controlPanel() {
// cout << "setting up control panel" << endl;
// Set up serial
serial.enumerateDevices();
serial.setup("/dev/tty.usbserial-A900aeQz", 115200);
bytesReceived = 0;
ageOfDeath = 0;
@kitschpatrol
kitschpatrol / __init__.py
Created July 19, 2011 00:00
WebPy 408 timeout error work-around
# From webpy / web / wsgiserver / __init__.py
"""A high-speed, production ready, thread pooled, generic HTTP server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery)::
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
private function upload(picture:BitmapData, format:String = JPG):void {
var urlLoader:URLLoader = new URLLoader();
// encode image to ByteArray
var byteArray:ByteArray;
// encode in the requested file format
switch (format) {
case JPG:
// encode as JPG