Hi,
how would I find the normal of the nearest polygon? Some example code would be appreciated but any help would be great.
Thanks
Finding nearest polygon normal
I guess it doesn't really matter. You need to get access to its vertex/index buffers.
Use those to find the triangle [set of 3 vertices] that is nearest the point in question. Then you take the normals of those vertices and average them.
Doing this with a brute force search will be slow. You will probably want to use something similar to the octtree triangle selector. Whatever it is, you will need to be able to access the vertex data so you can find the normals.
Travis
Use those to find the triangle [set of 3 vertices] that is nearest the point in question. Then you take the normals of those vertices and average them.
Doing this with a brute force search will be slow. You will probably want to use something similar to the octtree triangle selector. Whatever it is, you will need to be able to access the vertex data so you can find the normals.
Travis
-
dhenton9000
- Posts: 395
- Joined: Fri Apr 08, 2005 8:46 pm