Since the page on 3D graphics was very theoretical, this page is more casual and presents some ideas for applying simplified properties of light to graphics.

3Dグラフィックのページが非常に理論的だったので、このページではもっとカジュアルに光の性質を単純化して2Dグラフィックスに応用するアイデアをいくつか紹介します。

2D Shadow

2次元の影

This demo is a two-dimensional application of the ray-marching technique. You can check whether a location is in shadow by extending a line from that point to a light source and seeing if the line hits another object. Lighting in Flatland may look like this.

このデモはレイマーチングの手法を2次元に応用したものです。ある場所が影になっているかはその点から光源に向けて線を伸ばし、線が他の物体にぶつかるかどうかで調べることができます。フラットランドの照明はきっとこんなふうに見えるのではないでしょうか。

You can check whether a location is in shadow by extending a line from that point to a light source and seeing if the line hits another object.

You can check whether a location is in shadow by extending a line from that point to a light source and seeing if the line hits another object.

https://codepen.io/kynd/pen/ExezaYg

[A projection using 2D shadows. NEORT++ 2022](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3201a6f2-3f4c-4467-8fee-0e60877edf6d/m_2_1.mp4)

A projection using 2D shadows. NEORT++ 2022

Reflection

反射

This is the same demo seen on the Reflection and Refraction page, but without erasing the trails of the light.

これは反射と屈折のページで見たデモと同じものですが、光の軌跡を消さずに残すようにしました。