Single sided faces

I am modeling the inside of a room and want the walls to be transparent when viewed from the back & solid when viewed from the front. I have derived a class from AIS_Shape which allows me to set different attributes for each face. Setting the back face color to black verifies that front and back faces are rendering separately. However, transparency settings have no effect on the rendering - both front and back faces display solid no matter what transparency setting is used. Anyone have any idea what I am doing wrong? The Compute() part of my class is appended below.

Thanks for the help,



void AIS_Room::Compute(...)
case 1: // shaded
// set common face attributes
myDrawer->ShadingAspect()->SetMaterial(Graphic3d_NOM_PLASTIC, Aspect_TOFM_FRONT_SIDE);
myDrawer->ShadingAspect()->SetMaterial(Graphic3d_NOM_PLASTIC, Aspect_TOFM_BACK_SIDE);
myDrawer->ShadingAspect()->SetColor(Quantity_NOC_BLACK, Aspect_TOFM_BACK_SIDE);
myDrawer->ShadingAspect()->SetTransparency(0.0, Aspect_TOFM_FRONT_SIDE);
myDrawer->ShadingAspect()->SetTransparency(1.0, Aspect_TOFM_BACK_SIDE);

TopExp_Explorer Ex;
int i=0;
// for each face
for (Ex.Init(Shape(),TopAbs_FACE); Ex.More(); Ex.Next())
// set face front color
myDrawer->ShadingAspect()->SetColor( GetFaceColor(Ex.Current()), Aspect_TOFM_FRONT_SIDE);
// add to drawer
StdPrs_ShadedShape::Add(aPresentation,Ex.Current(), myDrawer);

case 0: // wire frame
AIS_Shape::Compute(aPresentationManager, aPresentation, aMode);

CloneX's picture

Figured it out - V3d_View::SetTransparency(Standard_True) does the trick.