IDE Setup for CS 4620 Ray Tracer
Setup a project in Eclipse
- Download the Ray Tracer framework from CMS and unzip.
- In Eclipse, Go to File->New->Project...
- Select "Java Project" and hit Next.
- Give your project a name. "CS4620 Ray" or whatever you like.
- Choose "Create project from existing source"
- Enter the directory "A4fmwk." If you enter a wrong directory,
the java files may not appear in the correct package.
A4fmwk/ <--- eclipse project root points here
ray/
TEST_A/
TEST_B/
TEST_EXTRA/
- Hit Finish.
Coding
We have divided the assignment into two parts A and B. We recommend you
finish part A before proceed to part B. To see all TODO's in part A or
B.
- Select "Search" -> "File Search"
- Type "TODO(A)" or "TODO(B)" in the search box, and go!
OR
- Select "Window" -> "Show View" -> "Tasks"
Run and Test
We have included all the test scenes and everything you need in the
framework zip file. If you correctly setup the project, you should have
3 test folders, TEST_A, TEST_B, TEST_EXTRA.
To render images,
- Right click on RayTracer.java file in Package Explorer, and
choose Run As-> Run Configurations...
- Choose the Arguments tab. In the "Program Arguments" box, type
the names of XML scene files as its arguments (e.g.
"TEST_A/four-spheres.xml"). It will render to a PNG file of the same
name, but with a ".png" extension. You can input multiple XMLs by
separating each file by a single space.
- Once you have set the argument, simply run.
To render all images in a particular folder,
- Go back to the Arguments tab in Run Configurations....
- Use the folder's path (e.g. "TEST_A" or "TEST_A/") as the
"Program Arguments."
- Run.
This will be particularly useful when you want to test your part A or
B. TEST_A contains all the test scenes you should pass before you
proceed to part B. When you finish the assignment, test your ray tracer
against TEST_B as well as TEST_A. TEST_EXTRA contains test scenes for
glass and texture shaders. You can ignore TEST_EXTRA if you do not
implement the extra shaders.