4

To outline my overall objective, I want to display a set of world political boundaries (countries) and states which can be zoomed and panned similar to google earth. My dataset is detailed enough to have around 1,200,000 lat/lon points to define the boundaries I want to display. I'm exploring using JavaFX 3D to take advantage of the hardware graphics acceleration.

I'm getting acceptable performance doing this, but I'm running into an issue with the way the javafx.scene.shape.Polyline is being rendered. When I try to draw the Polyline representing my world political boundaries in my scenegraph in around a 360x200 unit 2d plane it is severely pixelated when I zoom in as though the line were a low res image.

What I really want is for lines to be rendered a constant 'width' on the screen no matter how close or how far I am from the line object. I may be using the wrong shape object but the other objects did not obviously fit what I was wanting to do. I also tried 'Path/LineTo' with the same result.

F(X)yz looks promising, but I was hoping to avoid a third-party library.

In the past I've used the original java3d and don't remember having this issue. In that I used a LineArray.

Do you have suggestions on how to achieve drawing a line/ray/vector that looks the same regardless of how 'close/far' you are to it using JavaFX 3D (java 1.8), or is F(X)yz my best option? Render setting tips?

Skcussm
  • 658
  • 1
  • 5
  • 20

1 Answers1

3

I've asked a similar question some time ago and I'm afraid F(X)yz is still the best way to go due to JavaFX's lack of 3D components.

In your particular case, PolyLine3D is what you want. It uses mesh views under the hood to enable hardware acceleration within 3D environments. The alternative would be to triangulate the borders by yourself and use TriangleMesh. Since you want the line width to stay the same size, you would have to do this everytime the map is being zoomed.

beatngu13
  • 7,201
  • 6
  • 37
  • 66
  • 1
    As this is the only answer, it is surely the best. It seems that F(X)yz will do what I want. Sorry for the delayed acceptance. Thanks. – Skcussm Jun 14 '16 at 22:05
  • I've had issues with a similar approach where it's impossible/hard to remove the phong lighting effects from the lines in the scene – kellpossible Jul 04 '17 at 01:37