[vtkusers] Filling empty circles
Satheesh Maheswaran
s.maheswaran at eastman.ucl.ac.uk
Tue Jul 2 08:47:48 EDT 2002
Hi All
I am trying to fill some circles using vtk, I use vtk with Java on a
Windows XP platform
I have a 3 D scene with lots of spheres. All spheres have a colour
property assigned to them. All of this works fine and I use vtkCutter
to slice my 3D scene and my problem is when the scene is sliced, I only
get the outer ring of my circle coloured as expected. I would like
colour the whole circle with the assigned colour of the sphere as in the
3D scene.
Does anyone know how I can go about doing this or point me to some
example in vtk.
Satheesh
Here is the code that does it
glyph.SetColorModeToColorByScalar();
glyph.SetScaleModeToDataScalingOff();
glyph.SetInput(data);
glyph.SetSource(sphere.GetOutput());
glyph.GetOutput().GetPointData().SetScalars(color);
plane = new vtkPlane();
plane.SetOrigin(105,1,105);
plane.SetNormal(0,0,1);
// ************************
cutEdges = new vtkCutter();
cutEdges.SetInput(glyph.GetOutput());
cutEdges.SetCutFunction(plane);
map.SetInput(glyph.GetOutput());
cells_actor.SetMapper(map);
clippedMapper.SetInput(cutEdges.GetOutput());
clippedActor.SetMapper(clippedMapper);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020702/03125685/attachment.htm>
More information about the vtkusers
mailing list