
Fri, 10/28/2022 - 18:56
Forums:
Hi gentlemen, I have a display in 3D view with ViewCube.
I do not understand why my ViewCube react to light activation/desactivation even with its ShadingModel is set to UNLIT.
I tried to
- redisplay it after light change
- modify its Aspect and material but I did not find any solution
I am certainly missing something or doing something wrong.
I would appreciate any advice !
Thanks.
Best regards.
Jerome.
Attachments:
Tue, 11/01/2022 - 07:55
How exactly you change shading aspects of ViewCube? As it is not unlit by default:
Mon, 11/07/2022 - 11:40
Hi gkv, sorry for my late answer.
I am using Attributes()->SetShadingModel( Graphic3d_TypeOfShadingModel::Graphic3d_TOSM_UNLIT ) after ViewCube creation.
My initial goal was to have the same view cube whatever are the view rendering method PBR/Phong and lights (like in CAD Assistant).
Best regards.
Jerome.
Thu, 11/10/2022 - 15:44
Hi gkv, I finally found the solution here below, if some people are interested in.
Best regards
Jerome.
// m_vc is handle to view cube created before
//-------------------------------------------
m_vc->SetTextColor( Quantity_NOC_BLACK );
m_vc->SetBoxColor( Quantity_NOC_WHITE );
m_vc->SetDrawEdges( true );
m_vc->BoxEdgeStyle()->Aspect()->SetShadingModel( Graphic3d_TypeOfShadingModel::Graphic3d_TOSM_UNLIT );
m_vc->BoxEdgeStyle()->SetColor( Quantity_NOC_GRAY60 );
m_vc->BoxCornerStyle()->Aspect()->SetShadingModel( Graphic3d_TypeOfShadingModel::Graphic3d_TOSM_UNLIT );
m_vc->BoxCornerStyle()->SetColor( Quantity_NOC_GRAY60 );
const opencascade::handle<Prs3d_Drawer> &drw( m_vc->Attributes() );
drw->SetShadingModel( Graphic3d_TypeOfShadingModel::Graphic3d_TOSM_UNLIT ); /// Define BoxSide shading model
drw->FaceBoundaryAspect()->Aspect()->SetColor( Quantity_NOC_BLACK );
drw->SetFaceBoundaryDraw( true );