1
votes

If i need to select some polygons perpendicular to a specific axis (say x, which is [1,0,0] I'm doing a dot product like that

axis = [1,0,0]  
normal = polyOp.getFaceNormal $ 1
result = dot normal axis

Where 1 is the face I need to check. If the dot product is 1, then my polygon is perpendicular. How do I check against a local axis? In other words, imagine the object is rotated and I need to select the faces perpendicular to its local z. How do I do that?

Edit: Even multiplying the node by the object with polyop.getFaceNormal $ 1 * $.rotation the result is exact the same.

LOcal rotation problem

1
After the edit, I officially have no idea what you want. That's what you were asking for in the first place, to get the local transform. What is the result you want to get, then, when it's not world transform nor local transform? - Swordslayer
I need the value of the local transform of the violet cube. And then I need to compare this value against the normal of each single face(always of the violet cube). - Muteking
That sounds like doing things the harder way, comparing the normal in world space to the world space transform (there's no local node transform to talk about unless the node is part of hierarchy - well, there is, but it's a unit matrix) is the same as getting the normal in local space in the first place... - Swordslayer
Have you tried multiplying by the first row of its transform instead? The first row of the matrix represents the x-axis of its transformation (at least in 3dsMax). - Klaudikus
Klaudikus that was exactly it. The local x axis of the transform is returned with the command $.transform.row1. Being $.transform.row2 the y and $.transform.row3 the z. - Muteking

1 Answers

1
votes

Don't query the node, query the Editable poly object itself:

polyOp.getFaceNormal $.baseObject 1