How does one update a texture once the texture already has been set.
For instance, say we have this:
Shape3d shape;
ImageComponent ic;
Texture2D texture;
BufferedImage bImage;
bImage = new BufferedImage(…);
bImage.createGraphics().drawString(“message”,0,0);
ic = new ImageComponent(…,bImage);
texture = new Texture2D(…);
texture.setImage(0,ic);
shape = magicShapeCreator(…); // say this function handles creating the shape with the right Appearance, normals, and texture coordinates
shape.setTexture(texture);
OK. so at this point the shape is added to the scene and displays the textuer properly.
Now what i want to do is to be able to update the texture.
I’ve tried so far to just update bImage ( but that doesn’t update whats being drawn on the screne).
(for instance bImage.createGraphics().drawString(a new message poped",0,100);
Any thoughts?