0

I'm currently creating a 3D solar system model and need to create trails behind the orbits of the bodies.

I have been using Cylinders to create a 3D line, however I would like to produce a line that stays at a constant width no matter the zoom of the view.

I think it might be possible with a 2D line but im not sure how to go about that, I would need to convert the 3D Points into the 2D Points for the scene and then create a line using them, but the line would need to be continually updated depending on the rotation and zoom of the camera.

Is there a better way to go about this?

jameslfc19
  • 1,084
  • 1
  • 10
  • 14
  • 1
    See the edit in this [answer](https://stackoverflow.com/a/52020701/3956070). It mentions precisely how to update points in a 2D overlay on top of the 3D sub scene. You could easily add a 2D line to connect the points, and call the update method whenever the camera changes (see also this [sample](https://github.com/FXyz/FXyz/blob/master/FXyz-Samples/src/main/java/org/fxyz3d/samples/utilities/FloatingLabels.java)). – José Pereda Oct 15 '19 at 16:40
  • Okay I have managed to get something sort of working. However when I rotate the camera or zoom the previous points don't get rotated or zoomed with it! Like this https://i.gyazo.com/adee4ec5ffafa4e2cb10feb560f0ac5e.png – jameslfc19 Oct 16 '19 at 09:01
  • Ah okay, so I have been rotating the whole group when the mouse was dragged, however, I need to be rotating the camera. Are there any libraries that provide a simple rotatable Perspective Camera? – jameslfc19 Oct 16 '19 at 09:21

0 Answers0