Re: [sdljava-users] Incorrect behaviour of glTranslatef() on Linux?
Status: Beta
Brought to you by:
ivan_ganza
From: Raffael H. <her...@ra...> - 2005-12-23 09:03:10
|
Ivan Z. Ganza schrieb: > I would have to gamble that glTranslatef() is working correctly. The > reason is that sdljava only delegates the call to the OpenGL layer > and does nothing special itself. Yes, I actually thought so too, but the behaviour was so funny ... ;) Yesterday I managed to figure out what was going wrong by looking at a=20 C/SDL 'port' of the tutorial code. This code did some more OpenGL=20 initialization before the 1:1 port of the tutorial: gl.glEnable(GL.GL_TEXTURE_2D); gl.glShadeModel(GL.GL_SMOOTH); gl.glClearColor(0f, 0f, 0f, 0f); gl.glClearDepth(1); gl.glEnable(GL.GL_DEPTH_TEST); gl.glDepthFunc(GL.GL_LEQUAL); gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); gl.gluPerspective(45f, (float)width/(float)height, .1f, 100f); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); By experiments I found that the call to gluPerspective() while in matrix=20 mode GL_PROJECTION is the important action here which makes things=20 working as they should. I'm sure, some time I'll even understand=20 why. ;) cu & thanks, Raffi =2D-=20 The difference between theory and practice is that in theory, there is no difference, but in practice, there is. he...@ra... =B7 ICQ#67961355 =B7 PGP Key 5D1FF5F4 =B7 www.raffael.ch |