Jump to content
  • Advertisement
Sign in to follow this  
Numsgil

Gradient from a height map

This topic is 4320 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

I'm working on an Ecosystem Game, specifically I'm modelling erosion and river formation at the moment. I have a heightmap that is determined and modified by the player. I need to determine a gradient from the heightmap to find the direction and strength of erosion and water flow. Basically I need a direction and a magnitude, ie: a vector.
A--B--C
|  |  |
D--E--F
|  |  |
G--H--I

From the above diagram, I'm trying to find the gradient vector at point E using the other points heights' as my only input. I'd like to weight A C G and I differently since they're further away. It's been a while since Calc 3, how do I do this?

Share this post


Link to post
Share on other sites
Advertisement
Yes, that's pretty much what I'm after.

What are the units that the gradient is expressed in from the Sobel operator?

For instance, this grid:


0-5-10
0-5-10
0-5-10



is going to produce a Gx of 40 isn't it? Should I then divide this by 4 to get the actual gradient along x or what?

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!