CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 05-14-2007, 09:07 PM   #1
threedian
New Member
portfolio
Ian
Milton Keynes, United Kingdom
 
Join Date: Feb 2006
Posts: 20
finding height width and depth of an editable poly

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
 
Old 05-15-2007, 12:11 PM   #2
Fabiomussarela
Frequenter
 
Fabiomussarela's Avatar
Fabio
São Paulo, Brazil
 
Join Date: Aug 2002
Posts: 132
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
__________________
__________________________________________
Keep on MAXing in the free world.

http://fabiomussa.blogspot.com/

 
Old 05-15-2007, 05:08 PM   #3
threedian
New Member
portfolio
Ian
Milton Keynes, United Kingdom
 
Join Date: Feb 2006
Posts: 20
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 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
 
Old 05-15-2007, 05:08 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:33 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.