x


Tracking information across terrain

What would be the best method of tracking information across terrain? Say I want to track ambient temperature across the terrain where different segments of the terrain have different temperatures and over the course of the game temperatures can change so I don't believe I can use a heightmap as I think they are read-only though that would otherwise be a good solution. It would be helpful as well if the suggestion also incorperated ways for diffusion type effects could also be worked out where a overly hot area would slowly diffuse the heat over time.

Any way I can do this in javascript would be best though C# is fine as well.

Thank you

more ▼

asked Jun 17 '10 at 05:30 PM

Folcon gravatar image

Folcon
41 4 5 11

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The terrain heightmap isn't read-only; that's what you're manipulating when you use GetHeights and SetHeights. However since that's for the terrain height you can't use that for other info anyway. The thing to do would be to make a float[] array that stores the values for ambient temperature, and map that to the terrain. You can then go through the array periodically and perform some diffusion algorithm on it.

more ▼

answered Jun 17 '10 at 05:59 PM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

I tried using get/set height but I kept getting exceptions... I'll have to try again. I was hoping there was a better solution than just using arrays, but that makes the most sense, Thanks

Jun 17 '10 at 06:05 PM Folcon
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5056
x3443
x1466
x48
x36

asked: Jun 17 '10 at 05:30 PM

Seen: 763 times

Last Updated: Jun 17 '10 at 05:30 PM