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,[email protected]写道:
>
> 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

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/8e9ea16a-21d3-458e-a894-14204d64c3fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to