# Ray Tracing In Processing is Possible!

**URL:** <https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483>\
**Category:** Processing\
**Created:** [January 30, 2021, 11:06am UTC](https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483 "2021-01-30T11:06:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![humayung](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/humayung/32/6089_2.png) [@humayung](https://discourse.processing.org/u/humayung)\
**Post date:** [January 30, 2021, 11:06am UTC](https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483/1 "2021-01-30T11:06:17Z")

</div>

I amazed of someone’s work: Ray Tracing In Console  
You can check his/her work on [youtube](https://youtu.be/QkETiyYWh2o)

The code is made in C++ so i try to port it into under processing environment and made some modifications.

Nb: Dont ask me how it works, simply, i dont know. Just sharing other person work tho.

**[Source Code is here!](https://gist.github.com/Humayung/3d28a713d6d9668cc5b06706c3abea47)**

 ![Screenshot from 2021-01-30 17-55-43](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2bd075d140aa6702e9626f9c6910cd0c73b5d017.png)

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [January 30, 2021, 1:29pm UTC](https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483/2 "2021-01-30T13:29:02Z")

</div>

Cool by the way you can use built in processing `constrain` function instead of clamp. Also did you know about Thomas Diewalds [pixelflow](https://github.com/diwi/PixelFlow) library, which has some stunning examples albeit using GLSL.

---

<div class="post-metadata">

**Author:** ![humayung](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/humayung/32/6089_2.png) [@humayung](https://discourse.processing.org/u/humayung)\
**Post date:** [January 30, 2021, 2:32pm UTC](https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483/3 "2021-01-30T14:32:12Z")

</div>

I knew, just forgot to adapt that part with the processing since previous code works with double and constrain works with float.

Pixelflow? hmm seem interesting to give it a try!

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [January 31, 2021, 7:59am UTC](https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483/4 "2021-01-31T07:59:08Z")

</div>

Previously people use Sunflow library for static raytracing [here’s](https://twitter.com/monkstoneT/status/1007966712447295488) something I created earlier with PiCrate (ruby-processing on for raspberrypi)

---

<div class="post-metadata">

**Author:** ![Quertz](https://avatars.discourse-cdn.com/v4/letter/q/cc9497/32.png) [@Quertz](https://discourse.processing.org/u/Quertz)\
**Post date:** [February 8, 2021, 7:34pm UTC](https://discourse.processing.org/t/ray-tracing-in-processing-is-possible/27483/5 "2021-02-08T19:34:54Z")

</div>

I wrote a Raytracer with Processing, too. Twice. Just to teach it better: [https://youtu.be/9NJ7sW\_3qt8](https://youtu.be/9NJ7sW_3qt8)
