https://github.com/alokmenghrajani/php-raytracer
A toy ray tracer written in PHP. Comes with sample scenes.
https://github.com/alokmenghrajani/php-raytracer
lolz php php-raytracer raytracer raytracing
Last synced: 11 months ago
JSON representation
A toy ray tracer written in PHP. Comes with sample scenes.
- Host: GitHub
- URL: https://github.com/alokmenghrajani/php-raytracer
- Owner: alokmenghrajani
- License: other
- Created: 2011-04-08T23:55:50.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T05:44:23.000Z (almost 2 years ago)
- Last Synced: 2025-04-12T04:29:37.114Z (about 1 year ago)
- Topics: lolz, php, php-raytracer, raytracer, raytracing
- Language: PHP
- Homepage: https://www.quaxio.com/raytracer/
- Size: 200 KB
- Stars: 16
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
What is php-raytracer?
======================
This is a ray tracing software written in PHP. It's pretty much pointless, I just wrote it "for the lolz".
What is a ray tracer?
=====================
A ray tracer is a piece of software which generate 3D images by simulating the physics of light. The result
is a very realistic 3D image.
[sample image](https://github.com/alokmenghrajani/php-raytracer/blob/master/images/sample_04.png).
If you want to read more about ray tracing, you should checkout www.povray.org (a real raytracer).
Why write pointless code?
=========================
I decided to share various pieces of functional code (dubbed "for the lolz"). These pieces of code are
meant to illustrate fundamental computer science concepts, so someone looking at this code might learn
something useful.
If you are teaching programming and you find a use in these projects, feel free to use my code however
you like.
Coordinate System
=================
The coordinate system is the following:
* x points right
* y points up
* z points away from you
This system is also known as the "left-hand".
Running the sample code
=======================
For Linux or Mac OS:
--------------------
```bash
git clone git://github.com/alokmenghrajani/php-raytracer.git
cd php-raytracer
php sample_01.php
```
and then open `images/sample_01.bmp` in your favourite image viewer.