项目作者: LorranSutter

项目描述 :
Ray casting implementation using p5js
高级语言: JavaScript
项目地址: git://github.com/LorranSutter/RayCasting-p5.git
创建时间: 2020-05-03T22:58:35Z
项目社区:https://github.com/LorranSutter/RayCasting-p5

开源协议:

下载


Raycasting-p5

Ray casting with reflections implementation using p5js inspired by Daniel Shiffman




Preview

:runner: How to run

Just open index.html file in browser.

:bulb: What is Ray Casting?

Ray casting is a famous approach that aims to detect intersections between casted rays and surfaces. It is used to solve problems in Computer Graphics and Computational Geometry. An well known problem, named Ray Tracing), employs ray casting to generate images by tracing the light path in a scene. Also it is possible to provide more sophisticated images using physical phenomena such as reflection and refraction.

In this code, ray casting was implemented and extendend using simple reflection. As it is possible to see in the equation and image below, it aims to define the reflected ray (R) from the incident ray (I) through the normal of the surface (N).



formula\vec{N})



:book: Resources

:computer: Technologies

  • P5js - drawing library