Teaching Aid

 
Lateral branches
 

Lateral branches

 

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/* You will learn:
– 3 variants on how to position lateral branches at another
place than at the end of an object
– the move command M
– the method Translate(x, y, z)
– the modules L() and Mrel, known as turtle commands
*/

module B;

protected void init()
[ Axiom ==> F(10); ]

public void lateralBranch()
[
f:F(x) ==> f

// variant 1: movement without drawing; back by negative number:
// M(-0.6*x)
[ M(-0.6*x) RU(-30) P(2) F(0.3*x) ]

// variant 2: use of Translate, back by negative number:
[ b:B Translate(0, 0, -x/2) RU(30) P(3) F(0.3*x) ]

// variant 3: relative position at the mother shoot, MRel(0.7),
// in relation to the turtle’s step length which is set by L(x).
[ L(x) MRel(0.7) RU(-30) P(4) F(0.2*x) ] ;
]

//**********************************************************
 

DATE: 2009

 

AUTHOR: W. Kurth

 

DESCRIPTION:  see model

 

Welcome to the website grogra.de. This site is the web centre of growth grammars of the Department Ecoinformatics, Biometrics and Forest Growth at the Georg-August University of Göttingen and its cooperation partners.

--- not found