Skip to content

Commit

Permalink
updated example 13
Browse files Browse the repository at this point in the history
  • Loading branch information
martinchristen committed Sep 9, 2016
1 parent 137a535 commit 91bbe50
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Getting Started: Try the examples
There are a lot of examples available how to use this module. This is
the recommended way to get started with pyRT.

|Example 01| |Example 12b| |Example 06| |Example 08|
|Example 01| |Example 12b| |Example 13| |Example 08|

`View all examples <examples/README.md>`__

Expand Down Expand Up @@ -122,6 +122,6 @@ official support or anything.
:target: https://github.com/martinchristen/pyRT/blob/master/LICENSE.md
.. |Example 01| image:: examples/11.png
.. |Example 12b| image:: examples/12b.gif
.. |Example 06| image:: examples/06.gif
.. |Example 13| image:: examples/13.png
.. |Example 08| image:: examples/08.png

Binary file modified examples/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/13_reflections.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
scene.addLight(PointLight(Vec3(0,0,15)))

# create some materials:
floormaterial = PhongMaterial(color=Vec3(0.0,0.1,0.1))
floormaterial = PhongMaterial(color=Vec3(0.1,0.1,0.1))
sphere0material = PhongMaterial(color=Vec3(1.,0.,0.), reflectivity=0.5)
sphere1material = PhongMaterial(color=Vec3(0.,1.,0.), reflectivity=0.5)
sphere2material = PhongMaterial(color=Vec3(0.,0.,1.), reflectivity=0.5)
Expand Down Expand Up @@ -55,7 +55,7 @@
scene.setCamera(camera)

# Create a raytracer using "SimpleRT"
engine = SimpleRT(shadow=False, iterations=3) # TODO: Reflect Shadow too (put in shade calculatation)
engine = SimpleRT(shadow=True, iterations=3)

# Render the scene:
imgdata = engine.render(scene)
Expand Down
9 changes: 9 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,12 @@ This example renders 4 spheres on ground (2 triangles).
The second version (12b) animates the light source and generates a gif.

![Example 12](12.png) ![Example 12b](12b.gif)

### Adding reflections

This example uses the scene from example 11. It changes the material of the spheres to supoprt reflections.

[13_reflections.py](13_reflections.py)
[13_reflections.py](13_reflections.py)

![Example 13](13.png)

0 comments on commit 91bbe50

Please sign in to comment.