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

Next revision
Previous revision
02_user_tutorials:qsm:to-growable [2026/03/20 16:35] – created - external edit 127.0.0.102_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: [[tutorials: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: {{ :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}}. 
 This dataset was originally measured with the fastrak stylus and is later translated into a QSM This dataset was originally measured with the fastrak stylus and is later translated into a QSM
 ===== Shoots ===== ===== Shoots =====
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>
Line 93: Line 102:
 This model applied on our small example tree should result in the following output: This model applied on our small example tree should result in the following output:
  
-| {{:tutorials:qsm:initial_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_step1_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_step2.png?direct&200|}} |+| {{:02_user_tutorials:qsm:initial_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_step1_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_step2.png?direct&200|}} |
 | Imported tree | updated tree | 1. growth step | 2. growth step |  | Imported tree | updated tree | 1. growth step | 2. growth step | 
 ==== Lateral ==== ==== Lateral ====
Line 160: Line 169:
  
  
-| {{:tutorials:qsm:initial_latb_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_latb_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_step1_latb_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_step2_latb_tiny_tree.png?direct&200|}} |+| {{:02_user_tutorials:qsm:initial_latb_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_latb_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_step1_latb_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_step2_latb_tiny_tree.png?direct&200|}} |
 | Imported tree | updated tree | 1. growth step | 2. growth step |  | Imported tree | updated tree | 1. growth step | 2. growth step | 
  
Line 250: Line 259:
 </code> </code>
  
-| {{:tutorials:qsm:initial_leaf_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_leaf_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_step1_leaf_tiny_tree.png?direct&200|}} | {{:tutorials:qsm:with_a_buds_step2_leaf_tiny_tree.png?direct&200|}} |+| {{:02_user_tutorials:qsm:initial_leaf_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_leaf_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_step1_leaf_tiny_tree.png?direct&200|}} | {{:02_user_tutorials:qsm:with_a_buds_step2_leaf_tiny_tree.png?direct&200|}} |
 | Imported tree | updated tree | 1. growth step | 2. growth step |  | Imported tree | updated tree | 1. growth step | 2. growth step | 
  
02_user_tutorials/qsm/to-growable.1774024505.txt.gz · Last modified: (external edit)