Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (686)
Games in Android Showcase (198)
games submitted by our members
Games in WIP (758)
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 / Java 3D / Re: Best solution to display 2D layer on top of 3D scene on: 2012-05-09 13:06:39
Hello Antoine,

I tried what you said and it works. The Text2D is just a little bit blinking but it doesn't matter.

Thanks / merci

But I see a strange effect.

The z offset of my Text2DBranchGroup is -2
In my scene, there is a tree at z = -50

The Text2D in the Text2DBranchGroup is displayed on top of tree trunc, ok, but the tree leafs (transparent texture) are displayed on top Text2D  !

It seems there is a z-buffer bug between 3D scene and PlatformGeometry.

Maybe is it related to my clipping ?


I need these values to display near objects and very far away ones.

Any idea ?

2  Java Game APIs & Engines / Java 3D / Best solution to display 2D layer on top of 3D scene on: 2012-05-09 11:15:12

I write a little Java3D program and I need to display a 2D layer on top of my 3D scene with

- dynamic stats (FPF, memory usage, ...)
- dynamic hour (rendered as an analog watch).

I searched on the web and I think I would use a PlatformGeometry

So, I created the following structure

PlatformGeometry => TransformGroup => BranchGroup => Text2D

But I have to create/update the Text2D on every frame.

When I try to do that (add a Text2D as a Child of the BranchGroup), I get an error Group: only a BranchGroup node may be added

I get an equivalent error when I try to remove previous Text2D child from the BranchGroup.

I think I gave the needed capabilities to the BranchGroup.


I also see I can remove the BranchGroup from the TransformGroup without getting any error. But, I don't think it's efficient on every frame to

- remove '2D stats' BranchGroup from '2D stats' TransformGroup
- create new '2D stats' BranchGroup
- create new Text2D and add it as child to '2D stats' BranchGroup
- add new '2D stats' BranchGroup to the '2D stats' TransformGroup.

So, what is the best solution ?

Thanks for all.

Pages: [1]
roseslayer (516 views)
2016-08-06 11:43:29

roseslayer (473 views)
2016-08-06 09:43:11

xTheGamerCodes (547 views)
2016-08-04 15:40:59

xTheGamerCodes (542 views)
2016-08-04 15:40:24

orrenravid (887 views)
2016-07-16 03:57:23

theagentd (965 views)
2016-07-11 14:28:54

Hydroque (1061 views)
2016-07-06 05:56:57

Hydroque (1042 views)
2016-07-03 08:52:54

GrandCastle (858 views)
2016-07-01 09:13:47

GrandCastle (644 views)
2016-07-01 09:09:45
Rendering resources
by Roquen
2016-08-08 05:55:21

Rendering resources
by Roquen
2016-08-08 05:52:42

Rendering resources
by Roquen
2016-08-08 05:50:38

Rendering resources
by Roquen
2016-08-08 05:49:53

Rendering resources
by Roquen
2016-08-08 05:32:39

Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42 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‑
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!