Hello,

I'm new with OpenSG.
I want to apply a texture on a plane and modify it in real time.

So I create a SimpleTexturedMaterial,and add a TextureChunk to it (addChunk) To
modify the RGBA image data(imageContentChange methode on the TextureChunk),but
the alpha component seems never be taken into account(from the initialisation to
the image changes,no transaparancy can be seen...):

extern SimpleTexturedMaterialPtr TX_Plan;
extern TextureChunkPtr TXChunk_Plan;
extern ImagePtr IX_Plan;

(...)


IX_Plan->set(Image::OSG_RGBA_PF,640,480,1, 1, 1, 0,tab_rgba);
                                 
beginEditCP(TXChunk_Plan);
        TXChunk_Plan->setImage(IX_Plan);
        TXChunk_Plan->setInternalFormat(Image::OSG_RGBA_PF);
        TXChunk_Plan->setExternalFormat(Image::OSG_RGBA_PF);
        TXChunk_Plan->setScale(false);
endEditCP(TXChunk_Plan);
                                
                                
                                
beginEditCP(TX_Plan);
       TX_Plan->addChunk(TXChunk_Plan);
endEditCP(TX_Plan);
                        

beginEditCP(Plan);
        Plan->setMaterial(TX_Plan);
endEditCP(Plan);

                        
(...)

//I modify the image data
beginEditCP(IX_Plan);   
         IX_Plan->setData(modified_RGBA_array);
      TXChunk_Plan->imageContentChanged(0,640,0,480);
endEditCP(IX_Plan);

Thank you in advance for your help!

olivier


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to