Hello.
I'm trying to make a video
image textured on 3D object using Java3D and JMF.
my program works as follows,
first, renderer plug-in handles video stream and returns BufferedImage to main
program, then, main program will use it as a texture on 3D object.
The problem is, Renderer or
VideoRenderer class does not return BufferedImage object. they return
awt.Component object as you know. so i return the data as Component, and process
it in the main program as follows
--------------------------------------
Component vc=p1.getVisualComponent();
BufferedImage bimg = new BufferedImage(SS, SS,
btype);
bimg = (BufferedImage) vc.createImage(vc.getBounds().width,vc.getBounds().height);
ImageComponent2D imgcmp = new ImageComponent2D(itype, bimg, byRef, true);
Texture2D tex1 = new Texture2D(Texture2D.BASE_LEVEL, ttype, SS, SS);
tex1.setImage(0, imgcmp);
return tex1;
------------------------------------------
bimg = (BufferedImage) vc.createImage(vc.getBounds().width,vc.getBounds().height);
ImageComponent2D imgcmp = new ImageComponent2D(itype, bimg, byRef, true);
Texture2D tex1 = new Texture2D(Texture2D.BASE_LEVEL, ttype, SS, SS);
tex1.setImage(0, imgcmp);
return tex1;
------------------------------------------
but it doesn't work. my object
is not textured. I've tested with different texture, and i can see the textured
object, but not with this one.
how can i do
that?
- additional questions
:)
1. any JMF tutorial on
internet? i cannot find any.
2. Is there any way to
return BufferedImage object?
3. I'm getting 2D image from
renderer like this.. first, renderer returns component object, and i get graphic
using createImage() method. is it right?
Thanks in adv.
