Is there a difference in average normal and normal or is it the same ?
does that normal correspondent with the direction the z axis is pointing at in the example (i am looking for that direction)?
i currently calculate my normals by using this method, but it doesn`t seem to be doing the trick
fn GetVertNormal obj vert =
(
vertFaces = polyOp.getFacesUsingVert obj vert
tNormal = [0,0,0]; for i in vertFaces do tNormal += polyOp.getFaceNormal obj i
tNormal / vertFaces.numberSet
print tNormal
return (tNormal)
)
The 'normal' of a vertex is simply the averaged normals of the surrounding faces. Get the verts connected faces, then use the polyop.getFaceNormal function for each and average to get the normal.
Maybe something like this:
vrtNum = (polyOp.getVertSelection $.baseObject) as array
vrtFacs = (polyop.getFacesUsingVert $ vrtNum) as array
vNormal = [0,0,0]
for vf in vrtFacs do (vNormal = (polyop.getFaceNormal $.baseObject vf) + vNormal)
tNormal = vNormal / vrtFacs.count
It could also help to know what your trying to do with this.
Replies
A vertex on its own has no inherent "rotation" as such...
does that normal correspondent with the direction the z axis is pointing at in the example (i am looking for that direction)?
i currently calculate my normals by using this method, but it doesn`t seem to be doing the trick
fn GetVertNormal obj vert =
(
vertFaces = polyOp.getFacesUsingVert obj vert
tNormal = [0,0,0]; for i in vertFaces do tNormal += polyOp.getFaceNormal obj i
tNormal / vertFaces.numberSet
print tNormal
return (tNormal)
)
Maybe something like this:
vrtNum = (polyOp.getVertSelection $.baseObject) as array
vrtFacs = (polyop.getFacesUsingVert $ vrtNum) as array
vNormal = [0,0,0]
for vf in vrtFacs do (vNormal = (polyop.getFaceNormal $.baseObject vf) + vNormal)
tNormal = vNormal / vrtFacs.count
It could also help to know what your trying to do with this.
i`m working on a wrapmode (lowpoly wrapping around highpoly) for a tool that i am making btw )