Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jGL matrix inversion get full of NaN values on XZ or YZ projections #286

Open
jzy3d opened this issue Jun 30, 2022 · 0 comments
Open

jGL matrix inversion get full of NaN values on XZ or YZ projections #286

jzy3d opened this issue Jun 30, 2022 · 0 comments
Labels
Projects

Comments

@jzy3d
Copy link
Owner

jzy3d commented Jun 30, 2022

Symptom

The impact for EmulGL (only) is that - without hack - the 2D to 3D projection provides Coord3D(0,0,0), leading to invisible tick and axis labels placed on the upper left corner for XZ and YZ projection only.

image

This is not the case for XY projection, and this never happens with Native charts.

image

Origin

When Camera.screenToModel is called by TextRenderer.to3D, The GLU.inverseMatrix44 method returns matrices full of NaN values.

A solution could be to provide a new implementation of inverseMatrix44, without confidence that it would be as efficient as this one. NB : the code comments let us think that this implementation is the second attempt.

Workaround

In order to get a quick (and dirty) fix, we simply let the view shift a little bit the viewpoint (only in the case of EmulGL) to ensure we do not fall in the case.

image

This is sometime not even visible, e.g. fix for XZ

image

This is sometime visible a bit, e.g. fix for YZ

image

Reproduce

See this integration test and run the test as a program rather than a unit test

public class ITTest_2D_Colorbar extends ITTest {
  public static void main(String[] args) {
    open(new ITTest_2D_Colorbar().when2DChartWithColorbarAndMargins(WT.EmulGL_AWT, HiDPI.ON, View2D.YZ));
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Jzy3D
Awaiting triage
Development

No branches or pull requests

1 participant