Jump to content
  • Advertisement
Sign in to follow this  
gOOze

Normal for bump mapping

This topic is 2946 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
Yeah starting with
1 = (x^2 + y^2 + z^2)^0.5
I end up with
z = (1 - x^2 - y^2)^0.5

Perhaps the author you're quoting has made a mistake... This nvidia page also lists the solution as
Z = sqrt( 1 - X * X - Y * Y )

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!