For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Transparent textures

stigk's picture
Forums: 

Hi,

I am trying to show an object with both a texture and a transparency. However, the transparency setting is ignored. How can I set transparency in this case?

Sample code:

TopoDS_Face anObj=...
Handle(AIS_TexturedShape) AISObj = new AIS_TexturedShape(anObj);

AISObj->SetTextureFileName(texture);
AISObj->SetTextureMapOn();
AISObj->DisableTextureModulate();

AISObj->SetMaterial((Graphic3d_NameOfMaterial) material);
AISObj->SetDisplayMode(3);
Context->SetTransparency(AISObj,.3);
Context->Display(AISObj);

It works fine with a non-textured object, i.e. if I remove the first three AISObj-> lines. Can anybody guide me in the right direction?

Thanks,

Stigk