The goal of my project was to simulate a bowling ball rolling down a bowling alley with rotational and translational motion blur.

In this scene, the following challenges must be addressed:

  • Modeling the bowling ball (a sphere with three holes in it)
  • Simulating motion blur for the bowling ball - both rotational and translational.
  • Creating a realistic texture for the wooden floored alley.
  • Creating a Marble style texture for the bowling ball
  • Displaying an environment for the scene

Modeling the Bowling Ball

In order to model the bowling ball I used the concept of CSG (Constructive Solid Geometry). The advantage to using CSG is that it gives infinite precision when rendering scenes. I added a Cylinder primitive to my code in addition to the already provided Sphere primitive, which required also writing a ray-cylinder intersection method. After creating the primitives, I created a BowlingBall object which places the cylinders in the correct positions.

This was the most time consuming part of the assignment because I had trouble getting the intersections to work so that the intersections would work in such a way that the cylinders are subtracted from the sphere. Sphere and Cylinder primitives had translation and rotation associated with them and during an intersect, the ray would get transformed to the object's coordinate system. The BowlingBall object also does a transformation into its own coordinate space as well. This makes it easy to insert a bowling ball and apply transformations to it.

Here is a picture of the modeled ball (sphere+ 3 cylinders)

Simulating Motion Blur

In order to simulate motion blur I added a "time" field to my Ray, and took the average of shooting multiple rays with random time values from 0 to 1. Then in the intersection, when I transform the ray into the Bowling Ball's coordinate system, I scale the rotation and the translation components by the time of the ray. The result is a blurriness you can see in both the rotation and translation components of the ball. When building the BVH, instead of bounding primitives by their coordinates alone, I had to also account for their transformations from time 0 to time 1.

Originally I wasn't planning on using CSG's to create my object, thinking that I would use triangles. Therefore, my motion blur implementation also handles triangles. Each triangle gets a transformation matrix and its getBoundingBox method returns the box that encloses the object's coordinates from its current location to its motion blur transformation matrix coords.

In the final image, you can see some noise as a result of my not using enough samples to render.

Here is an image with lower resolution but more samples over time per ray:

I guess it's hard to see a difference here, but there it is.


Here is the scene rendered with no motion blur.


Creating a realistic texture

Perlin noise didn't quite give me the kind of texture I wanted for the floor because bowling alleys have planks. So instead I implemented 2d texture mapping, and had a floor image repeat itself on a long surface.

I added the ability to tile a texture over a surface by allowing u,v coordinates to be greater than one. If the coords are greater than one, just take the modular to repeat the values. This particular texture works well because it is made to tile together. Here is the image I used:

Marble Texture

My original marble texture from assignment 3 didn't look that good. But after playing with the parameters a bit I got it to look decent. Perlin noise was used to create a decent looking marble texture.

Environment for the scene

In order to get more interesting reflections off of the surfaces, I used a kitchen environment map, in the hopes that no one notices that it's an environment map of a kitchen =). Heck I can't tell. I really think without the environment map the image would look really bad.