tutorials:qsm:to-growable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:qsm:to-growable [2025/10/14 11:51] – [Lateral] Tim | tutorials:qsm:to-growable [2025/10/23 15:52] (current) – [Turning a QSM into a growable model] 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, | + | In the following tutorial we will take a small QSM file, transform the existing cylinders into modules and add additional organs(Buds, |
| + | For this tutorial we will use this very small QSM: {{ : | ||
| + | This dataset was originally measured with the fastrak stylus and is later translated into a QSM | ||
| ===== Shoots ===== | ===== Shoots ===== | ||
| Line 162: | Line 163: | ||
| | Imported tree | updated tree | 1. growth step | 2. growth step | | | Imported tree | updated tree | 1. growth step | 2. growth step | | ||
| - | ===== Adding | + | ===== Adding |
| + | As final organ for this tutorial we want to add leaves to our little tree. The leaves are represented by simple parallelograms, | ||
| + | <code java> | ||
| + | | ||
| + | </ | ||
| + | We assume that our Leaves have a fixed size, based on the proportions of the original tree. | ||
| + | Lets place two of them each at 1/4 and 3/4 length on our shoot, with one pair oriented to the left and right and one pair up and down: | ||
| + | |||
| + | <code java with_leaves.rgg> | ||
| + | import static de.grogra.qsm.utils.Library.*; | ||
| + | import static de.grogra.qsm.utils.Descriptors.*; | ||
| + | module MyShoot(super.length, | ||
| + | module MyBud(int order, float length) extends Sphere(0.002){{setShader(EGA_3); | ||
| + | module Leaf ==> M(0.001) Parallelogram(0.012, | ||
| + | public void update()[ | ||
| + | { | ||
| + | jumpAllAxis(); | ||
| + | } | ||
| + | | ||
| + | [ | ||
| + | | ||
| + | [ | ||
| + | RL(65)MyBud(f[BO]+1, | ||
| + | ] | ||
| + | [ | ||
| + | RL(-65)MyBud(f[BO]+1, | ||
| + | ] | ||
| + | ] | ||
| + | [ | ||
| + | M(-0.25*f.length) | ||
| + | [ | ||
| + | | ||
| + | ] | ||
| + | [ | ||
| + | | ||
| + | ] | ||
| + | ] | ||
| + | [ | ||
| + | M(-0.75*f.length)RH(90) | ||
| + | [ | ||
| + | | ||
| + | ] | ||
| + | [ | ||
| + | | ||
| + | ] | ||
| + | ] | ||
| + | | ||
| + | |||
| + | f:F ==> MyShoot(f.length, | ||
| + | ] | ||
| + | |||
| + | |||
| + | public void grow()[ | ||
| + | | ||
| + | [ | ||
| + | | ||
| + | [ | ||
| + | RL(65)MyBud(o+1, | ||
| + | ] | ||
| + | [ | ||
| + | RL(-65)MyBud(o+1, | ||
| + | ] | ||
| + | ] | ||
| + | [ | ||
| + | | ||
| + | [ | ||
| + | RL(80)Leaf() | ||
| + | ] | ||
| + | [ | ||
| + | RL(-80)Leaf() | ||
| + | ] | ||
| + | ] | ||
| + | [ | ||
| + | | ||
| + | [ | ||
| + | RL(80)Leaf() | ||
| + | ] | ||
| + | [ | ||
| + | RL(-80)Leaf() | ||
| + | ] | ||
| + | ] | ||
| + | MyBud(o, | ||
| + | ] | ||
| + | </ | ||
| + | |||
| + | | {{: | ||
| + | | Imported tree | updated tree | 1. growth step | 2. growth step | | ||
| + | |||
| + | |||
| + | ===== Outlook ===== | ||
| + | |||
| + | Possible next steps would be: | ||
| + | * To add an age to the leaves (so they die after a year or two) | ||
| + | * To add secondary growth to the shoots (so they stretch a bit over the years) | ||
| + | * To add image shades to the different organs | ||
| + | * To set up a light model and implements a simple photo synthesis model. | ||
| + | |||
tutorials/qsm/to-growable.1760435492.txt.gz · Last modified: 2025/10/14 11:51 by Tim
