sphere.scn |
tri.scn |
|
quadmesh.scn |
||
ico.scn |
teapot.scn |
|
box1.scn |
box2.scn |
|
cylinder1.scn |
cylinder2.scn |
|
cone1.scn |
cone2.scn |
|
Ray-mesh intersection works with all kinds of meshes, not just triangle meshes, which is worth an extra point (see Piazzza). Cone and cylinder I just did some math to figure out the intersection t values. Sphere, mesh and box intersections are a little sneakier if you care to look at the code. Oh, one more thing: some sample scene files I found specify boxes with their z components reversed, eg (1 1 -1) (1 1 1). This is an error on behalf of the person who wrote the scene (It's not specified anywhere that we have to handle this.) so be aware that if a box renders improperly, reversing the z components to their proper order WILL fix it. This modification had to be made for the green box in mixedprimitives. |
fourspheres.scn |
sixtriangles.scn |
|
mixedprimitives1.scn |
mixedprimitives2.scn |
|
This part of the assignment seemed very straightforward. A simple depth first search into the scene graph to render objects, augmented with bbox checks was used. |
diffuse.scn |
specular.scn |
shininess.scn |
|
dirlight1.scn |
pointlight1.scn |
spotlight1.scn |
|
dirlight2.scn |
pointlight2.scn |
spotlight2.scn |
|
This part of the assignment was also pretty straightforward. Simple use
of Phong illumination calculations. |
hardshadow.scn |
||
Shadows were done by casting a new ray from the intersection point in the direction of the light and only doing a lighting calculation if nothing intersected the shadow ray. |
-max_depth 0 |
-max_depth 1 |
-max_depth 2 |
specular.scn |
||
-max_depth 0 |
-max_depth 1 |
-max_depth 2 |
stilllife.scn |
||
This was similar to shadow rays except the lighting calculation for each specular ray cast was carried up recursively and added to the initial intersection. |
-max_depth 0 |
-max_depth 1 |
-max_depth 2 |
-max_depth 2 |
||
transmission.scn refraction2.scn | ||
Similar to specular reflection but now the rays go out on the other side of the primitive. |
-max_depth 2 |
||
refraction2.scn |
||
Similar to perfect transmission but the ray is changed by an angle before being sent into the primitive. I was experiencing some bugs with noise on some test cases but it appears to be fixed now. If this appears to not work with your script, please look at the code-- I think my implimentation is worth full credit but I should get at least half credit for this feature if you find it fails on something. |
mixedprimitives3.scn |
transform.scn |
|
This was fairly straighforward-- apply transformations to the ray as we descend into the scene graph. |
No acceleration (> 5min) |
||
Node bounding box checks (3m 28s) |
Front-to-back order (3m 15s) |
|
No acceleration (> 5min) |
||
Node bounding box checks (48.677s) |
Front-to-back order (38.544s) |
|
stack.scn | ||
My implimentation runs with all of the optimizations enabled. The last time I included extra flags on an assignment I was docked eight points because my code became incompatible with the test script so I haven't included any here but if you'd like to verify these times, I've made it very easy to comment things out in the code. |
This is my interesting scene and my movie (in gif form) |
||
dynamic.scn.scn |
Interesting blooper |
|
This was supposed to be a cylinder.. |