Sign in to follow this  

Gradient from a height map

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

This topic is 4109 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this