NGL Demo Programs

The following programs demonstrate NGL along with various graphics techniques. (Note currently moving these to git hub so not all links will work)

There are now some interactive WebGL Demos, you will need to have WebGL enabled with the browser click on links for demos


Blank NGL
Simple NGL

This is a blank NGL project that creates an empty Qt OpenGL window with basic key control framework, it also has methods implemented for initializeGL, paintGL and resize window.

git clone git@github.com:NCCA/BlankNGL.git

https://github.com/NCCA/BlankNGL

 


Simple NGL Demo
Simple NGL

This demo shows a basic Qt OpenGL window and how to use ngl for a simple drawing project. To get the source use

git clone git@github.com:NCCA/SimpleNGL.git

https://github.com/NCCA/SimpleNGL

Interactive WebGL Demo version

 

SDL NGL
Simple NGL

This demo show how to use the NGL library with SDL (2.0) At present in the labs you will need to install your own version of SDL 2 as it is not installed, full instructions and an explanation of the code can be found here

git clone git@github.com:NCCA/SDLNGL.git

https://github.com/NCCA/SDLNGL

Interactive WebGL Demo version

ngl::VAOPrimitives demo
CG Primitives demo

This demo show how to use the VAOPrimitives in ngl as well as the transformstack and other elements.

git clone git@github.com:NCCA/VAOPrimitives.git

https://github.com/NCCA/VAOPrimitives

Interactive WebGL Version

ngl::Camera demo
CG Primitives demo

This demo show how to create several Cameras and use them

git clone git@github.com:NCCA/Camera.git

https://github.com/NCCA/Camera

Interactive WebGL Demo

SDL_TTF Text rendering with SDL
Simple NGL

This Demo replaces the ngl::Text class to use SDL_ttf instead of the Qt font rendering. Use this if you are not using Qt for your project

git clone git@github.com:NCCA/SDLTTF.git

https://github.com/NCCA/SDLTTF

 

Using ngl::lookAt and glViewport
CG Primitives demo

Two demos showing how to use the lookAt, persprctive and ortho utility methods. The first demo is a simple lookAt example the 2nd creates a simple maya style interface where we can zoom to different windows etc.

git clone git@github.com:NCCA/LookAtDemos.git

https://github.com/NCCA/LookAtDemos

Interactive Demos SimpleLookAt MultiViews

Basic Point Lighting demo
CG Primitives demo

This demo show how to use the Light and Material classes to generate a series of PointLights and render using Phong shading

git clone git@github.com:NCCA/Lights.git

https://github.com/NCCA/Lights

Interactive WebGL demo

ngl::Spotlight Demo
CG Primitives demo

This demo demonstrates how to use the ngl::Spotlight class using glsl

git clone git@github.com:NCCA/SpotLight.git

https://github.com/NCCA/SpotLight

Interactive WebGL demo

Shading Models
CG Primitives demo

A series of demos to show how the different lights / material properties work in OpenGL and ngl

git clone git@github.com:NCCA/ShadingModels.git

https://github.com/NCCA/ShadingModels

ngl::VertexArrayObject Demo
VAO

Two programs to show how the ngl::VertexArrayObject class works

git clone git@github.com:NCCA/VertexArrayObject.git

https://github.com/NCCA/VertexArrayObject

Interactive WebGL Demo

Klein Bottle Demo
VAO

This program demonstrates the production of a Klein bottle based on the code from this excellent website It uses the ngl::VertexArrayObject class

git clone git@github.com:NCCA/KleinBottle.git

https://github.com/NCCA/KleinBottle

Interactive WebGL demo

Texture Demos
VAO

A selection of programs demonstrating various texture techniques in OpenGL and using QImage as a texture loader

git clone git@github.com:NCCA/Textures.git

https://github.com/NCCA/Textures

Cube Demo

Image Based Heightmap
VAO

Generates a heighmap grid where the height of the mesh is based on the Red channel of the image. This demo doesn't use the ngl::VertexArrayObject class so it also demonstrates the raw access to OpenGL VertexBufferObjects and VAO's

git clone git@github.com:NCCA/ImageHeightMap.git

https://github.com/NCCA/ImageHeightMap

 


ngl::Obj Demo
VAO

A demonstration of the ngl::Obj class used to load a triangulated obj mesh with texture

git clone git@github.com:NCCA/ObjDemo.git

https://github.com/NCCA/ObjDemo

Interactive WebGL Demo


Game Key Controls
VAO

This demo shows how to do game style control and movement of an object in Qt, read the blog post here for more details

git clone git@github.com:NCCA/GameKeyControl.git

https://github.com/NCCA/GameKeyControl

Advanced Game Key Controls
VAO

This demo takes the code above and uses a different method to do game style control, it also has the ability to record and playback the keystrokes, including saving them to file.

git clone git@github.com:NCCA/AdvancedGameKeyControl.git

https://github.com/NCCA/AdvancedGameKeyControl


SDL JoyPad Demo
VAO

This demo requires SDL 2.0 and a wireless xbox controller. Under the mac you can install this driver. Under linux you may have to install the xpad kernel driver

So far it has not been tested under windows and the button mappings may be different.

git clone git@github.com:NCCA/SDLJoyPad.git

https://github.com/NCCA/SDLJoyPad

 


Using Interpolation templates
VAO

This code is used in the lecture here

git clone git@github.com:NCCA/Interpolation.git

https://github.com/NCCA/Interpolation

Interactive WebGL Demo


Using ngl::Quaternion
VAO

This demo demonstratres how to convert from a Rotation matrix and a Quaternion. Two matrices are generated and the slerp method is used to interpolate between them.

git clone git@github.com:NCCA/QuatSlerp.git

https://github.com/NCCA/QuatSlerp

Interactive WebGL Demo

Using ngl::BezierCurve
VAO

Two demos to show the ngl::BezierCurve class, the first demo is a simple 4 point curve the second code bundle contains a simple python script to export all curve cv values from Maya into a text file which is loaded into the program

git clone git@github.com:NCCA/CurveDemos.git

https://github.com/NCCA/CurveDemos

Collision Detection Demos
VAO

A series of programs showing Ray-Sphere, Ray-Triangle, Sphere-Sphere, Sphere-Plane collision detection algorithms

git clone git@github.com:NCCA/Collisions.git

https://github.com/NCCA/Collisions

Interactive WebGL Demos Ray->Sphere

Abstract Octree
VAO

An Abstract Octree template to use in your own projects, this code is originally writen by my collegue Dr Xiaosong Yangfor his advanced collision detection lectures and templated and ported to ngl by me.

git clone git@github.com:NCCA/OctreeAbstract.git

https://github.com/NCCA/OctreeAbstract

Interactive WebGL Demo

Particle Systems
VAO

Three basic particle system demos, including a demonstration of using PointSprites in glsl

git clone git@github.com:NCCA/ParticleSystem.git

https://github.com/NCCA/ParticleSystem

 

Particle Factory
VAO

This demo demonstrates the use of the factory pattern and runtime polymorphism

git clone git@github.com:NCCA/ParticleFactory.git

https://github.com/NCCA/ParticleFactory

Interactive WebGL Demo

Selection using Unique Colour values
VAO

Picking of objects using Colour values based on this post

git clone git@github.com:NCCA/ColourSelection.git

https://github.com/NCCA/ColourSelection

ngl::PointBake demos
VAO

This demonstrates loading in a Mesh (obj) and PointBake animation data from my Maya Exporter ( see here ). The basic principle is load an Obj Mesh, then the PointBake per frame animation data, then we update the verts per frame. see NGL::PointBake class for more details and also this blog post.

git clone git@github.com:NCCA/PointBake.git

https://github.com/NCCA/PointBake

 

Blend Shape using Objs
VAO

This demo show how to do basic Blend Shape animaiton using the GPU based on the technique shown here

git clone git@github.com:NCCA/MorphObj.git

https://github.com/NCCA/MorphObj

Interactive WebGL Demo

The second demo does the same thing but morph targets are passed as a texture buffer object instead.

git clone git@github.com:NCCA/MorphObjTBO.git

https://github.com/NCCA/MorphObjTBO

Facial Animation using Blend Shapes
VAO

This demo show how to do basic Blend Shape animaiton using the GPU based on the technique shown here it loads in a simple list of data for each of the meshes and then morphs them

git clone git@github.com:NCCA/FacialAnimation.git

https://github.com/NCCA/FacialAnimation

 

Using libAssimp
VAO

These demos show how to use assimp to load meshes and do skeletal animation with ngl

git clone git@github.com:NCCA/AssetImportDemos.gitemos

https://github.com/NCCA/AssetImportDemos

Interactive WebGL Demos Skeletal Animation Simple Scene

Embedding Python in NGL
VAO

This demonstrates how to embed python scripts into NGL (and in general any C++ program) It uses a simple python script to animate two Spheres (a different script for each Sphere) more details here

git clone git@github.com:NCCA/EmbedPython.git

https://github.com/NCCA/EmbedPython

 

QtNGL demo
VAO

This is the code to acompany the Video Tutorial here

git clone git@github.com:NCCA/QtNGL.git

https://github.com/NCCA/QtNGL

 

Mass Spring System using RK 4 integration
VAO

A Simple Mass spring system using RK4 integration, the integrated is an Abstract class so it may be re-implemented to use different equations for the simulations

Some of the code is based on this post

git clone git@github.com:NCCA/MassSpring.git

https://github.com/NCCA/MassSpring

Affine Transforms Demo
VAO

This demo show how to build affine transform using a series of matrices in ngl. This demo also demonstrates how you use Qt GUI components with ngl and OpenGL

git clone git@github.com:NCCA/AffineTransforms.git

https://github.com/NCCA/AffineTransforms

 

Fustrum Culling
VAO

Added frustum culling to the ngl::Camera class, this demo shows how to use it, most of the code is based on the article here

git clone git@github.com:NCCA/FrustumCull.git

https://github.com/NCCA/FrustumCull

 

Geometry Shader
VAO

A simple demo showing how to draw Face and Vertex Normals using Geometry Shaders

git clone git@github.com:NCCA/GeometryShaders.git

https://github.com/NCCA/GeometryShaders

 

Tessellation Shader
VAO

This demo is the one written for this blog post and implements this code

git clone git@github.com:NCCA/TessellationShader.git

https://github.com/NCCA/TessellationShader

 

Animated Textures
VAO

This demo uses several sprite sheets of fire to generate an animated fire using billboards. The billboards are generated on the GPU using a geometry shader and the data for the frames / animation is passes using attributes.

git clone git@github.com:NCCA/AnimatedTextures.git

https://github.com/NCCA/AnimatedTextures

 

Instancing
VAO

These three demos show different ways of using Transfrom Feedback to generate instanced geometry.

These are Uniform Buffer Object Instancing, Texture Buffer Object instancing and Divisor Instancing.

git cline git@github.com:NCCA/Instancing.git

https://github.com/NCCA/Instancing

 


Normal Mapping using ngl::Obj and ngl::VertexArrayObject
VAO

This demo uses the ngl::Obj and ngl::VertexArrayObject classes to read in a mesh then construct an extended VAO passing in Tangents and Bi-Tangents (BiNormals) to glsl as attributes. This is then used to do normal mapping along the lines of this

It also has code to implement Maya style controls

git git@github.com:NCCA/NormalMapping.git

https://github.com/NCCA/NormalMapping

Using Frame Buffer Objects
VAO

A number of demos showing how to use Frame buffer objects, including real time shadows and render to FBO demos

git clone git@github.com:NCCA/FBODemos.git

https://github.com/NCCA/FBODemos

 

Using ngl and the Kinect
VAO

This demo shows how to use the kinect with the OpenKinect drivers and Qt / ngl. The code base is a modified version of my Qt Kinect Reference design which can be seen here. You will need to install the libfreenect drivers first.

git clone git@github.com:NCCA/KinectMDI.git

https://github.com/NCCA/KinectMDI

Using ngl and the Kinect and OpenCV
VAO

This demo is based on the previous one but uses OpenCV data types to allow integration of the Kinect with the OpenCV libs and functions. In this case basic feature extraction is preformed using the example here

git clone git@github.com:NCCA/OpenCVKinect.git

https://github.com/NCCA/OpenCVKinect

 

Sponza Demo
VAO

A basic framework to load a Wavefront OBJ file with groups and an MTL file with textures and draw the scene as efficiently as possible. The source contains the models and textures from here and is quite large

git clone git@github.com:NCCA/Sponza.git

https://github.com/NCCA/Sponza

For a detailed look at how this work see the following blog posts

The Initial Design

The mtl Class

GroupedObj class

Oculus Rift
VAO

 

git clone git@github.com:NCCA/SponzaRift.git

https://github.com/NCCA/SponzaRift

This is a very early version of the demo at present, you will need to install the oculus SDK and adjust the paths to suit in the .pro file.


Bullet and NGL
VAO

Using the Bullet Physics with NGL, the demo has basic wrappers for the Physics world and rigid bodies, it also uses the ngl::Obj to load low-res collision meshes and uses higher detail ones for the drawing.

For more details read the user guide of Bullet.

git clone git@github.com:NCCA/BulletNGL.git

git clone git@github.com:NCCA/BulletTower.git

https://github.com/NCCA/BulletNGL

https://github.com/NCCA/BulletNGLTower

 


ODE and NGL
VAO

Using the Open Dynamics Engine with NGL, the demo has basic wrappers for the Physics world and rigid bodies, it also uses the ngl::Obj to load low-res collision meshes and uses higher detail ones for the drawing.

For more details read the user guide of ODE.

git clone git@github.com:NCCA/ODENGL.git

https://github.com/NCCA/ODENGL

Box2D and NGL
VAO

This demo uses Box2D to do basic 2D physics using NGL to draw and setup and orthographic 2D world (but rendered in 3D). It creates a number of passive bodies as platforms and one moving kinimatic moving platform. The player is moved using impulses applied when the keys are pressed.

git clone git@github.com:NCCA/Box2D.git

https://github.com/NCCA/Box2D

The next demo has a simple python maya script to export data that can be used in a C++ program.

git clone git@github.com:NCCA/Box2DExport.git

https://github.com/NCCA/Box2DExport