Welcome, Guest

Author Topic: texture generating script  (Read 3616 times)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
texture generating script
« on: February 07, 2013, 03:31:45 PM »
you'll need python 2.7
http://www.python.org/download/releases/2.7.3/
PIL
http://www.pythonware.com/products/pil/ (most recent version)
noise module
http://www.lfd.uci.edu/~gohlke/pythonlibs/#noise
and the script
https://www.dropbox.com/s/rjgv2hcaswfrfh0/polygen.rar
just extract the folder somewhere but do not take stuff out of the folder. run 'runthis.py'.
« Last Edit: February 13, 2013, 09:40:07 PM by vh »

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
Re: texture generating script
« Reply #1 on: February 12, 2013, 06:07:03 PM »
Can you share an example of what this generates?

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: texture generating script
« Reply #2 on: February 12, 2013, 06:11:13 PM »
pics or virus

Just kidding but I'm curious of what it results in.

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: texture generating script
« Reply #3 on: February 12, 2013, 06:26:01 PM »
yeah sure but i warned you they're not exactly perfect yet...

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
Re: texture generating script
« Reply #4 on: February 12, 2013, 06:40:26 PM »
Looks early in development, but still quite cool.

Did anyone here see v1 of Universe Sandbox? It was quite early in development too. :)

How did you put the script together? Did you base it on some existing code?

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: texture generating script
« Reply #5 on: February 12, 2013, 06:44:44 PM »
well it uses a python image module, but besides that i wrote it from scratch. it's very simplistic actually: it selects a random point, then picks another random point nearby, and so on. then it draws a polygon by connecting all of the points. it draws three polygons (although they look like one large blob at this stage).

i've seen (and used) universe sandbox 1 before :)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: texture generating script
« Reply #6 on: February 13, 2013, 09:38:32 PM »
https://www.dropbox.com/s/rjgv2hcaswfrfh0/polygen.rar

i've updated it and it now uses simplex noise to generate continent-like shapes

you'll need to install http://www.lfd.uci.edu/~gohlke/pythonlibs/#noise (appropriate version of noise) but it's quite trivial just click the next button a few times

the edges don't quite match up yet though

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: texture generating script
« Reply #7 on: February 14, 2013, 04:50:00 PM »
updated. download link is the same as the on in op.

i used three dimensional noise and this solves the problem of making the texture seamless as well as distortion near the poles

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: texture generating script
« Reply #8 on: February 14, 2013, 05:29:48 PM »
now make distance from blue affect the land color
(get redder towards the center, greener towards the blue)