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 (406)
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   
  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]
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 (78 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (186 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.187 seconds with 21 queries.