Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 739 times)
0 Members and 1 Guest are viewing this topic.
Offline saloisio

Senior Newbie




Java games rock!


« Posted 2004-06-01 15: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

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #1 - Posted 2004-06-02 08: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 11: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!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #3 - Posted 2004-06-11 08: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 14: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.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (30 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!