displaying a 2d overlay on a 3d canvas

how can i display a image like a interfaceon a 3d canvasive tryed imageoverlay but it doesnt work for me
[125 byte] By [aaa801a] at [2007-11-27 10:00:34]
# 1

create your own class extending Canvas3D.

This is one I wrote for 2D text be displayed over 3d canvas. should work with images.

import javax.swing.*;

import java.awt.*;

import com.sun.j3d.utils.universe.*;

import com.sun.j3d.utils.geometry.*;

import javax.media.j3d.*;

import javax.vecmath.*;

import com.sun.j3d.utils.image.*;

import javax.media.j3d.LineAttributes;

public class JoCanvas extends Canvas3D

{

private String t;

private Font f;

public JoCanvas(GraphicsConfiguration gcIn)

{

super(gcIn);

f = new Font("Arial",0,30);

t=" ";

}

public void postRender()

{

J3DGraphics2D g = getGraphics2D();

g.setFont(f);

g.setColor(Color.orange);

g.drawString(t, 100, 100);

g.flush(true);

}

public void setText(String s)

{

t=s;

repaint();

}

}

seegreena at 2007-7-13 0:31:54 > top of Java-index,Security,Cryptography...