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

Jothybasu Selvaraj jothybasu at gmail.com
Mon Sep 3 10:49:02 EDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120903/67acf4bc/attachment.htm>


More information about the vtkusers mailing list