Skip to content

Instantly share code, notes, and snippets.

View BlockoS's full-sized avatar
💭
🧙⚔️💾

MooZ BlockoS

💭
🧙⚔️💾
View GitHub Profile
#include <stdio.h>
#include <string.h>
#include "Frustum.h"
Frustum::Frustum() :
m_x(1.0f, 0.0f, 0.0f),
m_y(0.0f, 1.0f, 0.0f),
m_z(0.0f, 0.0f, 1.0f),
m_position(0.0f, 0.0f, -1.0f),
m_near(0.1f),
@BlockoS
BlockoS / openDisplay.c
Created December 9, 2009 20:57
Smallest possible raw X11 init
//// TODO :: 3. Clean up
//// 4. Events
//// 5. Create a colormap
//// 6. glx ?
#ifdef DEBUG
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/un.h>
#include <sys/select.h>
@BlockoS
BlockoS / memmap.pl
Created February 12, 2010 22:09
Create a crappy html showing zero page occupancy from pceas sym file
#!/usr/bin/perl
use strict;
use Data::Dumper;
my $zp = {};
foreach my $line (`head -n -2 $ARGV[0]`)
{
my ($label, $addr, $bank) = $line =~ /^\s*([\w.]+)\s*([0-9A-Fa-f]{4})\s*([0-9A-Fa-f]{2})$/;
$r = 0.001 * 0.05;
$p0 = 0.06099;
$rm = 8.706;
$rt = 6180;
# method 1
$a = 2.0 * $r;
$b = $p0 + (6.0 * $r); # $p0 + (2.0 * $r);
$c = -($rt / (280.0 * $rm)) + $p0 + (4.0 * $r);
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct vec3
{
vec3(const vec3& v) : x(v.x), y(v.y), z(v.z) {}
vec3(float ix, float iy, float iz) : x(ix), y(iy), z(iz) {}
vec3(float f) : x(f), y(f), z(f) {}
#!BPY
""" Registration info for Blender menus:
Name: 'BlockoS (.blcks)...'
Blender: 243
Group: 'Export'
Tip: 'Export scene to BlockoS stuffs'
"""
__author__ = "Vincent 'MooZ' Cruz"
friend void squad(quaternion& qR, const quaternion& q1, const quaternion& qA,
const quaternion& qB, const quaternion& q2,
float t)
quaternion r1, r2;
{
slerp(r1, q1, q2, t);
slerp(r2, qA, qB, t);
slerp(qR, r1, r2, 2.0f * t * (1.0f - t));
}
// TODO :
// * Rename into Effect
// * Add attachRenderBuffer (depth, stencil)
#ifndef _PASS_H_
#define _PASS_H_
#include "Program.h"
#include "Texture.h"
#include "Renderbuffer.h"
#include <pugixml.hpp>
#include <iostream>
#include <string.h>
#include <vector>
#include <unordered_map>
typedef int GLenum;
#define GL_NONE 0
<samplerList>
<sampler2D name="source" minFilter="LINEAR" magFilter="NEAREST" wrapS="CLAMP_TO_EDGE" wrapT="BORDER"/>
<sampler2D name="tex" level="0" minFilter="LINEAR" magFilter="NEAREST" wrapS="CLAMP"/>
</samplerList>
<out>
<vec4 name="color" index="0"/>
<vec4 name="normal" index="1"/>
</out>