Will A Change B Which Was ShallowCopyed
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…
VTK – How to make top renderer background color visible?
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…
Change ColorLevel Of vtkImageMapper To Adjust The Exposure
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.
Make vtkImageActor Object Always Face Camera And Be Under vtkFollower Object
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…
Move ImageData To Make Center As Origin Point
We can find that vtkImageActor object will display image with controling its position with the bottom left corner of the image by the default way. Test project: Result: How to make the image’s center as actor’s position? Just as rewrite 3D model to make center as (0,0,0), related post: https://www.weiy.city/2022/01/rewrite-file-to-move-3d-model-to-origin-point/ Read more…
Remesh Model To Make Uneven Triangles More Uniform
The post shows a way to remesh a model to make uneven triangles on the mesh to be more uniform. The 3D model file locker.stl can be downloaded at the page:https://www.weiy.city/downloads/3d-model-simple-lock/ . Compare the original mesh and the new data in paraview:
Size Of VTK Render Window Will Not Match The External Canvas
I found an interesting issue about vtkSDL2OpenGLRenderWindow::SetSize when changed canvas for VTK WASM 3D window.The related post on the website is Change Canvas For VTK WASM Project. The interface SetSize can work if it was used before m_RenderWindowInteractor->SetRenderWindow( newWin );.It means the 3D window will become smaller or bigger than the outer shell. The red object Read more…
Pick Operation Of vtkPropPicker On vtkSDL2OpenGLRenderWindow Is Not Working
Environment:VTK Branch_v9.1.0emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.39 I tested two interfaces for pick operation of vtkPropPicker on web page. The result value is awalys 0. Invoking code: There are warning on browser log: Maybe that’s a bug of VTK For WebAssembly. All source code has been Read more…