Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Dec 2012
Offline Last Active Jun 18 2013 01:22 AM

Topics I've Started

Per triangle normals generating..

22 March 2013 - 05:20 PM

Hello there, i have small problem with normals for terrain generated from heightmap. I'm trying to generate normals for it, and its almost working, but i'm getting very strange result ( there are strange stripes everywhere ;f) : 




Code for generation normals :

glm::vec3 x6ngine::cHeightMap::computeNormal(glm::vec3 v0, glm::vec3 v1, glm::vec3 v2)
    return glm::normalize(glm::normalize(glm::cross(v2-v0,v1-v0)));

i dont know where's problem ;/ somewhere in opengl code?, or i'm just generating it wrong? Thanks for help. Regards x6itru.