Skip to main content

Swing/AWT rendering lg3d >>Java3D

7 replies [Last post]
anthonyfr
Offline
Joined: 2007-04-17
Points: 0

Hello !

I am writing a 3D applet in Java 3D. As I was said lg3D does work in applet. Here was my problem cause I need to run in an Applet. But lg3D has swing rendering. I would like to have Swing/AWR rendering in my Java 3D cube applet to set AWT/Swing component on the side off a cube box.

So I would like to know how lg3D does to render Swing or AWT.

Thanks.
Anthony

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nachiket_patel
Offline
Joined: 2007-02-03
Points: 0

Hi,
My requirement is the same....but i am not running it as applet.

Actually i want to use a Lable & TextField where user can put values...and submit it..
like lg3D has it...

And i want to use it in a already developed Java3D Application....

do you know how to do it?
or having a class or code which does this..???

anthonyfr
Offline
Joined: 2007-04-17
Points: 0

From know in Java 3D I was only able to set video or images on a cube box side. I can show you.

You can also take a look to the lg3d cvs project to see how lg3d implements Swing rendering. I did not hav time to see because of my project.

Message was edited by: anthonyfr

nachiket_patel
Offline
Joined: 2007-02-03
Points: 0

How did you set video or image on cube side...

Will you be able to send example code.????

I still didnt found anything for Swing within Java 3D...

Nachiket..

anthonyfr
Offline
Joined: 2007-04-17
Points: 0

Hi !

Look at this link
http://java.sun.com/products/java-media/jmf/2.1.1/solutions/DemoJMFJ3D.html

I can also give you samples of my code. Write me in private.

Anthony

anthonyfr
Offline
Joined: 2007-04-17
Points: 0

Does anyone know ?

Kirk Turner

The method is quite complex but I can summarise what it started out as
but I haven't kept up with the latest changes. I tried implementing
this, got so far, meanwhile Paul implemented pretty much the same
method, and I think Krishna took this over in the long run, so my
knowledge is out dated.

Basically in lg3d the AWT toolkit is overridden with the lg3d toolkit.
The main purpose of overriding the AWT toolkit is to allow the writing
of the swing rendering out to an image (rather than to the graphics
display) so that the image can be used as a texture and hence be
rendered within the 3D environment.

In this implementation I imagine that the 3D objects are
created/rendered via the lg3d wrappings for Java3D, so I don't think
it can be easily decoupled.

However, to get this to work you have to pass through JVM arguments to
use the lg3d toolkit instead of the AWT toolkit (have a look in the
build.xml, or the startup scritps for lg3dtoolkit), which I'm not sure
you can do in an applet, or at least not in an unsigned applet (I'm a
bit rusty on my applets).

Hope that helps.

Kirk

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@lg3d.dev.java.net
For additional commands, e-mail: interest-help@lg3d.dev.java.net

anthonyfr
Offline
Joined: 2007-04-17
Points: 0

Thanks for your mail. It's interesting.
It seems pretty difficult with technical limitations for applet. Is is away from my skill but I would like to undersand and reach my need.

Texture and image it is what I am trying to do without a great success. My idea was to take the Swing component as behind model, make image (in a thread) set it on my cube side ; and after make my own behavior to propage events to m behind model. But I don't really have at Swing/AWT component level the power to handle correctly the rendering.

I thougth I could use part/complete lg3d engine in order to render Swing/AWT on a cube side applet. I would like to.