GetNormals / GetFaceNormal simple Question


Good Evening,
I have several Questions regarding Rotation and Normals in 3ds Max. Any help would be appreciated :slight_smile:

(1) The first one would be when i try to disply my Normal direction through a Helper Object I dont understand why it gets Positioned where it gets Positioned. (GetNorm) is in this regards the same I excpect that the Normals at least if its the Vertex Normals will be aligend with the Normals shown through the Edit Normal Modifer (with a high size). I hope its somehow clear where i lack understanding.

point02 = (getFaceNormal myMesh 5)
p2 = point pos:point02

To clearify it a bit more

myFaces = polyop.getNumFaces myO

for fa = 1 to myFaces do
	fNormal = polyop.getFaceNormal myO fa node:true
	p3 = point pos:fNormal name:(fa as string)

this function with my Editable Poly creates enough Points, but positiones them all near the 0,0,0 Position in the World and in theory they should get created on my Testobject (i use a simple cube)

โ€“this one works as excpected

point01 = myRay.pos // ray object
p2 = point pos:point01


I kind of solved my Problen in using polyop.getFaceCenter for my script but still im kind of confused about what exactly happens with getFaceNormal


Normal is a vector. It has only direction. For your point helper if you get normal of a vertex, then use the vertex position, if you get normal of a face - use the polyop.getFaceCenter or polyop.getSafeFaceCenter to place the point helper properly.


:man_facepalming: Thanks year it makes sense


your code only requires a small change

myFaces = polyop.getNumFaces myO

for fa = 1 to myFaces do
	fCenter = polyop.getFaceCenter myO fa node:true
	fNormal = polyop.getFaceNormal myO fa node:true
	p3 = point dir:fNormal pos:fCenter name:(fa as string)


Itโ€™s excellent!
if we want to get the normals of the vertices you can give us an example?
thank you.


Thanks appreciate it. It makes totally sense to use the FaceCenter and Normal as direct :stuck_out_tongue:


Get vertex normal from Editable Poly here they talk about ur problem. I think this will help you

local sel = selection[1]
local vertFaces = polyOp.getFacesUsingVert sel (polyOp.getVertSelection sel as array)[1]
local tNormal = [0,0,0]; for i in vertFaces do tNormal += polyOp.getFaceNormal sel i
tNormal / vertFaces.numberSet  -- code by light August 2005