Particle System: Draw a tree from scratch, and the particle starts from scratch.

Source: Internet
Author: User

Particle System: Draw a tree from scratch, and the particle starts from scratch.

IDE: Visual Studio 2017

Language: VB. NET/C #

Graphics API: Win2D

Game Engine: ExperDot. EDGameEngine

This article will introduce you to a simple method for simulating plants with a particle System (Partical System.

Section 1 move

Particles move according to certain rules and keep moving tracks.

  Targeted Movement

The particle has an initial speed

  Particle gradient

The rendering radius of the particle gradually decreases, and the rendering color gradually decreases.

  Direction offset

The particle is always shifted to a certain direction.

  Random disturbance

Random force of particles on any side

Figure 1-1 targeted Movement

Figure 1-2 gradient

Figure 1-3 redirection

Figure 1-4 disturbance

Section 2 split

Existing particles are randomly split into several new particles.

  Direction offset

  When split, the new particle's velocity direction is deflected, and the moving track will generate forks.

  Particle deceleration

When split, the moving speed of new particles decreases, and the moving track becomes shorter and shorter.

Figure 2-1 forks

Figure 2-2 deceleration

Section 3 freedom

Now, you can adjust the parameters at will!

 

Figure 3-1 straight line

Figure 3-2 line chart

Figure 3-3 Curve

Appendix

Open source code. The following blog is another implementation method of the natural tree.

Open source link: EDGameEngine. Vitamins ALS. participant. Tree

Related blog: programming simulation (I): how to draw a static tree

Related blog: programming simulation nature (3): better static Tree Algorithm

Related blog: programming simulation nature (6): how to draw a dynamic tree

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.