我正在使用Java3D渲染三维场景。我想在3d图像的顶部叠加一个二维“抬头显示器”。如何在3d画布上高效绘制2d内容?
谢谢!
答案 0 :(得分:7)
// 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);
}
};