Heteroclinic.net logo


Project Bunny


Bunny is a project to recover a project of mine of C++, OpenGL, Glew: recover legacy computer graphics project. The project was originally written in Visual C++. Recently, I found it is not difficult to port to Ubuntu/Eclipse environment, so I take this weekend to do it.

The setup was a Windows XP, Visual C++ environment in around 2010. Due to well known reason, such setting is very difficult to keep a sustainable product line. In early 2014, I bought/DIY a AMD box with a HD6500 card. I also install the proprietory graphical card driver. I found my project Friends Torus can not run in such environment. So we know there is new version of OpenGL et al.
So I started the project GlChemstry. In GlChemstry, my first thinking to find/reuse the famous Gear example in Jogl. Unfortunately, there is not an exact GL4 implementation. So task changed to write a GL4 Gear.
Around the time of 2009 and 2010, I spent much effort on studying GTS, GNU triangulated surface for short. The goal was to achieve smooth shading. There was the problem to compute vertices normals. One triangle's normal is easy to compute. But a vertex may belong to multiple triangles, we can average the normals, or further average with weighing in the areas of triangles. But the result achieved is still coarse. Further research brought in Phong shading. This is the mission of GLEW, programming with shaders.
So Bunny at the very begginning was a mock of GTS, plus smooth shading, plus GLEW Phong shading. After these achieved, I implemented depth peeling transparency in this project.
In 2015, I ported this project to Ubuntu/Linux environment.

Project Bunny


All third party licenses and rights are automatically cascaded. The responsibility of the author(s), Zhikai Wang/www.heteroclinic.net, to the maximum is to remove or modify matters in dispute. You can utilize this project at good-will. The inverse of good-will includes illegal activities that are subject to jurisdiction applicable.
Copyright 2010, 2015
Zhikai Wang/www.heteroclinic.net

Project Bunny


0. Suppose in your dev environment, you already set/install gcc, opengl/mesa, freeglut, glew and the most up-to-date graphics card driver.
In my computer glew is installed in /usr/lib64, so I would set LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/lib64 in my dev environment, especially for run-time.
0.1 Additional Centos 6 notes:

1. Start from blank
Create a Eclipse CDT project, eg. a 'Hello World' project, preferrably a 'Cross GCC' project.
Right click the project, 'properties', select 'C/C++ Build', change 'Configuration' to .
'Settings', 'Cross GCC Linker', by 'Libraries(-l)' click the '+' sign for the following (case sensitive):

2. Copy the sources file into your 'src' folder. Create/copy the the 'shaders' folder. Create/copy the 'models' folder.
2.1 Specify abosulte path to shaders in Bunny.cpp (stupid but easy to understand) by locating these two lines:

2.2 Specify abosulte path to one model in Bunny.cpp by locating the following line:

3. Right click the project <Bunny> , 'Build project'. So far, the project should compile (with a lot warings). In Eclipse, due to LD_LIBRARY_PATH, you can run the binary. So we open a shell console.

4. You will see Demo 1.0 result of Phong shading as in Demo01PhongShading.png

Project Bunny
Demo 1.0 Source Code


You can download the tar file bunny-1.0-demo.tar.gz.

Or visit https://github.com/wangzhikai/Bunny.