[vtkusers] Backface wireframe color not visible under Mac OS X

Arnaud BARRE arnaud.barre at gmail.com
Thu Aug 2 17:07:39 EDT 2012


I have a vtkPlaneSource (set with a 20x20 resolution to represent the
ground) set to a wireframe representation with a color for the front and
the back face as presented in code at the end of this mail. I have no
problem to see both colors under Windows 7 64-bit with VTK 5.6.1, but the
same code doesn't work under MacOS X 10.5 with VTK 5.6.1 and VTK 5.10.

Under Mac, if I enable the front face culling, then I can see the back face
color. If I use the surface representation, then there is no problem and I
can see both colors.

Do you know if this problem is related to Mac OS X or maybe only to the
10.5 version? I didn't find any post related to this problem.

Thank you very much.

// The following line contain the vtkPlaneSource
btk::VTKGroundSource* ground = btk::VTKGroundSource::New();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInput(ground->GetOutput());
vtkProperty* prop = vtkProperty::New();
prop->SetRepresentation(VTK_WIREFRAME);
prop->SetColor(0.8, 0.8, 0.8);
prop->SetAmbient(0.5);
prop->SetDiffuse(0.0);
prop->SetSpecular(0.0);
vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
actor->SetProperty(prop);
vtkProperty* propBackface = vtkProperty::New();
propBackface->DeepCopy(prop);
propBackface->SetColor(1.0, 0.0, 0.0);
actor->SetBackfaceProperty(propBackface);
renderer->AddViewProp(actor);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120802/eeadc895/attachment.htm>


More information about the vtkusers mailing list