Blender .ray Exporter

Blender is an open source 3D modeling and rendering program that you can use to design scenes for your raytracer. You can download Blender from www.blender.org. You will also need Python, if you do not already have it installed. Blender is not intuitive to use, but several tutorials are available (for example, Blender: Noob to Pro). Expect to spend some time learning the basics of navigation and object placement before you can create interesting scenes.

We provide an exporter script to export your scenes from Blender to the COS426 .ray format. To install it, follow these steps (after you have Blender up and running):

  1. Download rayexport.py
  2. If the root Blender directory is BLENDER, Copy rayexport.py into the BLENDER/.blender/scripts directory. On Macintosh, this is the BLENDER/blender.app/Contents/MacOS/.blender/scripts directory. You should see a bunch of other import and export scripts in that directory as well.

Once you have the script installed, "COS426 .ray" should appear as an option on your Export menu. To export your scene, use File->Export->COS426 .ray. Provide a filename, and then click Export.

We provide you with a few example scenes and a few .off meshes, which can be imported into Blender.

Supported Features:

  • Triangulated meshes with UV coordinates
  • Image textures
  • Material properties: Col, Spe, Amb, Emit, Translucency, Hard, IOR
  • Point, Spot, and Sun (directional) lamps
  • Background and global ambient colors
  • Camera placement

Unsupported Features:

  • Everything else

Notes:

  • Since .ray only supports triangles and not quads, you will need to triangulate all of your shapes prior to exporting. To do so, select your objects, hit TAB to switch to Edit Mode, then hit Ctrl+T to triangulate the selected faces.
  • The .off meshes we provide do not have normals. If you wish to make the meshes look smooth, you need to recalculate the normals. Enter Edit Mode, select all vertices (hit A), then hit Ctrl+N and click the "Recalculate Normals Outside" option. Once you have done this, you may select "Set Smooth" from the "Link and Materials" pane (F9).
  • Make sure that your scene has at least one material. To add a material to an object, select the object and click "Add New" in the Material pane (F5).
 

The chessboard scene in Blender

The chessboard scene in the raytracer