Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Non-wireframe good qualify rendering

Non-wireframe good qualify rendering
aka 2013/03/26 17:19
Good day to all. I'm trying to display the model through V3d_View, V3d_PerspectiveView, V3d_OrthographicView, etc.

I want to see a beautiful view, however, I see a skeleton (wireframe) model. I tried to apply SetShadingModel and SetDisplayMode, but all to no purpose. Please help.
aka 2013/03/28 13:25
That's what I'm doing:

graphic_device_=new Graphic3d_WNTGraphicDevice();

viewer_= new V3d_Viewer (graphic_device_, name.ToExtString (), "");
context_ = new AIS_InteractiveContext(viewer_);
view_=new V3dViewT( viewer_ );
view_->SetWindow(window_->parent_cascade_handle());
view_->      SetDegenerateModeOff();
view_->      SetAnimationModeOn();
view_->EnableGLLight();
view_->InitActiveLights();
view_->SetBackgroundColor(CastArgbToQuantity_Color(background));


view_->SetShadingModel(V3d_COLOR);
view_->SetLightOn();
InitShape();
view_->Zoom(width*2.0,height*2.0);

<...>

shape_=new AIS_TexturedShape(shape);
InitShape();



void CascadeScene::InitShape() {
UInteger ais_display_mode=AIS_ExactHLR;
if (!view_.IsNull()) {
view_->SetComputedMode(true);
view_->SetSurfaceDetail(V3d_TEX_ALL);
}
if (!shape().IsNull()) {
if (!context_.IsNull()) context_->SetDisplayMode(shape(),ais_display_mode,1);

shape()->SetMaterial(Graphic3d_NOM_STEEL);
get_textured_shape().SetTextureMapOn();
get_textured_shape().SetTextureScale(true, 1, 1);
get_textured_shape().SetTextureRepeat(true, 1, 1);
get_textured_shape().SetTextureOrigin(true, 0, 0);
get_textured_shape().SetDisplayMode(ais_display_mode);
SetTexturedFlag();
}
if (!view_.IsNull()) {
context_->SetColor(shape(), Quantity_NOC_WHITE,0);
context_->Display(shape());
view_->FitAll();
}
}


Can there be a problem in the types?


Hadndle_AIS_Shape shape_;
Handle(V3d_Viewer) viewer_;
Handle(V3d_PerspectiveView)view_;
Handle(WNT_GraphicDevice) graphic_device_;
Handle(AIS_InteractiveContext) context_;


Help me please!!!
aka 2013/03/29 15:07
http://www.opencascade.org/org/forum/thread_24605/?forum=5

be sure to call
context_->SetDisplayMode(shape(),ais_display_mode,one_if_need_immediate_update);
when shape_ changed!!!
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map