[vtkusers] Re: Fw: point rendering

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Apr 5 09:52:52 EDT 2006


Jan Fransens wrote:
> Hi,
>  
> I am trying to render a point cloud of 3d coordinates with associated 
> normals. However, during rendering, points with a normal facing away are 
> rendered completely black. Points with front facing normals are rendered 
> fine.
>  
> pActor1->GetProperty()->SetPointSize(2.0);
> pActor1->GetProperty()->SetColor(1.0,1.0,1.0);
> pActor1->GetProperty()->SetRepresentationToPoints();   // |_rendering 
> behaviour doesn't change
> pActor1->SetBackfaceProperty(pActor1->GetProperty());// |
> 
> pRenWin->GetRenderer()->TwoSidedLightingOn(); // same result
> pRenWin->GetRenderer()->AddActor(pActor1);
> pRenWin->GetRenderer()->ResetCamera();
> pRenWin->show();
>  
> Does anyone know what causes this problem (I'm using Vtk 4.2)
>  
> Many thanks,
>  
> Jan

Hi Jan,

Your points are being shaded with the backfacing points getting no 
light... try:

pActor1->GetProperty()->SetDiffuse(0);
pActor1->GetProperty()->SetAmbient(1);

You wont need the BackfaceProperty to be set.

hth

Goodwin




More information about the vtkusers mailing list