开发者

Java3D: Painting 2D HUD over a Canvas3D

开发者 https://www.devze.com 2022-12-25 02:52 出处:网络
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 effi开发者_JS百科ciently paint the 2d content on t

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 effi开发者_JS百科ciently paint the 2d content on top of the 3d canvas?

Thanks!


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

精彩评论

暂无评论...
验证码 换一张
取 消