Normal Vector

Good evening all,
i am producing a model by using Delaunay Mesh method. I can get the properties like (Normal vector, Vertex array, and Indeices) from it, and also i know my mouse coordination on the model (Pickpoint method), now i want to determine the normal vector for every click on the model, but i have got no idea how can i proceed, any suggestion can be a great help.


[b]The easiest way is to render your normal vectors into a separate buffer (using framebuffer objects and textures attached to it). This way you can directly read the normal from the second buffer. Of course, this comes with the additional cost of rendering to two buffers instead of just one.

I don’t know what kind of project you are working on but maybe this method can be inefficient or unavailable on the target hardware.[/b]

Never mind, I just figured out that this is not a rendering related question :smiley:
If you know the exact position on the triangle, you also know the barycentric coordinates so you can just interpolate the normals of the vertices of the triangle weighting them with the barycentric coordinates.

thx aqnuep for your reply. I should say, i just know the coordination of clicked point, actually the first step for me is to find on which triangle this clicked point lies. Any idea of how i can find the especial triangle for every click, or may be i should make a new triangle around the clicked point?

What is actually what you want to achieve. Is the app you are talking about some sort of mesh renderer with OpenGL and use gluUnproject to get the pick point?

well, actually i am using LabView, not OPenGl, and yes it is using pickpoint method, but i am not sure if LabView does the same as you said for using pick point method.

Okay, if it is completely not related to OpenGL then it means you need some kind of analytic method to determine the normal, however knowing how the actual pickpoint is performed is crucial to figure out a solution. Please give us more detail.

Here is exactly what LabView says about Pickpoint method
“Given an x and y coordinate, casts a ray through the 3D scene and returns the x, y, and z-coordinates of the first object the ray intersects.”

right now, i am determining if a point is on the triangle or somewhere out side the triangle. but i dont know how can i proceed the rest of it for when the point is on the triangle, and when it is outside.

thanks for your reply