GetClosestNormal
#1
Hey there

I am not good with code, so I might be wrong

but somehow GetClosestNormal is working and not working......working in the sense, that I am getting the correct normal vector, but the magnitude is coming out wrong, coz normal vectors are showing close to origin.

I am also attaching the file for checking normal vectors and magnitude


Please do check
Thank you
Nayan Bodawala


.max   GetClosestNormalIssue.max (Size: 700 KB / Downloads: 115)
  Reply
#2
Hi Nayan,

Normals are always unit vectors (length = 1). If you want to display them relative to their surface location, just add the position of the surface element (ex: vertex) to them.

So in your code, just change to:

Code:
DrawLine(pPos,pPos+Nrm,255,255,255);
  Reply
#3
Yeah, I did that to my file.......What was running in my head was that GetClosestNormal(point) will not only get the normal vector but will also offset to the point position from origin......

anyways thanks for the clarification
  Reply


Forum Jump: