
Fri, 06/09/2006 - 12:21
Forums:
Does anyone have an idea how to display a shaded MeshVS?
I use the following code:
Handle_StlMesh_Mesh handle_stlMesh;
//...
//loading mesh from an stl file
Handle( MeshVS_Mesh ) aMesh = new MeshVS_Mesh();
Handle( XSDRAWSTLVRML_DataSource ) aDS = new XSDRAWSTLVRML_DataSource(handle_stlMesh);
aMesh->SetDataSource(aDS);
aMesh->GetDrawer()->SetBoolean(MeshVS_DA_DisplayNodes,Standard_False); //MeshVS_DrawerAttribute
aMesh->AddBuilder( new MeshVS_MeshPrsBuilder( aMesh.operator->() ), Standard_True );
But still can't make OC display the shaded mesh (only as a wireframe model).
Regards
Pawel
Wed, 01/21/2009 - 20:17
Handle( MeshVS_Mesh ) aMesh = new MeshVS_Mesh();
Handle( XSDRAWSTLVRML_DataSource ) aDS = new XSDRAWSTLVRML_DataSource(handle_stlMesh);
aMesh->SetDataSource(aDS);
aMesh->GetDrawer()->SetBoolean(MeshVS_DA_SmoothShading,Standard_False); //MeshVS_DrawerAttribute
aMesh->AddBuilder( new MeshVS_MeshPrsBuilder( aMesh.operator->() ), Standard_True );
------------------------------------------------------------------------------------
When I change MeshVS_DA_DisplayNodes to MeshVS_DA_SmoothShading, it can not still visualize the shaded mesh? Why?
Does anyone know how to set the attributes to show shaded mesh ???
Thanks a lot!
Wed, 01/21/2009 - 20:47
Have a look at:
http://www.opencascade.org/org/forum/thread_9793/