User Tools

Site Tools


tutorials:qsm:to-growable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:qsm:to-growable [2025/10/13 16:22] – [Adding buds] Timtutorials:qsm:to-growable [2025/10/13 16:25] (current) – [Apical] Tim
Line 43: Line 43:
 ===== Adding buds ===== ===== Adding buds =====
  
-Now as our first additional organ we consider a Bud to create an +In order to create new shoots we first need new buds, therefore the module "MyBud" is created: 
 +<code> 
 +module MyBud(int order, float length) extends Sphere(0.002){{setShader(EGA_3);}} 
 +</code> 
 ==== Apical ==== ==== Apical ====
 +<code java step2.rgg>
 +import static de.grogra.qsm.utils.Library.*;
 +import static de.grogra.qsm.utils.Descriptors.*;
 +module MyShoot(super.length, super.diameter) extends F{{setShader(EGA_6);}}
 +module MyBud(int order, float length) extends Sphere(0.002){{setShader(EGA_3);}}
 +public void update()[
 + {
 + jumpAllAxis();
 + }
 + f:F,(f[RTREND]==0) ==> MyShoot(f.length,f.diameter).($[transform]=f[transform])MyBud(f[BO],f.length*0.7);
 + f:F ==> MyShoot(f.length,f.diameter).($[transform]=f[transform]);
 +]
 +
 +
 +public void grow()[
 + MyBud(o,l),(o<2) ==> MyShoot(l,l/25) MyBud(o,l*0.7);
 +
 +]
  
 +</code>
 ==== Lateral ==== ==== Lateral ====
  
tutorials/qsm/to-growable.1760365375.txt.gz · Last modified: 2025/10/13 16:22 by Tim