Heteroclinic.net logo

www.heteroclinic.net

Jgts Demo 1.0 Smooth Shading of GTS models
1

201605

The following program is modified from JOGL unit tests programs or sample programs.

Jgts Demo 1.0 Smooth Shading of GTS models
2

201605

The program will read and parse a mesh file, compute the scale to fit a model in a camera with fixed settings, compute the triangles' normals, then render the model with smooth shading.

For model bunny.gts, we would achieve the following:
jgtsdemo1d0_01_bunnysmoothshanding.png

Jgts Demo 1.0 Smooth Shading of GTS models
3

201605

From the code in (1) we will not see much typical OpenGL structure as most C/C++ programs have. (1) will call SmoothShadingRendererEventListener as the following. It is basically showing how Java JOGL provides an interface for the underlying libraries to talk to the graphical hardware.

Jgts Demo 1.0 Smooth Shading of GTS models
4

201605

From the program in (3), what we do with C/C++ is that we can pass function pointers so we can specify init, display functions etc. In JOGL implementation, these functions' names are fixed. We leave the camera part for future discussion, we can have a brief view as the following segment of how we handle the GTS models.