User Tools

Site Tools


02_user_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
02_user_tutorials:qsm:to-growable [2026/03/20 16:39] – Tim02_user_tutorials:qsm:to-growable [2026/10/09 12:38] (current) – [Shoots] Tim
Line 1: Line 1:
 ====== Turning a QSM into a growable model ====== ====== Turning a QSM into a growable model ======
  
-In the following tutorial we will take a small QSM file, transform the existing cylinders into modules and add additional organs(Buds, Leaves) in order to simulate simple forgoing growth. This tutorial requires knowledge about the programming language RGG (see: [[02_user_tutorials:13_rgg:02_rgg-code-structure|RGG Code structure introduction]]) as well as basic XL-queries (see: [[tutorials:xl-queries-and-operators|XL queries and operators]]).+In the following tutorial we will take a small QSM file, transform the existing cylinders into modules and add additional organs(Buds, Leaves) in order to simulate simple forgoing growth. This tutorial requires knowledge about the programming language RGG (see: [[02_user_tutorials:13_rgg:02_rgg-code-structure|RGG Code structure introduction]]) as well as basic XL-queries (see: [[02_user_tutorials:15_rules:01_xl-queries-and-operators|XL queries and operators]]).
  
 For this tutorial we will use this very small QSM: {{ :02_user_tutorials:qsm:tiny_tree2.qsm |tiny_tree2.qsm}}.  For this tutorial we will use this very small QSM: {{ :02_user_tutorials:qsm:tiny_tree2.qsm |tiny_tree2.qsm}}. 
Line 20: Line 20:
 Yet there is an important addition here, that is different to normal L-System rule: we need to keep the local transformation that keeps the cylinders in place.   Yet there is an important addition here, that is different to normal L-System rule: we need to keep the local transformation that keeps the cylinders in place.  
  
-We can do this by applying an expression directly to the newly created shoot using '.()'. In this expression we set the transform value of the new object(represented by the $ sign) to the value of the old object.+We can do this by applying the ''%%<<<%%'' operator directly to the newly created shoot using '.()'. This Operator forwards all parameter from the original f to the new MyShoot(represented by the $ sign) element.   
 + 
 +But since all parameters include the shader we have to set the shader again afterwads. 
 <code> <code>
-f:F ==> MyShoot(f.length,f.diameter).($[transform]=f[transform]);+f:F ==> MyShoot.($<<f),setShader(EGA_6)););
 </code> </code>
 +
 +The other possible apporach would be to use the ''%%<<%%'' operator, this only forwards the transformation, but non of the other parameters:
 +<code>
 +f:F ==> MyShoot(f.length,f.diameter).($<<f);
 +</code>
 +
 +
  
  
Line 36: Line 45:
 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).($<<f);
 ] ]
 </code> </code>
02_user_tutorials/qsm/to-growable.1774024751.txt.gz · Last modified: (external edit)