Well, this does not explain this strange anomoly:

after changing the pixels, i set the texture of the appearance with the texture of 
whose pixels i have retrieved; this does NOT change the appearance texture though (as 
I have noticed and as you pointed out); however, if i clone the texture (after i have 
modified the pixels) and set the clone as the texture of the appearance, the textures 
do get updated; this seems contradictory to what is supposed to be happening.

Here is what I am doing:

// get the pixels
pixels = 
((DataBufferInt)((ImageComponent2D)textureArrayCurrent.getImage(0)).getImage().getRaster().getDataBuffer()).getBankData();

// modify the pixels
// blah code here

// clone the texture whose pixels i retrieved above
Texture2D texCopy = (Texture2D) textureArrayCurrent.cloneNodeComponent(true);

// set the texture of the appearance
appearance.setTexture(texCopy); // weirdly, this changes the texture

thanks for the previous quick reply but i am still a little confused,
nader

On Wed, 28 Mar 2001 12:11:55 -0800, Charmaine Lee <[EMAIL PROTECTED]> wrote:

>Nader,
>
>
>Nader,
>
>>
>> pixels =
>> ((DataBufferInt)((ImageComponent2D)textureArrayCurrent[i][j].getImage(0))
>>                  .getImage().getRaster().getDataBuffer()).getBankData();
>>
>        Pixel changes here will not be reflected to the texture.
>        Note, when you do ImageComponent2D.set(bufferedImage),
>        the bufferedImage data is copied into the ImageComponent2D object.
>        The subsequent changes to the bufferedImage object will not be
>        automatically reflected to the ImageComponent object and hence
>        not reflected to the texture.
>
>        What you can do is to double buffer the ImageComponent
>        object, modify the buffered image data, set the buffered image data
>        to the back ImageComponent object, and then set the texture
>        image to the back ImageComponent object.
>
>
>
>
>Charmaine Lee
>Java3D Engineering Team
>
>
> ==========================================================================
>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