In the example JCudaDriverGLSample3.java, the rendering work is done by using OpenGL. I’ve found that in the method setupView(GLAutoDrawable), the ‘perspective’ is implemented by Java code, including the identity() method as well as matrix multiplication.
I’m not so familiar with OpenGL but I know that there is an OpenGL implementation of ‘perspective’ which could be used though calling glu.gluPerspective(). I guess the internal implementation of gluPerspective() is similar to the Java souce code in JCudaDriverGLSample3.java.
My question is why not use OpenGL implementation so that it could free CPU from computing the matrix multiplication etc. and let GPU do more rendering work (which is more suitable for GPU)?