finding plane normal to a vector

59 views
Skip to first unread message

s...@weacceptyou.com

unread,
Nov 8, 2016, 4:19:14 PM11/8/16
to Python Programming for Autodesk Maya
Hello,

i was wondering if there was a quick way of finding the equation of a plane normal to a vector in maya

say the vector is (3,5,1) and passing through point (2,4,5)

i was wondering if there was maybe a math command that could make this easier


thanks,
Sam

Robert White

unread,
Nov 8, 2016, 5:20:41 PM11/8/16
to Python Programming for Autodesk Maya, s...@weacceptyou.com
http://mathonline.wikidot.com/point-normal-form-of-a-plane

Should just need the normal and a point.

jonn

unread,
Nov 9, 2016, 11:51:52 PM11/9/16
to Python Programming for Autodesk Maya, s...@weacceptyou.com
def getLocalVecToWorldSpace(node, vec=om.MVector.kXaxisVector):
matrix = om.MGlobal.getSelectionListByName(node).getDagPath(0).inclusiveMatrix()
vec = (vec * matrix).normal()
return vec
def axisVectorColinearity(node, vec):
vec = om.MVector(vec)
x = getLocalVecToWorldSpace(node, vec=om.MVector.kXaxisVector)
y = getLocalVecToWorldSpace(node, vec=om.MVector.kYaxisVector)
z = getLocalVecToWorldSpace(node, vec=om.MVector.kZaxisVector)
#return the dot products
return {'x': vec*x, 'y':vec*y, 'z':vec*z}
jnt = cmds.joint()
print axisVectorColinearity(jnt, [0,0,1])

在 2016年11月9日星期三 UTC+8上午5:19:14,s...@weacceptyou.com写道:

sam williams

unread,
Nov 10, 2016, 4:39:42 AM11/10/16
to jonn, Python Programming for Autodesk Maya
cool thanks both for the help. this vector stuff is confusing

thanks,
Sam
Reply all
Reply to author
Forward
0 new messages