Skip to content

Instantly share code, notes, and snippets.

View paulhoux's full-sized avatar
🏠
Working from home

Paul Houx paulhoux

🏠
Working from home
View GitHub Profile
@paulhoux
paulhoux / BallisticsIntegrator.as
Created September 27, 2011 10:02
AS3 sample that compares standard Euler integration to the performance of a Runge-Kutta-4 integrator. Based on an article by Glenn Fiedler: http://gafferongames.com/game-physics/integration-basics/ .
package nl.cowlumbus.integrator
{
/** An object with a position, velocity and acceleration. */
public class BallisticsIntegrator extends Object
{
private const force:Number = 10;
private const mass:Number = 1;
private var position:Number = 0;
private var velocity:Number = 0;
@paulhoux
paulhoux / AppImplMswBasic.cpp
Created November 5, 2011 03:57
Cinder: improved frame rate and low CPU usage on Windows PC's
/*
Copyright (c) 2010, The Barbarian Group
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
@paulhoux
paulhoux / Frustum.cpp
Created January 15, 2012 03:34
Additions to Cinder to facilitate frustum culling
/*
Copyright (c) 2012, Paul Houx
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
@paulhoux
paulhoux / SignalsApp.cpp
Last active December 20, 2015 00:38
Example of using signals and slots with derived classes. Sample made for Cinder. Simply create an empty Cinder application called "Signals" using TinderBox, then replace the contents of ```SignalsApp.cpp``` with this code.
#define _SCL_SECURE_NO_WARNINGS
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
//--------------------------
@paulhoux
paulhoux / PointOnSphereApp.cpp
Last active December 22, 2015 08:09
Example of how to place objects at the surface of a sphere with the correct axes. Created in response to https://forum.libcinder.org/#Topic/23286000001779023 .
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/MayaCamUI.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class PointOnSphereApp : public AppNative {
@paulhoux
paulhoux / CamAndGridApp.cpp
Last active December 28, 2015 17:29
Shows how to setup a camera, render a grid and control the camera using a mouse.
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/MayaCamUI.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@paulhoux
paulhoux / AudioShaderApp.cpp
Last active March 2, 2018 13:19
Adaptation of ShaderToy's AudioSurf shader for Cinder. Actual audio data is replaced with random noise to keep it simple. I kept the original shader code without making any changes. Note that ```iResolution``` must be passed as a Vec3f.
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/GlslProg.h"
#include "cinder/gl/Texture.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@paulhoux
paulhoux / DebugMesh.cpp
Created January 24, 2014 22:55
Test application for the Cinder framework, showing that recalculated normals (based on the average of all connected triangle faces) is just as precise as the original normals (calculated from sphere mathematics).
#include "DebugMesh.h"
using namespace ci;
using namespace ci::geom;
using namespace std;
DebugMesh::DebugMesh(void)
{
enable( Attrib::POSITION );
enable( Attrib::COLOR );
#version 150
uniform sampler2D uTexture;
in VertexData {
noperspective vec3 distance;
vec4 color;
vec2 texcoord;
} vVertexIn;
#version 150
uniform sampler2D uTexture;
in VertexData {
vec3 baricentric;
vec4 color;
vec2 texcoord;
} vVertexIn;