<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"></head>
<body>
<!--SOHUMAIL_HTML_HEAD_END-->Hello all,<p><p>I have a trouble in the display of a model now.<p>The environment is MS Visual C++ 6.0.<p>And it is a MFC project(Doc-View).<p>The key codes are:<p><p>In the Doc:<p><p>        vtkRenderer *ren;<p>        vtkWin32OpenGLRenderWindow *renWin;<p>        vtkWin32RenderWindowInteractor *renWinInter;<p>        vtkCubeSource *cube;<p>        vtkPolyDataMapper *cubeMapper, *AxesMapper;<p>        vtkActor *cubeActor,*myAxesActor;<p>        vtkCubeAxesActor2D *axesActor;<p>        vtkAxes *myAxes;<p>        vtkCamera *myCamera;<p>        vtkLight *myLight1, *myLight2;<p>        BOOL m_bIsThreeDimension;<p><p>  then:<p><p>        m_bIsThreeDimension=TRUE;<p><p>        this->ren=vtkRenderer::New();<p>        this->renWin=vtkWin32OpenGLRenderWindow::New();<p>        this->renWinInter=vtkWin32RenderWindowInteractor::New();<p>        this->cube=vtkCubeSource::New();<p>        this->cubeActor=vtkActor::New();<p>        this->cubeMapper=vtkPolyDataMapper::New();<p>        this->axesActor=vtkCubeAxesActor2D::New();<p>        <p>        this->myAxes=vtkAxes::New();<p>        this->AxesMapper=vtkPolyDataMapper::New();<p>        this->myAxesActor=vtkActor::New();<p>        <p>        this->myCamera=vtkCamera::New();<p>        <p>        this->myLight1=vtkLight::New();<p>        this->myLight2=vtkLight::New();<p>        this->renWin->AddRenderer(this->ren);<p>        this->renWinInter->SetRenderWindow(this->renWin);<p>        this->cubeMapper->SetInput(this->cube->GetOutput());<p>        this->cubeActor->SetMapper(this->cubeMapper);<p>        this->cubeActor->GetProperty()->SetColor(0.9804,0.5020,0.4471);<p>        this->cubeActor->SetPosition(/*0.475,0.475,0.475*//*1,1,1*/0,0,0);<p>        this->ren->AddActor(this->cubeActor);<p>        this->AxesMapper->SetInput(this->myAxes->GetOutput());<p>        this->myAxesActor->SetMapper(this->AxesMapper);<p>        this->myAxesActor->GetProperty()->SetColor(1,0,0);<p>        this->myAxesActor->SetPosition(0,0,0);<p>        this->ren->AddActor(this->myAxesActor);<p>        <p>        this->myLight1->SetColor(1,1,1);<p>        this->myLight1->SetFocalPoint(0,0,0);<p>        this->myLight1->SetPosition(10,15,20);<p>        this->ren->AddLight(this->myLight1);<p>        this->myLight2->SetColor(1,1,1);<p>        this->myLight2->SetFocalPoint(0,0,0);<p>        this->myLight2->SetPosition(-10,-15,-20);<p>        this->ren->AddLight(this->myLight2);<p>        <p>        this->myCamera->SetViewUp(0,0,1);<p>        this->myCamera->SetFocalPoint(0,0,0);<p>        this->myCamera->SetPosition(10,15,10);<p>        this->ren->SetActiveCamera(this->myCamera);<p><p>View::OnCreate(LPCREATESTRUCT lpCreateStruct)<p>{<p>        this->GetDocument()->renWin->SetParentId(this->m_hWnd);<p>        this->GetDocument()->myCamera->SetViewUp(0,0,1);<p>        this->GetDocument()->myCamera->SetFocalPoint(0,0,0);<p>        this->GetDocument()->myCamera->SetPosition(10,15,10);<p>        this->GetDocument()->ren->SetActiveCamera(this->GetDocument()->myCamera);<p><p>        return 0;<p>}<p><p>View::OnDraw(CDC* pDC)<p>{<p>        if (this->GetDocument()->m_bIsThreeDimension)<p>        {        <p>                CRect rect;<p>                this->GetClientRect(&rect);<p>                this->GetDocument()->renWinInter->Initialize();<p>                this->GetDocument()->renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);<p>                this->GetDocument()->ren->ResetCamera();<p>                this->GetDocument()->renWin->Render();<p>        }<p>}<p><p>But after calling a function in the Doc to make  "m_bIsThreeDimension=FALSE" and "UpdateAllViews(NULL)", the model is still displaying and inter-actable.<p>My question is why the model is still displaying after leaping over the codes:<p>"<p>                CRect rect;<p>                this->GetClientRect(&rect);<p>                this->GetDocument()->renWinInter->Initialize();//绘制的重要函数<p>                this->GetDocument()->renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);<p>                this->GetDocument()->ren->ResetCamera();<p>                this->GetDocument()->renWin->Render();<p>"?<p>How can I make the model not display in the view under the condition of not deleting any object defined.<p><p><p>Thanks and regards<hr size=1><style type="text/css">
<!--
a {font-size:12px;color:black}
a:hover {font-size:12px;text-decoration:underline}
.b{font-family:Arial; font-size:80%; margin-bottom:2px;color:#0000CC}
.pp{font-family:Arial;font-size:10px}
-->
</style>
<table border=0>
<!--tr><td height=18><a href=http://goto.sohu.com/goto.php3?code=mailadt-ta1 target=_blank>搜狐小卫士——全新反垃圾系统</a>
<br>
</td></tr-->
<tr><td height=18><a href=http://goto.sohu.com/goto.php3?code=mailadt-ta target=_blank>搜狐VIP邮箱,尊贵一族的选择!</font></a>
</td></tr>
<br>
<tr><td height=18><a href=http://goto.sohu.com/goto.php3?code=mailadt-ta1 target=_blank>美女?帅哥?情歌?劲曲?</a>
</td></tr>
</table><!--SOHUMAIL_HTML_TAIL_END--></body>
</html>