[vtkusers] Mesh Opacity

max perlman smapersmaper at gmail.com
Wed May 22 02:20:00 EDT 2013


Dear VTKers,

I want to show a mesh(that i read from an obj file using vtkobjreader)
and when i reduce opacity, not to see the triangles from which it is
made.

How can i achieve this?

Part of the code:

 reader = vtkOBJReader.New();
 reader.SetFileName(filePath);
 reader.Update();


vtkPolyDataNormals boneNormals = new vtkPolyDataNormals();
boneNormals.SetInputConnection(reader.GetOutputPort());
boneNormals.SetFeatureAngle(60.0);

vtkPolyDataMapper mapper1 = vtkPolyDataMapper.New();
mapper1.SetInputConnection(boneNormals.GetOutputPort());

actor1 = vtkActor.New();
actor1.SetMapper(mapper1);

renderWindow = renderWindowControl1.RenderWindow;
vtkRenderer renderer = renderWindow.GetRenderers().GetFirstRenderer();
// set background color
renderer.SetBackground(0.5, 0.5, 0.5);

renderer.AddActor(actor1);

renderer.ResetCamera();
renderWindow.Render();



private void button8_Click(object sender, EventArgs e)
        {
            if (j > 0)
            {
                j -= 0.1;
                actor1.GetProperty().SetOpacity(j);
                renderWindow.Render();
            }
        }


Thank you,

Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130522/c61a354d/attachment.htm>


More information about the vtkusers mailing list