I want to add an icon in the 3d world, and the position of it in the world is fixed, but the size of the icon is fixed too.
That is to say, when zooming the model, the icon is not zoomed. but when moving the model, the icon is moved.
Add, the icon is always facing the camera.
How to do it ? Wait your reply, Thank you.
If you want your icon to always be on top in the scene, then you can use
vtkPixelSpaceCallbackMapper and draw your icon on an SVG/div/whatever element on top of the vtk.js viewport. See the Spheres and Labels example for a demonstration of this.
If you want your icon to be physically in the scene (aka other objects may occlude the icon), then you will need to use an ImageMapper+Actor, then listen on
camera.onModified(callback), and update the orientation of your image based on the camera’s direction of projection, as well as the size of your icon on zoom.
If your icon will always be on top, I would first use
vtkPixelSpaceCallbackMapper, since that is much easier to do than listening to camera.onModified.
Thank you, I will use ’ vtkPixelSpaceCallbackMapper’ .