Nader,

Check out the attachment "TextureSync.java" at the following link. It
includes a simple class called DrawingTexture that allows you to dynamically
update a texture. I think this may help you.

http://archives.java.sun.com/cgi-bin/wa?A2=ind0101&L=java3d-interest&P=R4614
8&m=19971

Raffi

-----Original Message-----
From: Nader Wasfy Zaki [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 27, 2001 7:55 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] changing textures on the fly problem


Hi,

I have read about animated textures and changing textures on the fly on
this list. However, I have tried the advice listed to no avail. The only
way I have found to update a texture is to clone it and assign the clone
to the appearance. I tried to implement a double buffer of textures so, i
would assign a different texture on each change but only be using two
textures, but that did not work.

In particular, I use the following to get access to the pixels to modify
them:

pixels =
((DataBufferInt)((ImageComponent2D)textureArrayCurrent[i][j].getImage(0))
                 .getImage().getRaster().getDataBuffer()).getBankData();


Again, the modification only works if i assign the appearance a clone of
the texture; in this case, i would clone textureArrayCurrent, after i have
modified its pixels.

nader

===========================================================================
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".

===========================================================================
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