You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using the vtki for texture mapping and I also want to use the vtk.camera object with vtki. I have some questions:
Is it possible to use vtki as regular vtk.polydata for texture mapping? I tried but it is showing a white board. My final goal is to capture the textured image from different camera position and focal length.
Is there a more convenient way to build relation between the vtk and vtki package? I try extract the data from vtki object but it seems difficult.
Here is my code for texture mapping and the change of the camera position:
Can you upload the stl and texture? This would help me in debugging why the texture isn't plotting.
As for the camera and plotting code, you can use vtki to streamline the plotting:
importvtkitexture=vtki.load_texture(img_path)
obj=vtki.read(stl_path)
obj.texture_map_to_plane(inplace=True)
# create a plotter object to handle visualizationplotter=vtki.Plotter()
plotter.add_mesh(obj)
# grab the camera objectcamera=plotter.camera# vtkRenderingOpenGL2Python.vtkOpenGLCamera object# your camera code followsplotter.show()
Hello, I am using the vtki for texture mapping and I also want to use the vtk.camera object with vtki. I have some questions:
Here is my code for texture mapping and the change of the camera position:
texture = vtki.load_texture(img_path)
obj = vtki.read(stl_path)
obj.texture_map_to_plane(inplace=True)
Mapper = vtk.vtkPolyDataMapper()
Mapper.SetInputData(obj)
Actor = vtk.vtkActor()
Actor.SetMapper(Mapper)
renderer = vtk.vtkRenderer()
renderer.AddActor(Actor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(renderer)
// The camera position code
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
renWin.Render()
iren.Start()
The text was updated successfully, but these errors were encountered: