PDA

View Full Version : finding height width and depth of an editable poly


threedian
05-14-2007, 10:07 PM
hi all

im new to maxscript but starting to get the hang of it. One thing i can't find any information about, either in the maxscript reference or on the net, is how to get the height, width and depth of an editable poly

here's was my thoughts have been sofar after lots of reading and experiments - is it a case of going through the model's vertices and finding the one with the lowest x value, storing it, then finding the vertex with the highest x value and subtracting them?

the listener outputs -5 and 5 for the first and second vertices' x values which is obviously because its in local coordinate system so i multiply the -5 by -1?

im kinda halfway there but im not sure if im doin this the right way

any help would be appreciated :)

Fabiomussarela
05-15-2007, 01:11 PM
Hi brow :)

Max has already a solution for this.

Every node in max has a .min and .max property that returns a point3 coordinate.

Take a look at "Node transform properties" in the maxScript help.

See ya :)

threedian
05-15-2007, 06:08 PM
hi ball :)

thanks for the reply - I managed to get there in the end by cycling through all vertices and storing the xmin, xmax, ymax, ymin, zmax, zmin vertices and then finding the differences between all the min and max values, to find the width, height and depth.

This works fine now and outputs the same results as the Measure Utility (slightly more accurate too, as it returns floats and I haven't got it to round up or down yet)

But now I wish you'd replied just a liiiittle bit sooner :D lol oh well it was good practice

will definitely look into node transform properties when I get home tonight, sounds ideal - not sure how i missed that as I've read a large chunk of the maxscript reference - I was obviously looking for the wrong information

thanks again for the advice

CGTalk Moderation
05-15-2007, 06:08 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.