Skip to content

Is there any API like getCenter() in OpenGL which I can get the center Translation Matrix of Mesh 3d-model? #998

Answered by bottler
yougrianes asked this question in Q&A
Discussion options

You must be logged in to vote

You can get the axis-aligned bounding box of a mesh with .get_bounding_boxes() and take the mean (over the last dimension)? Is that what you mean by center? Or you could average all the vertices in a mesh?

You can rotate around the "center" by translating so the center goes to the origin, rotating, and undoing the translation. The code in transform3d.py can do these things.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by patricklabatut
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
how to How to use PyTorch3D in my project
2 participants
Converted from issue

This discussion was converted from issue #980 on December 14, 2021 23:07.