Jump to content
  • Advertisement
Sign in to follow this  

Working on a maxscript program with a little problem.

This topic is 1820 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

    local v1 = polyop.getVert pick.Object verts[1]
    local v2 = polyop.getVert pick.Object verts[2]
   local proj = abs (v1.pos - v2.pos)

Here v2.pos reports an error. invalid property or something



Share this post

Link to post
Share on other sites

Looks like (going from this page: http://www.cgplusplus.com/online-reference/maxscript-reference/source/editable_poly_methods.htm ) it returns a position (which is a Point3 IIRC) already



polyOp.getVert <Poly poly> <int vertex> node:<node=unsupplied>

Returns the position of the specified vertex. If <poly> is a node, or if <poly> is an Editable Poly and <node> is specified, the position returned is in the current coordinate system context. If <poly> is an Editable Poly and <node> is not specified, the return value is in the poly's local coordinate system.


So you probably don't want to use v1.pos and v2.pos, just use v1 - v2.


And you probably want the length rather than abs (since v1 - v2 is a vector not a scalar)?

Edited by Paradigm Shifter

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!