Backside of face

Hi All,

Is it possible to draw back side of the face in different color than the front side?

Greetings,
Adrian

Stephane Routelous's picture

Hi,

to set the AIS_InteractiveObject derived object with a different color than the front side, do the following :

Handle_AIS_InteractiveObject theObj = ...
Handle_AIS_InteractiveContext theContext = ...
theObj->Attributes()->ShadingAspect()->Aspect()->SetDistinguishOn();
theObj->Attributes()->ShadingAspect()->Aspect()->SetFrontMaterial(Graphic3d_NOM_GOLD);
theObj->Attributes()->ShadingAspect()->Aspect()->SetBackMaterial(Graphic3d_NOM_JADE);
theContext->Redisplay(theObj);

It *should* work.

Attribute() returns a Handle_AIS_Drawer
ShadingAspect() returns a Handle_Prs3d_ShadingAspect
Aspect() returns a Handle_Graphic3d_AspectFillArea3d

So, see the file Graphic3d_AspectFillArea3d.cdl to see what is available.

HTH

Stephane
http://www.exotk.org

a-helcman's picture

Stephane,

Thank you very much for information!

Best regards,
Adrian

a-helcman's picture

hi,

it is possible to set a different material for front/back side of the face. but is it possible to set a different color for both sides?

i use the next lines to mix material + color:

po_AIS_Shape->Attributes()->ShadingAspect()->Aspect()->SetDistinguishOn();
po_AIS_Shape->Attributes()->ShadingAspect()->Aspect()->SetFrontMaterial(eFrontMaterial);
po_AIS_Shape->Attributes()->ShadingAspect()->Aspect()->SetBackMaterial(eBackMaterial);
po_AIS_Context->SetColor (po_AIS_Shape, eColor, false);

problem is, that SetColor function influences both sides here!

best regards,
adrian

Stephane Routelous's picture

Hi Adrian,

I think you cannot mix materials and colors like that.
You have to set eColor to eFrontMaterial and/or to eBackMaterial.

Stephane

Jun WANG's picture

Anybody knows how to handle this issue ?????????