vedo
vedo copied to clipboard
How to move object or rotate the object interactively ?
I want to rotate and translate an object interactively.
I figure it out. Just pressing button a. I have a second question how do we scale an object (i.e. similar to blender by pressing s and moving left or right).
you right-click and drag the mouse.
Dear Marco,
Is there anyway we can access the axis of the object and its orientation ?
I want to do thing similar to this post. However, I would like to define my own transformation matrix, button and much more. Therefore, is there anyway can I get the information about orientation and axis of the object ?
Sure you can access it by
myobj.transform
and
myobj.transform.matrix
To apply a trasformation to a specific object you can use
myobj.apply_transform(...)
Hey Marco,
Is there any way to make the line rotate or move together with the object (the purple one) when using mouse to move or rotate the object ?
Yes you can create an Assembly:
assem = myline + myobj
show(assem)
Did you manage to do it?
Since vedo is made on VTK, Can you create a python code to make this function ?
I am not good at coding yet and I believe you could help me to create something like this in vedo.
You can create a picture-in-picture rendering with any sort of 3d object or axes. This is a good example to start with https://github.com/marcomusy/vedo/blob/master/examples/other/inset.py https://github.com/marcomusy/vedo/tree/master/examples/other/icon.py https://github.com/marcomusy/vedo/tree/master/examples/volumetric/slicer1.py
thank you for your assistance. I have one question. When we apply the transformation, the mesh.vertices still have the ols data from the dataset. How do we get the new coordinate information after transformation ?.
*old
No, mesh.vertices
will hold the new coordinates after .apply_transform(T)
I think I combine the mesh and other mesh into assembly and when I apply transformation matrix. The mesh.vertices inside the assembly data still hold the old data.