Skip to content

Instantly share code, notes, and snippets.

View TomMinor's full-sized avatar

Tom Minor TomMinor

View GitHub Profile
@TomMinor
TomMinor / gist:855879407c5acca83225
Created October 25, 2014 16:44
C SDL2-ttf ( modified from LazyFoo )
/*This source code copyrighted by Lazy Foo' Productions (2004-2014)
and may not be redistributed without written permission.*/
//Using SDL, SDL_image, SDL_ttf, standard IO, math, and strings
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <stdio.h>
#include <math.h>
if(Serial.available() >= 4)
{
Header = Serial.read()
// check header
PacketInfo = Serial.read();
Payload = Serial.read();
Footer = Serial.read();
enum PacketTypes
{
CARD = 0x00,
BET = 0x01,
BET_MAX = 0x02,
BET_MIN = 0x03,
MONEY = 0x04,
NAME = 0x05,
UNUSED0 = 0x06,
UNUSED1 = 0x07
static const char* fullNameLookup[] =
{
"TWO",
"THREE",
"FOUR",
"FIVE",
"SIX",
"SEVEN",
"EIGHT",
"NINE",
import maya.cmds as cmds
selection = cmds.ls(sl=True)
if len(selection) > 0:
targetMesh = selection[-1]
affectedVertices = selection[0:-1] # Assume these are vtx (add some error checking)
affectedMesh = cmds.listRelatives(cmds.listRelatives(affectedVertices[0], p=True), p=True)
vtxSet = cmds.sets(affectedVertices, v=True, n="SelectionSet")
#!/usr/bin/python2.6
from PIL import Image, ImageDraw, ImageFont
from subprocess import call
import math
left_region = 1
right_region = 2
bottom_region = 4
top_region = 8
#version 420 // Keeping you on the bleeding edge!
#extension GL_EXT_gpu_shader4 : enable
smooth in vec3 fragmentNormal;
// Force location to 0 to ensure its the first output
layout (location = 0) out vec4 o_FragColor;
struct Lights
{
#include <iostream>
#include <cstdlib>
class Vec3
{
public:
// constructor
Vec3(float _x, float _y, float _z)
{
m_x = _x;
// The normal attribute passed in from the vertex shader
in vec3 fragmentNormal;
// The output attribute that will be written to the framebuffer
layout(location = 0) out vec4 fragColour;
// Defines all the light info
struct Lights
{
vec4 position;
layout(location = 0) in vec3 inVert;
layout(location = 1) in vec3 inNormal;
layout(location = 2) in vec3 inUV;
// Model View Projection matrix
uniform mat4 MVP;
// Model View matrix
uniform mat4 MV;
// Normal matrix