# Doing Raytracer in Crystal

**URL:** <https://forum.crystal-lang.org/t/doing-raytracer-in-crystal/3029>\
**Category:** Community\
**Created:** [March 15, 2021, 5:25pm UTC](https://forum.crystal-lang.org/t/doing-raytracer-in-crystal/3029 "2021-03-15T17:25:26Z")\
**Posts on this page:** 1\
**Showing post:** 54

<div class="post-metadata">

**Author:** ![drhuffman12](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/drhuffman12/32/715_2.png) [@drhuffman12](https://forum.crystal-lang.org/u/drhuffman12)\
**Post date:** [April 20, 2021, 2:09am UTC](https://forum.crystal-lang.org/t/doing-raytracer-in-crystal/3029/54 "2021-04-20T02:09:23Z")

</div>

@jzakiya , I’m thinking we start with creating a shard that has most of the pieces of your code (so others can re-use it), along with an ‘examples’ folder containing the code that will later be re-submitted to [GitHub - edin/raytracer: Performance comparison of various compilers](https://github.com/edin/raytracer). This way, we can work thru the steps of splitting it up, formatting, adding tests, etc. so that we make sure we (or I) didn’t break things along the way. I started a repo at: [https://github.com/drhuffman12/crystal\_ray\_tracer/;](https://github.com/drhuffman12/crystal_ray_tracer/;) send me your github handle and I’ll add you as a contributor/editor.

For the first PR ([drhuffman12\_based\_on\_jzakiya by drhuffman12 · Pull Request #1 · drhuffman12/crystal\_ray\_tracer · GitHub](https://github.com/drhuffman12/crystal_ray_tracer/pull/1)), I basically just set up the repo and pulled in your code basically as-is; and I made sure I could run it and generate the example image. See the `README.md` file for instructions.

For the next PR ([drhuffman12\_split\_code\_and\_add\_tests by drhuffman12 · Pull Request #2 · drhuffman12/crystal\_ray\_tracer · GitHub](https://github.com/drhuffman12/crystal_ray_tracer/pull/2)), I started reorganizing your code into smaller pieces under the `src` folder, add tests, etc. The PR has a couple simple specs (all of which pass), but before I add more tests, I need to look into Windows Compatibility for both Ameba ([Windows compatibility? · Issue #230 · crystal-ameba/ameba · GitHub](https://github.com/crystal-ameba/ameba/issues/230)) and Spectator ([Windows compatibility? (#58) · Issues · Mike Miller / Spectator · GitLab](https://gitlab.com/arctic-fox/spectator/-/issues/58)), which will affect how I might deal with linting/etc and how I might code the tests.

I noticed you use the same handle for your github account, so I sent you an invite for this repo. I’d be glad to collaborate with you on this.

---

_[View the full topic](https://forum.crystal-lang.org/t/doing-raytracer-in-crystal/3029)._
