[vtkusers] scaling and glyphs in VTK

Shawn Waldon swaldon at cs.unc.edu
Wed Jun 12 14:47:48 EDT 2013


Are you explicitly setting up a camera in your code?  The default camera
will zoom so that all actors in the scene are visible.


Shawn


On Wed, Jun 12, 2013 at 2:10 PM, Doug Hoppes <dhoppes at mbfbioscience.com>wrote:

>  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****
>
> ** **
>
> ** **
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130612/94dd5b90/attachment.htm>


More information about the vtkusers mailing list