readme

来自「opengl program draw forest」· 代码 · 共 28 行

TXT
28
字号
Dan Alcantara

Not exactly the cleanest code, but it works :P  Tried using the
auto-indenter program but decided halfway that my code looked
uglier than before...

Run by using 'forest.exe num_iterations'

I suggest 9 for the number of iterations: "forest.exe 9".

Anyway, technical details:
- Randomized the plant creation to create different looking trees
- Rotated and skewed leaves to make it look like the leaves weren't
  always facing us.
- Used color interpolation on practically everything, from the
  leaves and branches to the trunks and grass.
- Created a Bezier function to create smooth hills, rocks, leaves,
  flowers, and grass.
- Two different types of trees are drawn, one similar to a maple tree
  and the other some sort of flowering tree.
  
- Trees are drawn from the front to back.  To create a 3d effect, 
  the ones in the back are drawn much smaller and raised a bit from
  where the trees in front are drawn.  Anything drawn in the background
  is made darker.
- To accomodate the fact that things get darker, I turned it into
  a landscape at "sunset".

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?