Hi Vincent,

and don't forget to wrap every change to the scenegraph with a 
beginEditCP and endEditCP. 

TextureChunkPtr textChunk = TextureChunkPtr::dcast(*i);
if(m_bTransparent)
{
    beginEditCP(textChunk);
        textChunk->setInternalFormat(GL_INTENSITY);
        textChunk->setExternalFormat(GL_LUMINANCE);
    endEditCP(textChunk);
}

Good luck

Matthias

On Thursday 17 February 2005 15:26, Andreas Zieringer wrote:
> Hi Vincent,
>
> the code is correct but doesn't work for SimpleTexturedMaterial as
> the TextureChunk is hold internal not in the chunks list of the base
> class. Creating a SimpleMaterial with a TextureChunk should work.
>
> Andreas
>
> > Hello Manfred,
> >
> > I have really problems with that... I didn't achieve to get the
> > TextureChunk. Well.... my Code is:
> >
> >    MFStateChunkPtr chunk = simpleTextureMaterial->getChunks();
> >        for(MFStateChunkPtr::const_iterator i = chunk.begin(); i !=
> > chunk.end(); i++)
> >        {
> >            if((*i)->getClassType()==TextureChunk::getClassType())
> >            {
> >                TextureChunkPtr textChunk =
> > TextureChunkPtr::dcast(*i); if(m_bTransparent)
> >                {
> >                    textChunk->setInternalFormat(GL_INTENSITY);
> >                    textChunk->setExternalFormat(GL_LUMINANCE);
> >                }
> >            }
> >        }
> >
> > Do I the right way ?
> >
> > Otherwise, I tried to give a TextureChunk to SimpleMaterial with
> > the given internal and external format, but I didn't get
> > transparent textures. I thing I'm doing something the wrong way. I
> > hope you can help me.
> >
> > Vincent
> >
> > Manfred Weiler wrote:
> >> Hello Vincent,
> >>
> >>> I'm sorry, I'm new with OpenSG. How should I get the TextureChunk
> >>> of my SimpleTexturedMaterial ? Do I the right way with a
> >>> SimpleTexturedMaterial ?
> >>
> >> SimpleTexturedMaterial is derived from ChunkMaterial and among
> >> other chunks it uses a TextureChunk for the texturing. You should
> >> be able to query for the TextureChunk using
> >> ChunkMaterial::getChunks and checking each chunk for the type
> >> TextureChunk::getClassType().
> >>
> >>     Manfred.
> >>
> >> ==================================================================
> >>==== Manfred Weiler             
> >> [EMAIL PROTECTED] Visualisierung und
> >> Interaktive Systeme          Telefon: 0711/7816-208 Universitaet
> >> Stuttgart, IfI                         FAX: 0711/7816-340
> >>
> >>
> >> -------------------------------------------------------
> >> SF email is sponsored by - The IT Product Guide
> >> Read honest & candid reviews on hundreds of IT Products from real
> >> users. Discover which products truly live up to the hype. Start
> >> reading now.
> >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >> _______________________________________________
> >> Opensg-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/opensg-users


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to