home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / toollib_2 / Examples / Tree / Tutorial < prev   
Text File  |  1995-12-06  |  5KB  |  168 lines

  1. !Tree Tutorial
  2. ~~~~~~~~~~~~~~
  3.  
  4. 0) Setting up
  5. ~~~~~~~~~~~~~
  6. Load the program and click on the tree which should appear on the icon bar.
  7.  
  8. Fill in these values to the tree parameter window:
  9.  
  10. Segments:            1
  11. Segment length:      10
  12. Branch scale:        1.00
  13. Branch scale scale:  1.00
  14. Left branch offset:  0.50
  15. Right branch offset: 0.50
  16. Branch angle:        40
  17. Angle scale:         1.00
  18. Depth:               2
  19.  
  20. Click on "Draw tree" and a window should open with a very simple tree in it.
  21.  
  22.  
  23. We can now explore what the various parameters do:
  24.  
  25. 1) Segments
  26. ~~~~~~~~~~~
  27. Change the segments value to 2 and then 3 (clicking on "Draw tree" each
  28. time).
  29.  
  30. You can see that a segment is a 'trunk' with two branches sticking out and
  31. that a tree (and also each branch) is made by stacking a number of segments
  32. together.
  33.  
  34. Leave segments set to 3 for the remaining sections.
  35.  
  36.  
  37. 2) Segment length
  38. ~~~~~~~~~~~~~~~~~
  39. Try altering the segment length parameter and clicking on "Draw Tree". You'll
  40. see that this simply controls the length of the 'trunk' in the tree. You can
  41. use it to alter the overall size of the tree.
  42.  
  43. Set segment length to 10 for the remaining sections.
  44.  
  45.  
  46. 3) Branch scale
  47. ~~~~~~~~~~~~~~~
  48.  
  49. Set branch scale to 0.7, 0.5, 0.3 and 0.1.
  50. You'll see that this parameter scales the branches of the tree. So if the
  51. segment length is 10mm and the branch scale is 0.5 then the segments in the
  52. branches will each be 5mm long.
  53.  
  54. If branch scale is greater than 1.00 then the branches will be longer than
  55. the main trunk. Try 1.5 to see what I mean.
  56.  
  57. Set branch scale to 1.00 for the remaining sections.
  58.  
  59.  
  60. 4) Branch scale scale
  61. ~~~~~~~~~~~~~~~~~~~~~
  62.  
  63. Yes, this parameter has an extremely un-intuitive name.
  64.  
  65. Try setting it to 0.8, 0.5 and 1.5.
  66.  
  67. You'll see that this parameter changes the way branches in different segments
  68. are scaled so, for example, your tree can be made to 'taper' towards the top.
  69.  
  70. The reason the parameter is called 'branch scale scale' is because it scales
  71. the 'branch scale' parameter as you progress along segments. For example, if
  72. branch scale is 1.0 and branch scale scale is 0.8 then the lowest set of
  73. branches will be the same length as the trunk, the nest set will be 0.8 times
  74. the length and the third set will be 0.64 (0.8 squared) times the length.
  75.  
  76. Set branch scale scale to 1.00 for the remaining sections.
  77.  
  78.  
  79. 5) Left and right branch offsets
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81.  
  82. Try altering left branch offset to 0, 0.25 and 1.
  83.  
  84. You'll see that these two parameters allow you to alter the position of the
  85. branches within a segment (e.g. should they be at the top or the bottom of
  86. the segment) and also to make the tree asymmetrical (by having different
  87. values for left and right offsets).
  88.  
  89. Values near 0 seems to give bush-like trees wheras values near 1 give more
  90. traditional-looking trees.
  91.  
  92. Set these parameters back to 0.5 for the remaining sections.
  93.  
  94.  
  95. 6) Branch angle
  96. ~~~~~~~~~~~~~~~
  97.  
  98. Try altering this to 10, 80 and 110
  99.  
  100. Fairly obviously, this changes the angle at which the branches sprout from
  101. the trunk.
  102.  
  103. Set this to 40 for the remaining sections.
  104.  
  105.  
  106. 7) Depth (yes, I know I've skipped Angle scale)
  107. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108.  
  109. Change segments to 1 and then try depths of 3,4,5 and 6.
  110.  
  111. You'll see that depth changes the number of branches that you must
  112. travel along to get from the trunk to a leaf.
  113.  
  114. A word of warning: If you have a large depth then the number of segments
  115. should be small and vice-versa. If they are both 'large' together the tree
  116. will be extremely complex and will either take a very long time to generate
  117. and draw or else the program will run out of memory and generate an error.
  118.  
  119. Set depth to 6 for the last section.
  120.  
  121.  
  122. 8) Angle scale
  123. ~~~~~~~~~~~~~~
  124.  
  125. Try changing this to 0.9, 0.8, 0.7, 0.6, 0.5, 1.1, 1.2 and 1.3
  126.  
  127. You'll see that the angle scale alters the angle of the branches as you
  128. proceed towards the leafs. Taking 0.5 as an example, the branches from the
  129. main trunk come out at 40 degrees (the value of branch angle). The next level
  130. of branches come from their branches at an angle of 0.5*40 = 20 degrees. The
  131. next level at 0.5*20 = 10 degrees and so on. This lets you get a basic tree
  132. shape but with whispy branches and plenty of space within the tree.
  133.  
  134.  
  135. 9) An example
  136. ~~~~~~~~~~~~~
  137. Here's an example tree:
  138.  
  139. Segments:            2
  140. Segment length:      12
  141. Branch scale:        1.00
  142. Branch scale scale:  0.80
  143. Left branch offset:  0.5
  144. Right branch offset: 0.5
  145. Branch angle:        30
  146. Angle scale:         0.94
  147. Depth:               6
  148.  
  149.  
  150. Try changing these parameters:
  151. Left branch offset:  0.8
  152. Right branch offset: 0.25
  153.  
  154.  
  155. 10) Things I might add
  156. ~~~~~~~~~~~~~~~~~~~~~~
  157.  
  158. I can possibly add other parameters if necessary. One possibility is a
  159. parameter that shrinks the segment size along a branch (the branches can be
  160. shrunk from segment to segment using branch scale scale but the segments
  161. themselves are all the same length). Another possibility is to allow different
  162. branch angle, branch scale etc. on the left and right.
  163. Also I haven't done anything much about colour yet.
  164.  
  165. I could add facilities for loading and saving the parameters.
  166.  
  167. I could add a facility for automatically scaling the tree to be a particular
  168. size but you can use segment length to do this manually.