Hi,

I've been having a strange problem utilizing:

com.sun.j3d.utils.geometry.Box
com.sun.j3d.utils.image.TextureLoader
javax.media.j3d.OrientedShape3D

I'm trying to make a billboarded texture map image in the scene.
I utilize the Box object and have the TexureLoader load a texture map
onto it.

Then I obtain the proper Geometry object to generate and OrientedShape3D.
Unfortunately, unless I refresh the scene, I get a white square.

I use the runtime options:
java -Xmx160000000 -ms128000000 -Dj3d.3ddevice=hardware -Dj3d.sharedctx=false


----------------------------------------------------------------------------
START CODE SNIPPET
----------------------------------------------------------------------------


        symbolFilename = new String( "~/space/images/convert.gif") ;

        TextureLoader symboltexture = new TextureLoader( symbolFilename,
                                                         parentCanvas );

        symbolApp.setTexture(symboltexture.getTexture());
        TransparencyAttributes symbolTranspAtt = new TransparencyAttributes();
        symbolTranspAtt.setTransparency( 1 );
        symbolTranspAtt.setTransparencyMode( TransparencyAttributes.FASTEST );
        symbolApp.setTransparencyAttributes( symbolTranspAtt );
        symbolSize = new Float( 1.0f );

        // create the geometry for the Symbol (Box)
        boxObj = new Box( 1.0f,
                          1.0f,
                          0.0f,
                          Box.GENERATE_TEXTURE_COORDS |
                          Box.GENERATE_NORMALS,
                          symbolApp );

        shape3d = boxObj.getShape(Box.FRONT) ;
        geometry = shape3d.getGeometry() ;
        oShape3d = new OrientedShape3D ( geometry,
                                         boxObj.getAppearance(),
                                         OrientedShape3D.ROTATE_ABOUT_POINT,
                                         new Point3f(0.0f,0.0f,0.0f)) ;

        oShape3d.setCapability(oShape3d.ALLOW_APPEARANCE_READ |
                               oShape3d.ALLOW_APPEARANCE_WRITE) ;
        oShape3d.setCapability(oShape3d.ALLOW_GEOMETRY_READ |
                               oShape3d.ALLOW_GEOMETRY_WRITE) ;
        oShape3d.setCapability(oShape3d.ALLOW_POINT_READ |
                               oShape3d.ALLOW_POINT_WRITE) ;

        symbolTG.addChild(oShape3d) ;

----------------------------------------------------------------------------
END CODE SNIPPET
----------------------------------------------------------------------------

Thanks,

Jay

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to