Notifications
Clear all

[Closed] Vertex Normals

I have a mesh with two smoothing groups. When I use the getNormal function on the verts along the hard edge the result is not normalized. If the same vertex is unifed, then the result is normalized. How is this value calculated? Is there anyway to get the actual normals of the vertex, in the case of a hard edge two or three normals? Anyone know how this works?

Stev

4 Replies

you can use normalize to normalize your normals.

ie
temp = [1,0,5]
temp2 = normalize temp

that what your after?

I’m tring to figure out how to get each normal individually on a hard edge. getNormal() returns one value if the vertex has three normals. I’d like to get all three normals instead of one.

get the vertex normal be getNormal(), eg :

sss= getNormal () –eg: [2,3,4]
theMatrix= matrixFromNormal (normalize sss)
–will get: theMatrix=(matrix3 [0.894427,0,-0.447214] [-0.249136,0.830455,-0.498273] [0.371391,0.557086,0.742781] [0,0,0])

then u get the 3 axis of the point . maybe right u need .
x_axis = theMatrix.row1
y_axis = theMatrix.row2
z_azis = thematrix.row3

each one will be a point3 value . are these value u need ?

I think that’s just what I need. Thanks!

Stev