Skip to main content
gamedev.net
🔒 Locked

question about bumpwaves sample

Started by Liker May 13, 2004 at 1:04 PM 0 replies 600+ views
Original Post
Liker
Liker
everyone reading that code must meet the following formula: // tu = (0.8x + 0.5z) / z // tv = (0.8y - 0.5z) / z the only thing puzzling me is the float number 0.8. I guess that the number is used to scale the texture coordinate to get a synchronization between the inverted image and the real landscape. but how could I calculate to get the number 0.8? anyone help me?
Muhammad Haggag
Muhammad Haggag
quote:
Original post by Liker
everyone reading that code must meet the following formula:
// tu = (0.8x + 0.5z) / z
// tv = (0.8y - 0.5z) / z
the only thing puzzling me is the float number 0.8. I guess that the number is used to scale the texture coordinate to get a synchronization between the inverted image and the real landscape. but how could I calculate to get the number 0.8? anyone help me?

Well, what are the ranges of x,y, and z? (The sample renders a 2D quad, right? So these values are known).

I''ve not looked closely, but they can easily be "fudge" factors determined by trial and error. (i.e. not calculated)

Muhammad Haggag,
Optimize
Bitwise account: MHaggag -

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.