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
#version 150
uniform sampler2D uTexture;
in VertexData {
vec3 baricentric;
vec4 color;
vec2 texcoord;
} vVertexIn;
@paulhoux
paulhoux / ParticlesOnSphereApp.cpp
Last active August 29, 2015 14:02
One way to create a particle system where all particles move across a unit sphere surface.
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Camera.h"
#include "cinder/MayaCamUI.h"
#include "cinder/Quaternion.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
@paulhoux
paulhoux / spectrum2.frag
Created June 22, 2014 20:34
Alternative shader for the AudioVisualizer sample. See: https://github.com/paulhoux/Cinder-Samples
#version 110
void main(void)
{
// calculate glowing line strips based on texture coordinate
const float resolution = 64.0;
const float center = 0.5;
const float width = 0.02;
float f = fract( resolution * gl_TexCoord[0].s + 2.0 * gl_TexCoord[0].t );
/*
Copyright (c) 2014, Paul Houx - All rights reserved.
This code is intended for use with the Cinder C++ library: http://libcinder.org
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
#include "cinder/app/AppNative.h" // Contains the AppNative class and the events.
#include "cinder/gl/gl.h" // Contains most OpenGL convenience functions.
#include "cinder/Camera.h" // For our camera.
using namespace ci;
using namespace ci::app;
using namespace std;
class CinderProjectApp : public AppNative {
@paulhoux
paulhoux / FixedTimestepApp.cpp
Created May 21, 2015 22:52
Sample showing how to perform a fixed number of updates per second, resulting in frame rate independent animation.
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/params/Params.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@paulhoux
paulhoux / GradientApp.cpp
Created June 5, 2015 22:59
Example of how to create a texture from code. Here, we create a gradient texture.
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
typedef std::pair<float, ColorA> ColorStop;
@paulhoux
paulhoux / CubeMapApp.cpp
Last active August 29, 2015 14:24
Shows how to render a dynamic scene as 6 faces of a cube map (horizontal cross)
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class VivekSampleApp : public App {
@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;