Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Working on a maxscript program with a little problem.

This topic is 2184 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

Thanks

Jack

Share this post


Link to post
Share on other sites
Advertisement

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!