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 15:40] – [Shoots] Timtutorials:qsm:to-growable [2025/10/13 16:25] (current) – [Apical] Tim
Line 34: Line 34:
  
 public void update()[ public void update()[
- { +{ jumpAllAxis();
- jumpAllAxis(); + f:F ==> MyShoot(f.length,f.diameter).($[transform]=f[transform]);
- +
- f:F ==> MyShoot(f.length,f.diameter).($[transform]=f[transform]);+
 ] ]
 </code> </code>
 +
  
  
 ===== Adding buds ===== ===== Adding buds =====
 +
 +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.1760362859.txt.gz · Last modified: 2025/10/13 15:40 by Tim