JavaFX 3D - 是否可以更改 DrawMode.Line 中线的宽度?
JavaFX 3D - Is it possible to change the width of Line in DrawMode.Line?
我想用 DrawMode.LINE 更改任何网格的 linewidth,但不知道可不可以
我添加了一些代码以供参考。
@Override
public void start(Stage primaryStage) throws Exception{
PerspectiveCamera camera= new PerspectiveCamera(true);
Group root = new Group();
Scene scene = new Scene(root, 1024, 768, true);
primaryStage.setScene(scene);
primaryStage.show();
scene.setFill(Color.BLACK);
camera.setFarClip(10000);
camera.setTranslateZ(-10);
scene.setCamera(camera);
Box box = new Box();
box.setDrawMode(DrawMode.LINE);
root.getChildren().addAll(camera,box);
}
public static void main(String[] args) {
launch(args);
}
这是不可能的。 DrawMode
被传递给默认线框为宽度为 1 的线的原生渲染器。对于 Direct3D 管道,请参阅 Outline and Fill State. Even if you use the line drawing support library 它会告诉您:
The library uses native hardware line drawing support (if available in
the device) only if:
- Line width is 1.
- No line pattern is enabled.
不能用line primitives绘制不同于1的线宽,而必须用三角形来绘制:
The line drawing library emulates lines using texture triangles
换句话说,宽度1是特殊的,因为它有特定的硬件支持。
我想用 DrawMode.LINE 更改任何网格的 linewidth,但不知道可不可以
我添加了一些代码以供参考。
@Override
public void start(Stage primaryStage) throws Exception{
PerspectiveCamera camera= new PerspectiveCamera(true);
Group root = new Group();
Scene scene = new Scene(root, 1024, 768, true);
primaryStage.setScene(scene);
primaryStage.show();
scene.setFill(Color.BLACK);
camera.setFarClip(10000);
camera.setTranslateZ(-10);
scene.setCamera(camera);
Box box = new Box();
box.setDrawMode(DrawMode.LINE);
root.getChildren().addAll(camera,box);
}
public static void main(String[] args) {
launch(args);
}
这是不可能的。 DrawMode
被传递给默认线框为宽度为 1 的线的原生渲染器。对于 Direct3D 管道,请参阅 Outline and Fill State. Even if you use the line drawing support library 它会告诉您:
The library uses native hardware line drawing support (if available in the device) only if:
- Line width is 1.
- No line pattern is enabled.
不能用line primitives绘制不同于1的线宽,而必须用三角形来绘制:
The line drawing library emulates lines using texture triangles
换句话说,宽度1是特殊的,因为它有特定的硬件支持。