[vtkusers] Need help on drawing wireframe density plot

TzuYi Yu tyyu01 at mail.apol.com.tw
Fri Dec 28 19:59:07 EST 2001


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




More information about the vtkusers mailing list