Пример #1
0
def setup():
    """
    The processing setup statement
    """
    size(800, 600)
    global production
    production = grammar.repeat(17, AXIOM, RULES)
Пример #2
0
def setup():
    """
    The processing setup statement
    """
    size(500, 500)
    background(200, 200, 0)
    stroke(0, 100, 0)
    plant0 = grammar.repeat(4, AXIOM, RULES)
    plant1 = grammar.repeat(5, AXIOM, RULES)    
    plant2 = grammar.repeat(4, AXIOM, RULES)
    render(plant1)
    translate(-100, 10)
    render(plant0)
    translate(200, 0)
    render(plant2)  
    print grammar.toRuleString(AXIOM, RULES)
def setup():
    """
    Is the processing setup function
    """
    size(500, 500)
    background(0)
    stroke(255)
    production = grammar.repeat(7, AXIOM, RULES)
    translate(width * 0.9, height * 0.9)
    render(production)
def setup():
    """
    Is the processing setup function
    """
    size(500, 500)
    background(0)
    stroke(255)
    production = grammar.repeat(7, AXIOM, RULES)
    translate(width*0.9, height*0.9) 
    render(production)  
Пример #5
0
def setup():
    """
    The processing setup statement
    """
    size(600, 600)
    production = grammar.repeat(6, AXIOM, RULES)
    background(0, 0, 255)
    smooth()
    stroke(255, 255, 0)
    strokeWeight(3)
    render(production)
    saveFrame("mpeano.png")
Пример #6
0
def setup():
	"""
	Processing setup method
	"""
	size(600, 600, OPENGL)
	
	global arcball, grammar
	arcball = ArcBall(width/2.0, height/2.0, min(width - 20, height - 20) * 0.5)
	if grammar == None:
		from grammar import grammar
		global production    # Initialize production in setup, use in draw.
		production = grammar.repeat(3, AXIOM, RULES)
Пример #7
0
def setup():
    """
    The processing setup statement
    """
    size(700, 900, P2D)
    background(255)
    hint(ENABLE_NATIVE_FONTS)
    smooth()
    production = grammar.repeat(5, AXIOM, RULES)
    strokeWeight(2)
    #render(production) # now redundant could be used if pdf render not working?
    renderToPDF(production)
Пример #8
0
def setup():
    """
    The processing setup statement
    """
    size(600, 600)
    production = grammar.repeat(6, AXIOM, RULES)
    background(0, 0, 255)
    smooth()
    stroke(255, 255, 0)
    strokeWeight(3)
    render(production)    
    saveFrame("mpeano.png")
Пример #9
0
def setup():
    """
    The processing setup statement
    """
    size(600, 600)
    global grammar
    if grammar == None:
        from grammar import grammar
    production = grammar.repeat(7, AXIOM, RULES)
    background(100, 0, 0)
    smooth()
    strokeWeight(3)
    stroke(YELLOW)
    render(production)
Пример #10
0
def setup():
    """
    The processing setup statement
    """
    size(500, 500, P3D)
    cam = PeasyCam(this, 200)
    cam.setMinimumDistance(100)
    cam.setMaximumDistance(500)
    smooth(16)
    global production, depth, distance
    production = grammar.repeat(depth, AXIOM, RULES)
    distance *= 1 / (pow(2, depth) - 1)
    noStroke()
    fill(200, 0, 180)
Пример #11
0
def setup():
    """
    The processing setup statement
    """
    size(500, 500, P3D)
    cam = PeasyCam(this, 200)
    cam.setMinimumDistance(100)
    cam.setMaximumDistance(500)
    smooth(16)
    global production, depth, distance
    production = grammar.repeat(depth, AXIOM, RULES)
    distance *= 1/(pow(2, depth) - 1)
    noStroke()
    fill(200, 0, 180) 
Пример #12
0
def setup():
    """
    The processing setup statement
    """
    size(600, 600)
    global grammar
    if grammar == None:
        from grammar import grammar
    production = grammar.repeat(7, AXIOM, RULES) 
    background(100, 0, 0)
    smooth()
    strokeWeight(3)
    stroke(YELLOW)
    render(production)
Пример #13
0
def evaluateRules():
    global production, distance
    production = grammar.repeat(depth, AXIOM, RULES)
    if (depth > 0):
        distance *= 1 / (pow(2, depth) - 1)
def evaluateRules():
    global production,  distance
    production = grammar.repeat(depth, AXIOM, RULES)
    if (depth > 0) :
        distance *= 1/(pow(2, depth) - 1)