www.heteroclinic.net
1 201605
The following program is modified from JOGL unit tests programs or sample programs.
|
||
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. |
||
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.
|
||
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.
|