Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  HUD visible to all Viewers  (Read 556 times)
0 Members and 1 Guest are viewing this topic.
Offline saloisio

Senior Newbie




Java games rock!


« Posted 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?
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #1 - Posted 2004-06-02 10:12:58 »

Hi
 When you say other players, how do multiple people play, do you do a split screen thing, or are they networked?.

Cheers

Endolf

Offline saloisio

Senior Newbie




Java games rock!


« Reply #2 - Posted 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).
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #3 - Posted 2004-06-11 10:30:58 »

Hi
 How do you go about creating your PhysicalHUD object?

Cheers

Endolf

Offline saloisio

Senior Newbie




Java games rock!


« Reply #4 - Posted 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.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (88 views)
2013-05-17 21:29:12

alaslipknot (96 views)
2013-05-16 21:24:48

gouessej (128 views)
2013-05-16 00:53:38

gouessej (123 views)
2013-05-16 00:17:58

theagentd (131 views)
2013-05-15 15:01:13

theagentd (119 views)
2013-05-15 15:00:54

StreetDoggy (161 views)
2013-05-14 15:56:26

kutucuk (184 views)
2013-05-12 17:10:36

kutucuk (185 views)
2013-05-12 15:36:09

UnluckyDevil (191 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.151 seconds with 22 queries.