I’m wondering if there’s some way to get the center position of a set of specified faces, vertices or elements?
I know of one way to do it, which is to detach a duplicate of the selected faces, center the pivot, and then get it’s position. But it’s veeery slow. It would be awesome if I could somehow query the center position of specified components. Is this even possible to do with MaxScript?
[QUOTE=Swordslayer;28756]Get the face vertices, add their positions together, divide by the number of the vertices - that’s your centerpoint.[/QUOTE]
Swordslayer’s method will get you the average position of the vertices that constitute the faces in question. For the center of the bounds of these vertices (if that’s of interest to you), you’ll need to get the min position and the max position of the vertex set and then calculate the median position:
p3_minPosition + P3_maxPosition / 2 – The min and the max position values contain the minimum x, y and z values and the maximum x, y and z values of the vertex set respectively. That is to say, for example, that the min x value may come from a different vert than the min y value.