Skip to main content

Workaround for ZBuffer-Problem?

4 replies [Last post]
albrecht
Offline
Joined: 2005-07-11

Hi,
i would like to do a presentation on 23.9. with my lg3d apps. But i always have problems with the ZBuffer.
heres a screenshot:
http://www.familie-uhlig.com/zbufferproblem.jpg

the cube is actuealy in front of the panel. i cant show apps like this :(

is their anyway to get it work? i already asked that question here some time ago, i think the anwser was, to wait for another java3d. is it possible to turn of the transparence off or something else to get it work?

here the code i used for the screenshot:

public class ZBufferTest {
public static void main(String[] args)
{
Frame3D frame = new Frame3D();
ColorCube cube = new ColorCube( 0.02f );
SimpleAppearance app = new SimpleAppearance(0.3f, 0.11f, 0.8f , 1.0f);
GlassyPanel gpanel = new GlassyPanel( 0.1f, 0.1f,0.01f, app );
Component3D comp = new Component3D();
Component3D comp2 = new Component3D();
comp2.addChild( cube );
comp2.setTranslation( 0, 0.02f, -0.02f );
comp.addChild( gpanel );
comp.setRotationAxis( 1,0,0 );
comp.setRotationAngle( (float) (-Math.PI *0.35f) );
comp.setCursor( Cursor3D.SMALL_CURSOR );
frame.addChild( comp );
frame.addChild( comp2 );
frame.changeEnabled(true);
frame.changeVisible(true);
}
}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Juan González

Note that using this the ColorCube will ALWAYS be rendered before (nearest)
than the GlassyPanel so if you move it you can note that you can't see the
intersection betwen the cube and the panel, you can think of it like if the
cube was painted over the panel.

El Miércoles, 13 de Septiembre de 2006 19:38, Juan González escribió:
> Hi
> recently paulby integrated a new kind of group which bases the
> transparency algorithm in the order elements are added to the group, try
> this (note this scenegraph is a bit ill, but it shows the desired behaviour
> and wa quick):
>
> [code]
> public static void main(String []args) {
> Frame3D frame = new Frame3D();
> ColorCube cube = new ColorCube( 0.02f );
> SimpleAppearance app = new SimpleAppearance(0.3f, 0.11f, 0.8f ,
> 1.0f); GlassyPanel gpanel = new GlassyPanel( 0.1f, 0.1f,0.01f, app );
> Component3D comp = new Component3D();
> Component3D comp2 = new Component3D();
> comp2.addChild( cube );
> comp2.setTranslation( 0, 0.02f, -0.02f );
> comp.addChild( gpanel );
> comp.setRotationAxis( 1,0,0 );
> comp.setRotationAngle( (float) (-Math.PI *0.35f) );
> comp.setCursor( Cursor3D.SMALL_CURSOR );
> TransparencyOrderedGroup tog = new TransparencyOrderedGroup();
> tog.addChild( comp );
> tog.addChild( comp2 );
> Component3D auxComp = new Component3D();
> auxComp.addChild(tog);
> frame.addChild(auxComp);
> frame.changeEnabled(true);
> frame.changeVisible(true);
> }
> [/code]
>
> HIH
>
> PS: As a side note, I believe it should be usefull to have a
> TransparencyOrderedComponent3D&Container3D if possible, as the transparency
> issue is well known and shows in many places...
>
> El Miércoles, 13 de Septiembre de 2006 18:15, lg3d@javadesktop.org escribió:
> > Hi,
> > i would like to do a presentation on 23.9. with my lg3d apps. But i
> > always have problems with the ZBuffer. heres a screenshot:
> > http://www.familie-uhlig.com/zbufferproblem.jpg
> >
> > the cube is actuealy in front of the panel. i cant show apps like this :(
> >
> > is their anyway to get it work? i already asked that question here some
> > time ago, i think the anwser was, to wait for another java3d. is it
> > possible to turn of the transparence off or something else to get it
> > work?
> >
> > here the code i used for the screenshot:
> >
> > public class ZBufferTest {
> > public static void main(String[] args)
> > {
> > Frame3D frame = new Frame3D();
> > ColorCube cube = new ColorCube( 0.02f );
> > SimpleAppearance app = new SimpleAppearance(0.3f, 0.11f, 0.8f ,
> > 1.0f); GlassyPanel gpanel = new GlassyPanel( 0.1f, 0.1f,0.01f, app );
> > Component3D comp = new Component3D();
> > Component3D comp2 = new Component3D();
> > comp2.addChild( cube );
> > comp2.setTranslation( 0, 0.02f, -0.02f );
> > comp.addChild( gpanel );
> > comp.setRotationAxis( 1,0,0 );
> > comp.setRotationAngle( (float) (-Math.PI *0.35f) );
> > comp.setCursor( Cursor3D.SMALL_CURSOR );
> > frame.addChild( comp );
> > frame.addChild( comp2 );
> > frame.changeEnabled(true);
> > frame.changeVisible(true);
> > }
> > }
> > [Message sent by forum member 'albrecht' (albrecht)]
> >
> > http://forums.java.net/jive/thread.jspa?messageID=152710
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: interest-unsubscribe@lg3d.dev.java.net
> > For additional commands, e-mail: interest-help@lg3d.dev.java.net

--
ID:44B9EB26 Fingerprint:B480 E909 0C80 E303 F0A8 4C2C 6C4F A12B 44B9 EB26
Get:http://keyserv.nic-se.se:11371/pks/lookup?op=vindex&search=0x6C4FA12B44B9EB26

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@lg3d.dev.java.net
For additional commands, e-mail: interest-help@lg3d.dev.java.net

afishionado
Offline
Joined: 2004-05-26

My app has been experiencing similar issues, and I was pointed at the TransparencyOrderedGroup class. I'm still not certain how much it will help my app, but it looks ideal for your case.

Juan González

Hi
recently paulby integrated a new kind of group which bases the transparency
algorithm in the order elements are added to the group, try this (note this
scenegraph is a bit ill, but it shows the desired behaviour and wa quick):

[code]
public static void main(String []args) {
Frame3D frame = new Frame3D();
ColorCube cube = new ColorCube( 0.02f );
SimpleAppearance app = new SimpleAppearance(0.3f, 0.11f, 0.8f , 1.0f);
GlassyPanel gpanel = new GlassyPanel( 0.1f, 0.1f,0.01f, app );
Component3D comp = new Component3D();
Component3D comp2 = new Component3D();
comp2.addChild( cube );
comp2.setTranslation( 0, 0.02f, -0.02f );
comp.addChild( gpanel );
comp.setRotationAxis( 1,0,0 );
comp.setRotationAngle( (float) (-Math.PI *0.35f) );
comp.setCursor( Cursor3D.SMALL_CURSOR );
TransparencyOrderedGroup tog = new TransparencyOrderedGroup();
tog.addChild( comp );
tog.addChild( comp2 );
Component3D auxComp = new Component3D();
auxComp.addChild(tog);
frame.addChild(auxComp);
frame.changeEnabled(true);
frame.changeVisible(true);
}
[/code]

HIH

PS: As a side note, I believe it should be usefull to have a
TransparencyOrderedComponent3D&Container3D if possible, as the transparency
issue is well known and shows in many places...
El Miércoles, 13 de Septiembre de 2006 18:15, lg3d@javadesktop.org escribió:
> Hi,
> i would like to do a presentation on 23.9. with my lg3d apps. But i always
> have problems with the ZBuffer. heres a screenshot:
> http://www.familie-uhlig.com/zbufferproblem.jpg
>
> the cube is actuealy in front of the panel. i cant show apps like this :(
>
> is their anyway to get it work? i already asked that question here some
> time ago, i think the anwser was, to wait for another java3d. is it
> possible to turn of the transparence off or something else to get it work?
>
> here the code i used for the screenshot:
>
> public class ZBufferTest {
> public static void main(String[] args)
> {
> Frame3D frame = new Frame3D();
> ColorCube cube = new ColorCube( 0.02f );
> SimpleAppearance app = new SimpleAppearance(0.3f, 0.11f, 0.8f ,
> 1.0f); GlassyPanel gpanel = new GlassyPanel( 0.1f, 0.1f,0.01f, app );
> Component3D comp = new Component3D();
> Component3D comp2 = new Component3D();
> comp2.addChild( cube );
> comp2.setTranslation( 0, 0.02f, -0.02f );
> comp.addChild( gpanel );
> comp.setRotationAxis( 1,0,0 );
> comp.setRotationAngle( (float) (-Math.PI *0.35f) );
> comp.setCursor( Cursor3D.SMALL_CURSOR );
> frame.addChild( comp );
> frame.addChild( comp2 );
> frame.changeEnabled(true);
> frame.changeVisible(true);
> }
> }
> [Message sent by forum member 'albrecht' (albrecht)]
>
> http://forums.java.net/jive/thread.jspa?messageID=152710
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@lg3d.dev.java.net
> For additional commands, e-mail: interest-help@lg3d.dev.java.net

--
ID:44B9EB26 Fingerprint:B480 E909 0C80 E303 F0A8 4C2C 6C4F A12B 44B9 EB26
Get:http://keyserv.nic-se.se:11371/pks/lookup?op=vindex&search=0x6C4FA12B44B9EB26

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@lg3d.dev.java.net
For additional commands, e-mail: interest-help@lg3d.dev.java.net

Juan González

This is how it looks like http://img235.imageshack.us/img235/310/togop9.png

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@lg3d.dev.java.net
For additional commands, e-mail: interest-help@lg3d.dev.java.net