由于我缺乏知识,它是关于如何在java中从2d点(坐标/路径)创建3d模型并在javafx上显示?在基础知识中,我知道如何使用相机和灯光系统,这不是问题,但我有石头图片(原始图像),用户用鼠标输入选定的点,代码:
(画布将其放在具有原始图像的 ImageView 上。画布 w , h 绑定到 imageView 的父级,而 imageview 绑定到父级 w,h (因此 imageview 和画布是相同的 w,h ))
canvas.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent mouseEvent) {
if (isStarted()) {
App.logger.debug("Added the Point into: -> X: " + mouseEvent.getX() + " And Y: " + mouseEvent.getY());
points.add(new Point2D(mouseEvent.getX(), mouseEvent.getY()));
reDraw();
restorePoints = new ArrayList<Point2D>();
} else {
App.logger.debug("The Start stat is :" + isStarted() + " So we can't Draw Shapes.");
}
}
});
Run Code Online (Sandbox Code Playgroud)
点和恢复点是:ArrayList<Point2D> points = new ArrayList<Point2D>() …