Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial support for a stripe generator.

  • Loading branch information...
commit 9b8c1328be944a4b2ed940eab9801a951a3c4432 1 parent dcb100c
@olivierlefloch olivierlefloch authored
Showing with 14 additions and 2 deletions.
  1. +9 −2 MorphogenesisImageData.py
  2. +5 −0 PyFauxFur.py
View
11 MorphogenesisImageData.py
@@ -46,8 +46,7 @@ def __init__(self, width, height, D_s, D_a, D_b, beta_i):
self.width = width
self.height = height
- self.grid_a = 8 * random.rand(width, height)
- self.grid_b = 8 * random.rand(width, height)
+ self.generate('stripe')
self.texture_id = glGenTextures(1) # Generate 1 texture name
glBindTexture(GL_TEXTURE_2D, self.texture_id)
@@ -76,6 +75,14 @@ def __init__(self, width, height, D_s, D_a, D_b, beta_i):
self.fps = 0
self.last_time = 1
+ def generate(self, generator):
+ self.grid_a = 8 * random.rand(self.width, self.height)
+ self.grid_b = 8 * random.rand(self.width, self.height)
+
+ if generator == 'stripe':
+ self.grid_a = self.grid_a / 8
+ self.grid_a[self.width / 2, :] = 8
+
def make_texture(self):
'''
Calculates the colors for each point in the grid, and then copies this
View
5 PyFauxFur.py
@@ -56,6 +56,11 @@ def main(argv=None):
'-y', '--height', dest='height', type="int", default=400,
help="height of the generated texture [default: %default]", metavar='HEIGHT')
+ parser.add_option(
+ '-g', '--generator', dest='generator', type='string', default='random',
+ help='generator to use for the initial conditions [default: %default] (other possible values: stripe)',
+ metavar='NAME')
+
(options, args) = parser.parse_args()
if options.version:
Please sign in to comment.
Something went wrong with that request. Please try again.