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 / UnprojectApp.cpp
Created October 26, 2014 21:35
Clean example of rotating and scaling a rectangle, using glm::unProject to convert from mouse to world coordinates.
#include "cinder/app/AppNative.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#undef near
#undef far
using namespace ci;
using namespace ci::app;
using namespace std;
@paulhoux
paulhoux / CirclesApp.cpp
Created February 28, 2020 15:09
Instanced Circles using `geom::Ring`
#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;
class CirclesApp : public App {
public:
@paulhoux
paulhoux / CanvasUi.h
Created February 11, 2017 13:46
CanvasUi: a simple 2D modifier tool to drag and zoom your work area. Made for Cinder.
/*
Copyright (c) 2016, 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
@paulhoux
paulhoux / ProgressBarApp.cpp
Last active February 26, 2019 22:42
Example of a background loading thread with a progress bar. Meant to be used with Cinder: https://libcinder.org
#include "cinder/Utilities.h"
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace app;
using namespace std;
class ProgressBarApp : public App {
@paulhoux
paulhoux / FastTexture.cpp
Created February 14, 2019 13:37
Fast texture loading using S3TC+LZ4 compressed textures.
/*
Copyright (c) 2019, 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
#version 150
uniform sampler2D uTexture;
in VertexData {
noperspective vec3 distance;
vec4 color;
vec2 texcoord;
} vVertexIn;
@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 / YourApp.cpp
Last active May 14, 2016 20:25
Semi-Circle Example (with shader).
#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;
class YourApp : public App {
public:
@paulhoux
paulhoux / QuadCircle.cpp
Last active January 23, 2016 06:52
Circle of Quads
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/CameraUi.h"
#include "cinder/ip/Checkerboard.h"
using namespace ci;
using namespace ci::app;
@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 );