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 (536)
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: Rendering TransformGroups? on: 2006-01-26 23:25:30
Yeah, that's what I've been doing- haven't been seeing it though.
2  Java Game APIs & Engines / Xith3D Forums / Rendering TransformGroups? on: 2006-01-26 18:17:11
I'm looking to use 2D Text on my HUD, and have searched the board for others' solutions. DText2D by Goliat looks like the most promising one, but I can't get the text to render. How would I get a DText2D object to show up, being that it extends TransformGroup?
3  Java Game APIs & Engines / Xith3D Forums / Re: 2D Overlay on 3D Rendering on: 2006-01-25 00:07:14
The foreground node is working fine, I just need to sync the coordinates up with the screen. Setting a Transform3D ortho is giving me bad results. If i have a 1024x768 screen, doing a trans.ortho(0,1024,0,768,0,1) stretches the y-axis (to make up for the difference, I guess). Other than this problem, it doesn't seem necessary to do the double-rendering job that the thread you suggested is proposing.
4  Java Game APIs & Engines / Xith3D Forums / 2D Overlay on 3D Rendering on: 2006-01-24 23:15:05
I am attempting to render some textured Quads in the front of the canvas. I was able to do this using plain JOGL with the following:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glPushMatrix();
      glu.gluOrtho2D(0,Constants.WINDOW_WIDTH,0,Constants.WINDOW_HEIGHT);
                 //Render

      gl.glBindTexture(GL.GL_TEXTURE_2D,TextureTools.getHudRadar());
      gl.glBegin(GL.GL_QUADS);
      gl.glTexCoord2f(0,1);
                gl.glVertex2f(Constants.HUD_POS_RADAR_REAR_X,Constants.HUD_POS_RADAR_REAR_Y);
      gl.glTexCoord2f(0,0);
                gl.glVertex2f(Constants.HUD_POS_RADAR_REAR_X,Constants.HUD_POS_RADAR_REAR_Y-Constants.HUD_SIZE_RADAR);      
                gl.glTexCoord2f(1,0);
               gl.glVertex2f(Constants.HUD_POS_RADAR_REAR_X+Constants.HUD_SIZE_RADAR,Constants.HUD_POS_RADAR_REAR_Y-Constants.HUD_SIZE_RADAR);
      gl.glTexCoord2f(1,1);
                gl.glVertex2f(Constants.HUD_POS_RADAR_REAR_X+Constants.HUD_SIZE_RADAR,Constants.HUD_POS_RADAR_REAR_Y);
      gl.glEnd();      


                gl.glPopMatrix();
      gl.glMatrixMode(GL.GL_MODELVIEW);


How would I go about doing this with Xith? I've been trying variations of the following:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
      BranchGroup hud = new BranchGroup();
      Transform3D t = new Transform3D();
      t.ortho(0,1024,0,768,0,1);
      hud.setTransformGroup(new TransformGroup(t));

      Point3f [] coords = new Point3f[] {
            new Point3f(0,0,-1f),
            new Point3f(0,128,-1f),
            new Point3f(128,128,-1f),
            new Point3f(128,0,-1f)
      };

      QuadArray qA = new QuadArray(coords.length,GeometryArray.COORDINATES | GeometryArray.TEXTURE_COORDINATE_2);
      qA.setCoordinates(0,coords);
      Appearance a = new Appearance();
      a.setColoringAttributes(new ColoringAttributes(new Color3f(1,1,1),ColoringAttributes.SHADE_FLAT));
      Shape3D s = new Shape3D(qA,a);
      hud.addChild(s);


The quad renders at a clearly incorrect size. I have a feeling that it has something to do with the distance of the quad from the camera (-1f, in this case) as the original used Vertex2f, and had no Z component. Any suggestions?
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 (18 views)
2014-07-29 18:09:19

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

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

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

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

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

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

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

Riven (29 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!