Java3D:在 Canvas3D 上绘制 2D HUD [英] Java3D: Painting 2D HUD over a Canvas3D

查看:34
本文介绍了Java3D:在 Canvas3D 上绘制 2D HUD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Java3D 来渲染一个 3D 场景.我想在 3d 图像的顶部叠加一个二维平视显示器".如何在 3d 画布上有效地绘制 2d 内容?

I'm using Java3D to render a three-dimensional scene. I would like to overlay a two-dimensional "heads-up-display" on top of the 3d image. How can I efficiently paint the 2d content on top of the 3d canvas?

谢谢!

推荐答案

    // 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);
        }
    };

这篇关于Java3D:在 Canvas3D 上绘制 2D HUD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆