이 예제는 반사를 위한 벡터 계산을 사용하여, 경사진 표면에서 튕기는 공을 시뮬레이션합니다.
이 코드는 새로운 벡터를 만들기 위해 createVector() 함수를 포함한 p5.Vector 클래스를 광범위하게 사용합니다. 또한, 벡터 계산을 위해 add()와 dot() 벡터 메서드를 사용합니다.
비직각 반사: Based on Processing example by Ira Greenberg. Ported by David Blitz. Revised by Darren Kessner. From 2024 onwards, edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
You can find the code history of these examples here: 2023 code. You can suggest improvements by contributing to the current website!
관련 예제

대체 텍스트 없음
비직각 반사
경사진 표면에서 튕기는 공을 시뮬레이션합니다.

대체 텍스트 없음
소프트 바디(Soft Body)
마우스 방향으로 가속되는 부드러운 물체의 물리학을 시뮬레이션합니다.

대체 텍스트 없음
힘
여러 물체가 유체를 통과하면서 작용하는 힘을 시뮬레이션합니다.

대체 텍스트 없음
연기 입자(Smoke Particles)
입자 시스템(particle system)을 활용하여 연기를 시뮬레이션합니다.

대체 텍스트 없음
라이프 게임(Game of Life)
존 콘웨이(John Conway)의 세포 자동자(cellular automation)를 재현합니다.

대체 텍스트 없음
망델브로 집합(Mandelbrot Set)
프랙탈 구조를 생성하는 수학적인 집합을 시각화합니다.