Issue Details (XML | Word | Printable)

Key: JOGL-377
Type: Bug Bug
Status: Resolved Resolved
Resolution: Incomplete
Priority: Major Major
Assignee: jogl-issues
Reporter: orace
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jogl

float overflow

Created: 26/Aug/09 05:56 AM   Updated: 20/Mar/10 01:01 PM   Resolved: 20/Mar/10 01:01 PM
Component/s: jogl
Affects Version/s: current
Fix Version/s: milestone 1

Time Tracking:
Not Specified

File Attachments: 1. Text File test.cpp (5 kB) 01/Sep/09 05:16 AM - orace

Environment:

Operating System: All
Platform: All


Issuezilla Id: 377
Tags:
Participants: jogl-issues, mbien and orace


 Description  « Hide

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



orace added a comment - 01/Sep/09 05:16 AM

Created an attachment (id=141)
Test program show that 'native' OpenGL also have overflow 'bugs'


orace added a comment - 01/Sep/09 05:17 AM

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.


mbien added a comment - 20/Mar/10 01:01 PM

set to INVALID since its expected behavior.