I want to find normals for height map data. I am using gl_triangles in my code for indices. How would I find normals for this?
相关问题
- Is GLFW designed to use without LWJGL (in java)?
- glDrawElements only draws half a quad
- Scaling png font down
- OpenGL buffer update [duplicate]
- How does gl_ClipVertex work relative to gl_ClipDis
相关文章
- Converting glm::lookat matrix to quaternion and ba
- Behavior of uniforms after glUseProgram() and spee
- Keep constant number of visible circles in 3D anim
- GLEW and Qt5 redefinition of headers
- How do I remove axis from a rotation matrix?
- how to calculate field of view of the camera from
- Assimp model loading library install/linking troub
- anyone can explain the “field of view”
Given a triangle
(vert1, vert2, vert3)
its normal is((vert2 - vert1).cross(vert3 - vert1)).normalize()
.For smooth, per-vertex normals: Foreach vertex, sum together the face normals for each triangle that vertex is a part of, then normalize the sum.
EDIT: Example: