다니엘 쉬프만(Dan Shiffman)의 원본 Processing 예제를 기반으로 한 연기 입자 시스템 데모입니다.
이 코드는 p5.Vector 클래스를 활용하며, 이는 createVector() 함수를 포함합니다. 입자의 위치와 속도를 업데이트하는 다양한 계산은 p5.Vector 메서드를 사용하여 수행됩니다.
입자 시스템은 클래스로 구현되어 있으며, 이는 (Particle 클래스의) 객체 배열을 포함합니다.
연기 입자(Smoke Particles) by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.
관련 예제
![](/_astro/15_Math_And_Physics-00_Non_Orthogonal_Reflection-thumbnail.DeYbXLbr_Z2sprbi.webp)
No alt text
비직각 반사
경사진 표면에서 튕기는 공을 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-01_Soft_Body-thumbnail.CaUlsLEf_Z2t2M4j.webp)
No alt text
소프트 바디(Soft Body)
마우스 방향으로 가속되는 부드러운 물체의 물리학을 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-02_Forces-thumbnail.76GklzEL_HHQbe.webp)
No alt text
힘
여러 물체가 유체를 통과하면서 작용하는 힘을 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-03_Smoke_Particle_System-thumbnail.DKQ430DH_2kCjh8.webp)
No alt text
연기 입자(Smoke Particles)
입자 시스템(particle system)을 활용하여 연기를 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-04_Game_Of_Life-thumbnail.5UrIGGfY_1qP5lX.webp)
No alt text
라이프 게임(Game of Life)
존 콘웨이(John Conway)의 세포 자동자(cellular automation)를 재현합니다.
![](/_astro/15_Math_And_Physics-05_Mandelbrot-thumbnail.DrMp2tOi_Z2016jT.webp)
No alt text
망델브로 집합(Mandelbrot Set)
프랙탈 구조를 생성하는 수학적인 집합을 시각화합니다.