• Advertisement
Sign in to follow this  

Normal for bump mapping

This topic is 2772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


Hi,

I was looking at a nice tutorial on how to perform simple 2D bump mapping.
http://www.gamedev.net/reference/articles/article327.asp

There is just one little thing I don't get:

------------------
If we know X and Y of normal, we can calculate it's Z
(as normals are unit vectors. So Z is simply 1-sqrt(X^2 + Y^2) ).
------------------

If I do the maths, as the normal is a vector unit then:

1 = sqrt(x^2 + y^2 + z^2)
1 = x^2 + y^2 + z^2
1 - x^2 - y^2 = z^2
z = sqrt(1 - (x^2 + y^2))

Which is not the same formula as in the tutorial...
Could anyone tell me where the problem is?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement