How to get the absolute rotation of a Node in JavaFX

后端 未结 2 1877
孤城傲影
孤城傲影 2021-01-24 23:49

In JavaFX the rotateProperty of a Node provides me with its rotation in degree relative to its parent. Is there a way to get the absolute rotation in degree, either relative to

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-25 00:20

    The question isn't really well defined, since different Nodes in the Scene graph are potentially rotated about different axes.

    The getLocalToSceneTransform() method will return a Transform representing the transformation from the local coordinate system for the node to the coordinate system for the Scene. This is an affine transformation; you can extract a 3x4 matrix representation of it relative to the x- y- and z-axes if you like.

提交回复
热议问题