Skip to content

fwzhuangCg/NGL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#NGL the NCCA Graphics Library This is the main source branch for the NCCA Graphics Library ngl.

It needs to be built using QtCreator and you will also need to install boost

For more info check out the website here

http://nccastaff.bmth.ac.uk/jmacey/GraphicsLib/ and for the demos

http://nccastaff.bournemouth.ac.uk/jmacey/GraphicsLib/Demos/index.html

Theres are also other demos on github which are generally work in progress. #Demos ##BlankNGL alt tag

This is an empty boilerplate framework for NGL projects, it creates an empty window and draws nothing

##SimpleNGL alt tag

This is the most basic version of an NGL demo, it creates a simple window in Qt and allows the manipulaiton of the teapot using the mouse.

##SDLNGL alt tag

This is the simplest SDL / NGL demo using a basic SDL2.0 window and core profile OpenGL context

Note that this .pro file contains the calls to add the output of sdl2-config to the build using

There is a webgl demo of the sphere program here

##VAOPrimitives alt tag

A simple scene using all of the built in VAO primitives, this has approx 350,000 Verts so is a good performance test of NGL

##Camera

alt tag

This demonstrates the use of the ngl::Camera class as well as showing how the camera is actually made up of a simple series of matrices

##SDLNGL alt tag

As the ngl::Text class is reliant upon QFont at present this class is a drop in replacment using [sdl-ttf] (https://www.libsdl.org/projects/SDL_ttf/) eventually all of this will be merged into the core ngl with compile time flags to choose the text rendering engine.

##using ngl::lookAt and ngl::perspective alt tag

These two demos demonstrate using the lookAt and perspective utility classes from Util.h see individual README.md for more details

Interactive demos are here and [here] (http://nccastaff.bournemouth.ac.uk/jmacey/WebGL/LookAt2/)

##Lights alt tag

Simple demo showing how to use the ngl::Light class for point lighting WebGL version

##SpotLight alt tag

This demo show the ngl::SpotLight class in action interactive webgl demo

##ShadingModels alt tag

A series of examples to demonstrate different shaders and techniques in glsl. Eventually I'm going to replace all of this with a simpler demo as most of the code in these examples is very similar.

##VertexArrayObject alt tag

A series of demos to show how to create a VertexArrayObject from different types of data. There are examples of how to create a simple boid shape as I was getting fed up of flocking teapots!

alt tag

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

##TextureDemos alt tag

A collection of demos showing how to use textures in ngl including examples of loading from a QImage. ##Texture Compression alt tag

A series of demos to show how to create and then use DXT compressed textures.

Compressor Is a simple command line tool to create basic DxT1,3,5 textures to be used with glCompressedTexImage2D formats. DXTViewer is a simple tool to load in the compressed files and view them. You can specify the name of the file on the command line or use the file open dialog presented at startup. Use o to reload a file.

##ImageHeightMap alt tag

This demo shows how to read in an image and create terrain from it by using one of the channels as the height of the vertex in the y.

##ObjDemo alt tag

Loads a mesh from an obj file using ngl::Obj and displays it.

Interactive WebGL demo

##GameKeyControl alt tag

A demonstration on how to do game style multi key controls within Qt

##AdvancedGameKeyControl alt tag

A demonstration on how to do game style multi key controls within Qt and record them

##SDLJoyPad alt tag

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.

##Interpolation alt tag

This demo demonstrates the different interpolation templates in ngl, see this blog post

##QuatSlerp

alt tag

This demo shows how the Quaternion spherical interpolation works. Interactive WebGL demo

##CurveDemos alt tag

Two demos showing how to use the ngl::BezierCurve class, including an example of exporting from maya using a simple script

##Collision Demos alt tag

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

An interactive WebGL demo

##OctreeAbstract alt tag

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. Interactive WebGL demo here

##Particle Demos alt tag

Simple particle system demos, need to update these and add some more at some stage.

#ParticleFactory alt tag

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

##ColourSelection alt tag

Picking of objects using Colour values based on this post

##Point Bake Demos alt tag

The NCCA PointBake format is a simple xml format for storing per vertex animation data, presented in these demos are maya scripts to export in the format and some demos to show how to load and visualise this data.

##Morph Objects alt tag

Morphing meshes using shaders. based on the paper here

##Morph Objects (Texture Buffer Objects) alt tag

Morphing meshes using shaders and texture buffer objects. based on the paper here

##Facial Animation alt tag

Simple Facial animation using blen shape meshes and texture buffer objects

##Using libassimp to load meshes alt tag

How to load and animate meshes using assimp

##Embeded Python alt tag

This demo show how to embed the pyhton C interpretor into your own code and run python scripts

##QtNGL alt tag

How to use the Qt GUI with NGL

##Mass Spring System using RK 4 integration alt tag

This demonstrates a simple spring using RK4 integration as shown here

##Affine Transforms alt tag

A demonstration of affine transforms using matrices (mainly used for teaching maths)

##FrustumCull alt tag

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

##Geometry Shaders alt tag

Simple Geometry shader demo

##Tesselation shader alt tag

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

##Animated Textures alt tag

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.

##Instancing alt tag

A number of demos showing how instancing in OpenGL works

##Normal Mapping alt tag

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

##Using Framebuffer Objects alt tag

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

##Bullet Physics and NGL alt tag

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. ##Bullet Physics and NGL alt tag

Using the Bullet Physics with NGL, the demo has basic wrappers for the Physics world and rigid bodies It then procedurally generates a tower which the user can demolish.

An interactive WebGL demo is here For more details read the user guide of Bullet.

##ODE NGL alt tag

Using the ODE Physics engine

##Using the Kinect with NGL alt tag

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

##Using the Kinect with NGL and OpenCV alt tag

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

This has issues on the mac due to the C++ compiler and OpenCV

##Sponza Demo alt tag

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

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

The Initial Design

The mtl Class

GroupedObj class

##Sponza Oculus Rift Demo alt tag

This builds on the original sponza demo and adds oculus rift support, this is very much work in progress and needs quite a bit of tidying up.

You will need to install the oculus SDK and adjust the path in the .pro file to get it working.

This version also loads the binary Model and Material file, you may have to re-create this using the save and load methods as the binary file may not transfer to different operating systems.

##Box2D Demo alt tag

A simple demo to show Box2D being used with ngl

##Export from Maya to Box2D alt tag

A simple example of an exported then using it in box 2D see the python files for more details

Releases

No releases published

Packages

No packages published

Languages

  • C++ 72.7%
  • Mathematica 14.7%
  • C 12.6%
  • QMake 0.0%
  • CMake 0.0%
  • Python 0.0%