[vtkusers] scaling and glyphs in VTK
Doug Hoppes
dhoppes at mbfbioscience.com
Wed Jun 12 14:10:58 EDT 2013
Hi guys,
Okay... not sure where to look about this. So, I have a glyph3D that is using a vtkspheresource. I have the following code:
// Create a sphere to represent the data
vtkSmartPointer<vtkSphereSource> pSphereSource = vtkSmartPointer<vtkSphereSource>::New();
m_ pSphereSource ->SetThetaResolution(16);
m_ pSphereSource ->SetPhiResolution(16);
m_ pSphereSource ->SetRadius(1.0);
vtkSmartPointer<vtkGlyph3D> glyph3D = vtkSmartPointer<vtkGlyph3D>::New();
glyph3D->SetSource(m_pSphereSource->GetOutput());
// Get the points to show
glyph3D->SetInput(m_pCenterPoints->GetOutput());
glyph3D->SetScaleModeToDataScalingOff();
glyph3D->Update();
// Show the selection actor in the scene
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(glyph3D->GetOutputPort());
// Create the actor based on the selection definition
m_pSelectionActor = vtkSmartPointer<vtkActor>::New();
m_pSelectionActor->SetMapper(mapper);
mapper->ScalarVisibilityOff();
m_pSelectionActor->GetProperty()->SetColor(225, 225, 225);
What I found out is that, depending on what other actors I have in the scene, sometimes the glyphs are large and easily seen. Other times the glyphs are incredibly small. I would like to be able to have the sphere's one size all of the time (no matter what actors are in the scene). Any idea what I'm doing wrong?
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130612/70b12013/attachment.htm>
More information about the vtkusers
mailing list