[vtkusers] PolyData actor is invisible after applying scale(1, 1, -1)

Bill Lorensen bill.lorensen at gmail.com
Mon Sep 3 12:24:33 EDT 2012


What are you trying to achieve?

On Mon, Sep 3, 2012 at 10:49 AM, Jothybasu Selvaraj <jothybasu at gmail.com>wrote:

> Few points here
>
>  You are setting a -ve scaling (1,1,-1). I am not sure whether scaling in
> -ve has any meaning. To shrink it will be <1 and >1 to expand. (I am not
> familiar with matrix operations, excuse if its wrong)
>
>
> With few typographical error corrections they appear in the color I set
> (yellow)
>
> //...................
>     vtkCubeSource *cubeSource = vtkCubeSource::New();
>
>     cubeSource->SetCenter(5,5,5);
>     cubeSource->SetXLength(10);
>     cubeSource->SetYLength(10);
>     cubeSource->SetZLength(10);
>
>     vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
>     mapper->SetInput(cubeSource->GetOutput());
>     *mapper->ScalarVisibilityOff();*
>
>     vtkActor* cubeActor = vtkActor::New();
>     cubeActor->SetMapper(mapper);
>  *   cubeActor->GetProperty()->SetColor(1,1,0);*
>
>     this->modelRenderer->AddActor(cubeActor);
>     vtkTransform *transform = vtkTransform::New();
>    * transform->Scale(1,1,0.5);*
>
> //    cubeActor->GetProperty()->BackfaceCullingOff();
>
>     cubeActor->SetUserTransform(transform);
>
>
> Regards
> Jothy
>
>
>
>
>
> On Mon, Sep 3, 2012 at 3:17 PM, zlf <jxdw_zlf at yahoo.com.cn> wrote:
> >
> > Dear David,
> >
> > Thank you for your response. But I still cannot see anything. My code is
> >
> > vtkCubeSource cubeSource = vtkCubeSource->New();
> > cubeSource->SetCenter(5,5,5);
> > cubeSource->SetXLength(10);
> > cubeSource->SetYLength(10);
> > cubeSource->SetZLength(10);
> >
> > vtkPolyDataMapper mapper = vtkPolyDataMapper::New();
> > mapper->SetInput(cubeSource->GetOutput());
> >
> > vtkActor cubeActor = vtkActor::New();
> > cubeActor->SetMapper(mapper);
> >
> > render->AddActor(cubeActor);
> >
> > vtkTransform transform = vtkTransform::New();
> > transform->Scale(1,1,-1);
> > cubeActor->GetProertry()->BackfaceCullingOff();
> > cubeAcotr->SetUserTransform(transform);
> >
> > renderer->ResetCameraClippingRange();
> > renderer->ResetCamera();
> > renwin->Render();
> >
> > Regards,
> >
> > zlf
> >
> >
> >
> > --
> > View this message in context:
> http://vtk.1045678.n5.nabble.com/PolyData-actor-is-invisible-after-applying-scale-1-1-1-tp5715785p5715801.html
> > Sent from the VTK - Users mailing list archive at Nabble.com.
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>
> --
> Jothybasu Selvaraj
> PhD Student
> University of Liverpool
> UK
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120903/7455b05b/attachment.htm>


More information about the vtkusers mailing list