我正在使用Java3D渲染三维场景。我想在3d图像上方叠加一个二维的“平视显示器”。如何有效地在3d Canvas 顶部绘制2d内容?
谢谢!
最佳答案
// Create a Canvas3D using the preferred configuration
Canvas3D canvas3d = new Canvas3D(config)
{
private static final long serialVersionUID = 7144426579917281131L;
public void postRender()
{
this.getGraphics2D().setColor(Color.white);
this.getGraphics2D().drawString("Heads Up Display (HUD) Works!",100,100);
this.getGraphics2D().flush(false);
}
};