Hi,
 
I have a mapping application that inits the scene graph with about 200 shape3d objects.  it then uses those objects to display images and geometries... so i do alot of swapping of images and geometries for my shape3d objects.
 
this code was working under java3d api beta1, but then ceased to work when the beta2 download came.  the geometries still swap fine, but the textures are very flaky.
 
it's kind of hard to explain but i'll get textures that load into my shape3d objects at random, when their not supposed to.  the code i use every time to swap my images is :
 
****************************************************************************************
 
private void swapImg(int res){
image = null;
texture = null;
appear = null;

appear = new Appearance();
appear.setTransparencyAttributes( new TransparencyAttributes(TransparencyAttributes.NONE, 0.1f));
appear.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_FILL ,PolygonAttributes.CULL_NONE,10.0f));

image = new ImageComponent2D( ImageComponent.FORMAT_RGB , MyImage[res] ,true, false );
texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGB,image.getWidth(), image.getHeight());

texture.setImage(0, image);
texture.setEnable(true);
texture.setMagFilter(Texture.NICEST);
appear.setTexture(texture);
this.setAppearance(appear);

}
****************************************************************************************
 
this function is called from a class that extends shape3d.
 
like i said, it was working perfectly in beta1.  why the funny behavior in beta2?  i'm recreating all the objects from the appearance up everytime because if i didn't,  i experienced frequent crashes.  
 
I can't call updateData from the ImageComponent object because my BufferedImages are various sizes.
 
thanks,
matt

Reply via email to