Skip to main content

can you update a java3d applet?

3 replies [Last post]
alwyn_y_stalwyn
Offline
Joined: 2006-02-17
Points: 0

i am making a game in an applet and was wondering if i can update the scene. i assume this is done with canvas (i'm probably wrong).

any help is appreciated

alwyn

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Gilson Laurent

Hello

> i am making a game in an applet and was wondering if i can update the
> scene. i assume this is done with canvas (i'm probably wrong).

Have you ever done any 3D-work before ?

> any help is appreciated

Look at the demos. You don't have to update the scene in order to repaint it.

You can add BranchGroups any time you want to add content. You can modify
TransformGroups to translate/shrink/manipulate stuff.

cu
[att1.dat]

Anonymous

This is also something i hav benn wondering about, all the examples i hav seen create a trasform object and make it rotate or just turn and stay there but none of them save the transform object. I havnt tryed but i think if u save the object and set the transforms to someything alse later on in the program.

Gilson Laurent

Hello

> all the examples i hav
> seen create a trasform object and make it rotate or just turn and stay
> there but none of them save the transform object.

By "save" you mean keeping a reference to it ? Like this ?

public class someclass{
Transformgroup TG;
public void createStuff(){
TG = new TransformGroup();
.....
}
}

So later TG is a valid object ?

> I havnt tryed but i think
> if u save the object and set the transforms to someything alse later on in
> the program. ---

You can set a new Transform3D later. But you have to tell java3d that this
will happen. Do it by calling:

TG.setCapability (TransformGroup.ALLOW_TRANSFORM_WRITE)

BEFORE adding the TransformGroup to anything. You can't change the Capability
after adding objects to the live scene.

cu
[att1.dat]