[vtkusers] Need help on drawing wireframe density plot

J.A. Lee jeff at cdnorthamerica.com
Sat Dec 29 11:24:27 EST 2001


It sounds like lighting. Try
wall->GetProperty()->SetAmbient(1.0);
wall->GetProperty()->SetDiffuse(0.0);
-Jeff

TzuYi Yu wrote:

>Dear All:
>
>  I use MFC 6.0 + VTK to read in the bluntfinxyz.bin & bluntfinq.bin,
>and I create one patch of density plot (wireframe) (like the following)
>
>                       reader->SetScalarFunctionNumber(100);
>                       sliceMapper3->ScalarVisibilityOn();
>                       wall->GetProperty()->SetRepresentationToWireframe();
>
>It creates the plot ok, but when I rotate the object (like flip around this
>object), the patch becomes complete dark -- since the background is black
>too, I can not see this patch at this rotation angle.  If I rotate it again,
>the
>color shows.  Look like it has two sides of colors -- one is regular (like
>blue),
>but the other is complete black.  Is this issue related to the light?  Or do
>I
>need to set any functions so that the same patch has the same color
>representation
>no matter how I rotate it?
>
>  I have the view routine like the following:
>
>void CSDIAppView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
>{
> CSDIAppDoc *pDoc;
> pDoc = GetDocument();
>
>    this->Renderer->GetProps()->RemoveAllItems(); //Clean up
>
> for (pDoc->i=pDoc->v.begin();pDoc->i!=pDoc->v.end();pDoc->i++)
> {
>        if ((*pDoc->i)->Show_or_Hide ==1)
>        {
>      (*pDoc->i)->wall->Update();
>      this->Renderer->AddActor((*pDoc->i)->wall);
>        }
>    }
>
>    if (Need_Reset_Camera)
>    {
>        Need_Reset_Camera = false;
>
>     this->Renderer->SetBackground(0,0,0);
>     this->Renderer->GetActiveCamera()->Zoom(1.4);
>     this->Renderer->GetActiveCamera()->SetFocalPoint(0,0,0);
>     this->Renderer->GetActiveCamera()->SetPosition(0,0,-1);
>     this->Renderer->GetActiveCamera()->SetViewUp(0,1,0);
>     this->Renderer->GetActiveCamera()->ComputeViewPlaneNormal();
>
>     this->Renderer->ResetCamera();
>    }
> this->vtkMFCRenderView::OnUpdate(pSender, lHint, pHint);
>}
>
>
>Thanks for all help.
>
>Robert
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>





More information about the vtkusers mailing list