Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Xith3D Forums / Re: AseTransformGroup demo on: 2004-07-23 14:16:49
Thanks for the help Will, works great now!  Grin

Man, I love being able to access those TGs inside the ASE object file. It makes things so much cleaner in the code. To think that I once upon a time I actually had to build the model 'tree' myself, or had to remove and then add each group to avoid the ever so famous "... child node already has parent.. " error Tongue
Thank-god for this ASE loader  Smiley
2  Java Game APIs & Engines / Xith3D Forums / Re: AseTransformGroup demo on: 2004-07-22 20:26:57
Do you know where I can get it?  Grin
3  Java Game APIs & Engines / Xith3D Forums / AseTransformGroup demo on: 2004-07-22 15:08:39
What technique was used to create the model in the human.ase object file for this demo? In the tutorial it says to 'group' the various pieces  of the model such as: hand + forearm = group A,  hand + forearm + upper arm = group B, etc. However, when I try this approach in MAX the last group I create always kills the previous one. That is, after I make group A, I combine the hand + forearm + upper arm into group B, but then group A no longer exists!

Can someone please tell me what the right technique is. Should I be using 'links' insted? I just want to create the model properly so that I'll be able to export it into ASE and manipulate the TGs as in the AseTransformGroup demo.

BTW, I tried importing the human.ase file into max but it won't import, maybe corrupt ??
4  Java Game APIs & Engines / Java 3D / Re: Start behaviors before scene is visible on: 2004-06-30 13:37:14
endolf,

calling processStimulus from the Swing thread causes a java.lang.IllegalStateException at runtime. This is thrown by the wakupOn call that I have in the processStimulus. Excerpt from wakupOn javadoc: "Throws:
java.lang.IllegalStateException - if this method is called by a method other than initialize or processStimulus"
I guess what they really mean is that the wakeupOn should only be called from a J3D thread (probably the BehaviorScheduler).

So, the only workaround that I found was to create another public method in my behavior which would do the same work as my processStimulus minus the setting of the wakeupOn:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
.
.
.
public MyBehavior(TransformGroup aTransformGroup)
{
     transformGroup = aTransformGroup;
     wakeupCondition = new WakeupOnTransformChange(transformGroup);
}

public void initialize()
{
     wakeupOn(wakeupCondition);
}

public void processStimulus(Enumeration e)
{
     doWork();
     wakeupOn(wakeupCondition);
}

public void doWork()
{
     // doing something here
}
.
.
.


This works fine, but I now need to call doWork() everytime the user is interacting with one of the swing controls insted of just letting the behavior worry about it  Sad
5  Java Game APIs & Engines / Java 3D / Re: Start behaviors before scene is visible on: 2004-06-28 16:19:11
Breakfast,

I've already tried what you proposed, and it works fine. However, in a situation where the user will only be interacting and viewing the swing GUI, he/she will not receive any visual indications of any tranformations that took place in the 3D scene. This is very misleading to the user since the transformations did in fact take place, but no behavior was run.

So, just to recap,  it is possible to perform tranformations on a scene before it is rendered, but it is not possible to have any behavior respond to those tranformations. Is there some way to "jump start" the BehaviorScheduler before the scene is rendered? Or is the problem related to some rule that the ViewingPlatform's bounds aren't valid until the Canvas3D is shown?
6  Java Game APIs & Engines / Java 3D / Re: HUD visible to all Viewers on: 2004-06-12 16:07:55
This is the code I use to create the HUD:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
// Creating PlatformGeometry
PlatformGeometry hudPlatformGeometry = new PlatformGeometry();
hudPlatformGeometry.setCapability(PlatformGeometry.ALLOW_CHILDREN_WRITE);
hudPlatformGeometry.setCapability(PlatformGeometry.ALLOW_CHILDREN_READ);
hudPlatformGeometry.setCapability(PlatformGeometry.ALLOW_CHILDREN_EXTEND);

// Creating GraphicsConfiguration
GraphicsConfigTemplate3D gTempl3D = new GraphicsConfigTemplate3D();
gTempl3D.setDoubleBuffer(GraphicsConfigTemplate3D.PREFERRED);
gTempl3D.setSceneAntialiasing(GraphicsConfigTemplate3D.PREFERRED);
gTempl3D.setStereo(GraphicsConfigTemplate3D.PREFERRED);
GraphicsConfiguration graphicsConfig = GraphicsEnvironment.getLocalGraphicsEnvironment().
                      getDefaultScreenDevice().getBestConfiguration(gTempl3D);

// Assign GraphicsConfiguration to the Canvas3D
Canvas3D aCanvas = new Canvas3D(graphicsConfig);

// Create the PhysicalHUD
PhysicalHUD hud = new PhysicalHUD(MAX_NUM_OF_HUD_LAYERS, aCanvas3D, hudPlatformGeometry, 4f);

// Create a Viewer using aCanvas and hudPlatformGeometry
Viewer ptiViewer = new Viewer(aCanvas);
ViewingPlatform ptiPlatform = new ViewingPlatform();
ptiViewer.setViewingPlatform(ptiPlatform);

ptiPlatform.setPlatformGeometry(hudPlatformGeometry);


After this I just add the ViewingPlatform to my scene graph. Please let me know if you require further clarification. Thank-you.
7  Java Game APIs & Engines / Java 3D / Re: Start behaviors before scene is visible on: 2004-06-12 15:52:21
Sorry about the confusion, I'll try to explain:

Quote
you say the code to transform the scene is in behaviors


I never said that the behaviors transform the scene, I said that the behaviors are "connected" to these transforms (TransformGroups) like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
// Constructor
public My3DBehavior(TransformGroup aTransformGroup)
{
   transformGroup = aTransformGroup;
   wakeupCondition = new WakeupOnTransformChange(transformGroup);
}

// Initialize the behavior to wake up on a transform
// change.
public void initialize()
{
   wakeupOn(wakeupCondition);
}

// TransformGroup has been modified!
public void processStimulus(Enumeration e)
{
   System.out.println("TransformGroup has been modified!");
   doWork();
   // Reset the wake up condition.
  wakeupOn(wakeupCondition);
}


So the problem again is that if the Canvas3D is not made visible, the 'processStimulus()' of 'My3DBehavior' will not be called, even though the TransformGroup is modified. As soon as the Canvas3D is made visible, all further transforms on the TransformGroup is caught by the behavior.

Please let me know if there is need for further explaination. Thank-you.

P.S.  I was already using setEnabed(true).
8  Java Game APIs & Engines / Java 3D / Re: HUD visible to all Viewers on: 2004-06-02 13:33:27
Hi,

My application doesn't support multiple players, only one. That one player has both a first-person-view with a HUD, and a third-person-view (without a HUD). Both of these views (with their own Canvas3Ds) are visible at the same time. So I guess you'd say it's sort of a "split-screen" setup.

The problem is that from the third-person-view camera, the HUD that's attached to the first-person-view camera is visible. By "visible" I don't mean that it's showing in full screen as in the first-person-view, it sort of looks like a 2D projection attached to the first-person-view camera.

The first-person-view camera is attached to a 3D model. So when the model rotates this camera can see exactly what the model is facing. If the model is facing the third-person-view camera, the HUD isn't visible. But as soon as I start rotating the model past about 90 degrees the HUD becomes visible (on the third-person-camera).
9  Java Game APIs & Engines / Java 3D / Start behaviors before scene is visible on: 2004-06-01 17:49:30
Sorry about the two posts in a row  Smiley

Does anyone know if it's possible to start 3D behaviors (javax.media.j3d.Behavior) before the Canvas3D becomes visible?

Here's what I'm trying to do:

I'm using a Swing application to manipulate a 3D scene. However, none of the Behaviors will run unless I previously viewed the Canvas3D. That is, if I start my Swing application (cannot initially see Canvas3D) and just start interacting with the GUI (contains JButtons, JTextField, etc) that causes transforms in the 3D scene, none of the behaviors connected to these tranforms will have their processStimulus() invoked, however the transforms do take place! Is there a way around this?
10  Java Game APIs & Engines / Java 3D / HUD visible to all Viewers on: 2004-06-01 17:09:09
I'm currently using the HUD package from http://www.newdawnsoftware.com/resources/newdawnhud.zip . It works really great, except for one thing: viewers in the same scene can see each other's HUDs! They look like 2D graphics that follow the ViewPlatform transform of each Viewer. Is there a way to hide the HUD from the sight of other Viewers in the same scene?
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (11 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!