Configure vtkActor’s properties to enable reflective effects on the model
Here are two ways to get the same effect: The string.stl used in the project can be downloaded at: https://pan.quark.cn/s/5537f0b7de11
Here are two ways to get the same effect: The string.stl used in the project can be downloaded at: https://pan.quark.cn/s/5537f0b7de11
. I used the old project which was introduced on the post What will happen if we pass wrong vtkRenderer object for vtkPicker::Pick? to explore variable Tolerance effect. Let’s make Tolerance to be 0.1 in the picking experiment. We can see the picking range become bigger, but the range can’t scale as we zoom in/out. Tolerance Read more…
. vtkCellPicker has the interface int vtkPicker::Pick(double selectionX, double selectionY, double selectionZ, vtkRenderer* renderer).In the some scenes, we can still pick the 3D actor even if pass wrong vtkRenderer object to the interface.Here is a simple example we can use to test it. We can pick the cone at some bad Read more…
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…