Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to move object or rotate the object interactively ? #1094

Open
OhmPuchiss opened this issue Apr 12, 2024 · 14 comments
Open

How to move object or rotate the object interactively ? #1094

OhmPuchiss opened this issue Apr 12, 2024 · 14 comments

Comments

@OhmPuchiss
Copy link

I want to rotate and translate an object interactively.

@OhmPuchiss
Copy link
Author

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).

@marcomusy
Copy link
Owner

you right-click and drag the mouse.

@OhmPuchiss
Copy link
Author

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 ?
image

@marcomusy
Copy link
Owner

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(...)

@OhmPuchiss
Copy link
Author

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 ?
image
image

@marcomusy
Copy link
Owner

Yes you can create an Assembly:

assem = myline + myobj
show(assem)

@marcomusy
Copy link
Owner

Did you manage to do it?

@OhmPuchiss
Copy link
Author

Since vedo is made on VTK, Can you create a python code to make this function ?
image

@OhmPuchiss
Copy link
Author

I am not good at coding yet and I believe you could help me to create something like this in vedo.

@marcomusy
Copy link
Owner

@OhmPuchiss
Copy link
Author

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 ?.

@OhmPuchiss
Copy link
Author

*old

@marcomusy
Copy link
Owner

No, mesh.vertices will hold the new coordinates after .apply_transform(T)

@OhmPuchiss
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants