Login  Register

Re: My Obj is deforming while rotating.

Posted by gouessej on Aug 11, 2017; 9:15am
URL: https://forum.jogamp.org/My-Obj-is-deforming-while-rotating-tp4038111p4038112.html

Hi

You don't understand what you do, you should learn the basics of OpenGL before coding. gluPerspective and glFrustum must be called when the matrix mode is GL_PROJECTION, gluLookAt can be called when the matrix mode is GL_MODELVIEW. Your source code is correct in your reshape method but not in your init method. Moreover, don't call new GLU(), rather call GLU.createGLU(GL). By the way, there are 2 WaveFront OBJ importers in JogAmp (one in JOGL and another one in JOGL-Utils) and there are a WaveFront OBJ importer and a WaveFront OBJ exporter in JogAmp's Ardor3D Continuation, the last importer I mention is probably the most robust you can find in Java. You should look at TextureIO and use a try with resource when opening streams.
Julien Gouesse | Personal blog | Website