View Full Version : Normal in eye space
milankoko
08-18-2008, 01:26 PM
This will probably be a very easy question for you guys, but I can't figure out how to calculate value of normals in eye space. I thought I read somewhere its ModelViewInverseTranspose * Normal. Is this correct? I am trying to do the calculation in Vertex shader, so i'm not sure i'm getting the right results
babis
08-18-2008, 03:06 PM
Just multiply your normal by the gl_NormalMatrix (which is the submatrix of the transpose of the inverse modelview). This page explains it :
http://www.lighthouse3d.com/opengl/glsl/index.php?normalmatrix
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.