vtk – show bounding box by lines and surfaces
The post shows how to display bounding box of 3D model by lines and surfaces. Surfaces: . Lines: . Complete code:
The post shows how to display bounding box of 3D model by lines and surfaces. Surfaces: . Lines: . Complete code:
We can use vtkParametricTorus to construct a curved 3D arrow. However, during this process, the opening needs to be closed, and the boundary should be preprocessed: merge nearby points, remove duplicate points, and triangulate. RotationArrow.h RotationArrow.cpp Some interfaces of BasicMethod can be found on the websize.
Temporarily disable multiple threads for VTK, then resume them later. Code example:
Here are two methods used to sample points on a model (surface mesh or 3D polydata). Filter connected points Use BFS (Breadth First Search) algorithm to get connected points in polyData. Iterate through all the points in jumps to achieve the purpose of sampling. Sampling points by spatial distance Calculate Read more…
Oringial scene: The right polyData has shallowCopyed the left one. If A had ShallowCopyed B in VTK project, A and B were both vtkPolyData objects, let’s change A’s point or change its pointData scalar, B’s point and scalar will also be changed. If we use `rightPolydata->GetPointData()->SetScalars( scalars1 );` to change Read more…
I added two renderers in renderWindow, and set a blue background for the top renderer. But the color is not visible, here is source code. We can find the description for the usage of the interface SetPreserveColorBuffer. Add the following code for renderer2. We can see the blue background of the Read more…
If you have used vtkImageActor or vtkImageMapper + vtkActor2D to display an image in VTK renderer window, you can change the value of ColorLevel of vtkImageMapper to adjust the exposure to get a better effect. As the ColorLevel value increases, the exposure decreases while the ColorWindow value remains constant.
Here is a simple example about make vtkImageActor always face current active camera and keep it under a vtkFollower object. It’s impossible to send image data to vtkFollower directly, so we have to add the feature that adjust orientation of image actor automatically when rendering. To keep the lower status, Read more…