Login  Register

My Obj is deforming while rotating.

Posted by Ususuus on Aug 10, 2017; 11:26am
URL: https://forum.jogamp.org/My-Obj-is-deforming-while-rotating-tp4038111.html

I didn't have a chance to look all over through the JOGL docs, i'm mostly coding at the help of samples.

the initi() setup is like below, my 3D obj have a very strong deformation while rotating. it looks like the deformation is because "bigger nearer and smaller faraway", i tried a few combinaions of "DEPTH" (i have no idea what's depth func, just trying -_-!!) but does have no luck. what do i miss?

UPDATE:  my code is modified from this:https://github.com/ILDAR1976/JoglObjLoader-master, i replaced the original obj with mine, the obj still deformed, but i didn't look that much with the "plane obj".

i have an exe ObjViewer, and that does not deform at all.

And another question, how do i make the light just shine like sun, no shader, do not change reflections while rotating?

GL2 gl = drawable.getGL().getGL2();
                gl.glEnable(GL2.GL_DEPTH_TEST);
               
                gl.glShadeModel(GL2.GL_SMOOTH);
                gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA);
                gl.glEnable(GL2.GL_BLEND);

                gl.glHint(GL2.GL_LINE_SMOOTH_HINT, GL2.GL_NICEST);
                gl.glEnable(GL2.GL_LINE_SMOOTH);
                gl.glEnable(GL2.GL_SMOOTH);
                gl.glEnable(GL2.GL_POINT_SMOOTH);
                gl.glEnable(GL2.GL_LINE_SMOOTH);
                gl.glEnable(GL2.GL_POLYGON_SMOOTH);

                gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL2.GL_NICEST);
                gl.glEnable(GL2.GL_CULL_FACE);
                gl.glEnable(GL2.GL_NORMALIZE);
                gl.glMatrixMode(GL2.GL_PROJECTION);
                gl.glLoadIdentity();
                gl.glMatrixMode(GL2.GL_MODELVIEW);
                gl.glLoadIdentity();
                gl.glEnable(GL2.GL_LIGHTING);
                gl.glEnable(GL2.GL_LIGHT0);
                gl.glEnable(GL2.GL_LIGHT1);
                gl.glShadeModel(GL2.GL_SMOOTH);