davidson16807 / tectonics.js

3d plate tectonics in your web browser
http://davidson16807.github.io/tectonics.js/
Creative Commons Attribution 4.0 International
200 stars 28 forks source link

Feature/heightmaps #22

Closed skepickle closed 6 years ago

skepickle commented 6 years ago

What's this Skepickle guy doing with your beautiful code?! Well, I'm interested in planet generation for my D&D(ish) sessions. I really like what you've done. I've been trying to take output from Tectonics.js and feed it to other tools that can help me generate pretty world maps, etc. One thing I really needed was a heightmap that renders white has high, and black as low. So I added two display options, Seafloor Heightmap and Sealevel Hightmap. I also noticed that if I turn the ocean off in most views, some of the deeper ocean parts are still filled with water, so there's a fix for that in here as well.

PS: I can't wait to tackle grid resolution next.

davidson16807 commented 6 years ago

If most heightmap renderers use black=low and white=high by convention, then let's just use this as a replacement for ScalarDisplays.alt. There's no particular reason I chose that color scheme.

We should also probably generalize ScalarDisplay rather than introduce a new Display class that's only used twice. I'm thinking add a "minColor" and "maxColor" to ScalarDisplay constructor options. Then use getField() to subtract out sealevel, depending on the value for sealevel_mod, so the user can switch between sealevel and seafloor using the "Ocean" toggle. This will probably require using sealevel_mod as a global variable or an attribute of the Model class. This is all something I can do tonight if you'd rather get started on grid resolution.

I could definitely use your help handling exports to other applications. Actually, there's a whole series of fun things you could do there, like export to video games. That's something I'd personally like to work on but I'm usually bogged down fixing issues with model behavior.

skepickle commented 6 years ago

Actually, what you said sounds good. Do you mind if i just redo this pullrequest? Since I'm already in that section of the code? I can cancel this request...

davidson16807 commented 6 years ago

go for it