Bug 377

Summary: float overflow
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED INVALID    
Severity: normal    
Priority: P3    
Version: 1   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
Workaround: ---
Attachments: Test program show that 'native' OpenGL also have overflow 'bugs'

Description Sven Gothel 2010-03-24 07:51:50 CET


---- Reported by orace 2009-08-26 05:56:48 ----

If I do :
 GL gl = getGL();
 printmatrix();
 System.out.println("scale -> " + Scale);
 gl.glScaled(Scale.getX(), Scale.getY(), Scale.getZ());
 printmatrix();
 System.out.println("trans -> " + Translation);
 gl.glTranslated(Translation.getX(), Translation.getY(), Translation.getZ());
 printmatrix();
With big values for scale ans Translation (up to 10e38,ie max_float) I get a lot
of NaN in the matrix.
Does JoGL use float instead of double for the Modelview/Projection matrix ?


PS : (output of the code below)
GL_MODELVIEW :
_________________________________
|0.75	|0.0	|0.0	|0.0	|
|0.0	|0.75	|0.0	|0.0	|
|0.0	|0.0	|1.0	|0.0	|
|0.125	|0.125	|0.0	|1.0	|
---------------------------------
scale -> 0.25, 2.5000000000000003E-46, 0.5
GL_MODELVIEW
_________________________________
|0.1875	|0.0	|0.0	|0.0	|
|0.0	|0.0*	|0.0	|0.0	|
|0.0	|0.0	|0.5	|0.0	|
|0.125	|0.125	|0.0	|1.0	|
---------------------------------
0.0* here we have 0.0 instead of 1.875E-46
trans -> -1.0, -1.0E45, -1.0
GL_MODELVIEW
_________________________________
|0.1875	|0.0	|0.0	|0.0	|
|0.0	|0.0	|0.0	|0.0	|
|0.0	|0.0	|0.5	|0.0	|
|NaN	|NaN	|NaN	|NaN	|
---------------------------------
here we have to mush NaN



---- Additional Comments From orace 2009-09-01 05:16:46 ----

Created an attachment
Test program show that 'native' OpenGL also have overflow 'bugs'




---- Additional Comments From orace 2009-09-01 05:17:04 ----

This is not a JoGL bug, indeed OpenGL **use** single precision Floating-Point
Computation.

See Opengl 3.1 spec : http://www.opengl.org/registry/doc/glspec31.20090528.pdf
ยง2.1.1 page 7

A C/C++ programs with OpenGL reproduce the same bug.



---- Additional Comments From mbien@fh-landshut.de 2010-03-20 13:01:03 ----

set to INVALID since its expected behavior.



--- Bug imported by sgothel@jausoft.com 2010-03-24 07:51 EDT  ---

This bug was previously known as _bug_ 377 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=377
Imported an attachment (id=141)

The original submitter of attachment 141 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.