sphere |
this image is a scene of a blue sphere. creating a sphere object involves specifying a location as well as a
length. the code used is as follows:
line87: 0.0, 1this line is used in the sphere object. the first value represents the xyz coordinate of the center of the sphere. used here is the shortcut to setting 0.0 to all values of x, y, and z, which can otherwise be written as "<0.0, 0.0, 0.0>". the second value represents the radius of the sphere. therefore, the diameter of the sphere is 2. |
box |
this image is a scene of a blue box. creating a box object involves specifying two locations. the code used is as
follows:
line87: <-1.0, 1.0, -1.0>, <1.0, -1.0, 1.0>this line is used in the box object. the first set of values enclosed with the angle brackets represent the xyz coordinates of a particular corner of the box, which is the <-x, +y, -z> of the box. the second set of values represent the xyz coordinates of the opposite corner of the first corner, which is the <+x, -y, +z> of the box. |
cylinder |
this image is a scene of a blue cylinder. creating a cylinder object involves specifying two locations as well as
a length. the code used is as follows:
line87: <0.0, 1.0, 0.0>, <0.0, -1.0, 0.0>, 1.0this line is used in the cylinder object. the first set of values enclosed with the angle brackets represent the xyz coordinates for the center of the top face of the cylinder. the second set of values represent the xyz coordinates for the center of the bottom face of the cylinder. the third value represents the radius of the cylinder. therefore, the diameter of the cylinder is 2.0. |
constructive solid geometry |
the left image is a scene of a blue sphere. the middle image is a scene of a red sphere being added into the scene to intersect the blue sphere. the right image is a scene after applying the difference csg operation to the two spheres. this is done by enclosing the spheres with the difference operation. in doing so, the first object from the top of the operation, which in this case is the blue sphere, is considered the parent object. and the consequensing objects are considered children to this object. therefore, the blue sphere becomes differenciated. the differenciated section of the blue sphere inherits the texture of the red sphere because the difference operation works by deleting sections of the red sphere that is outside the blue sphere, and deletes sections of the blue sphere that was inside the red sphere. ergo, the red texture seen on the new object is actually the insides of the deleted red sphere. |
miscellaneous |
this image is a scene of a blue sphere. several other objects are used in this scene that supports the sphere as
the environment but are difficult to demonstrate. these are the camera, the plane, and the sky_sphere. the camera object controls the view of what is to be rendered. it has a location where it is placed, and a look_at point. the code used is a follows: line14: location <-1.6, 3.0, -4.0>look_at is used to provide a destination that the camera should face. this is more precise compared to the cumbersome method of defining the xyz angle of rotation for the camera. it is also more convenient because orbiting around the sphere only requires moving the camera. the plane object is a flat two sided object that stretches across the whole scene. it may be setup to be horizontal or vertical and may have textures applied to it. the code used is as follows: line37: y, -1the first value is used to specify the orientation of the plane. this value represents the direction of the tangent of the plane, in this case, y being a horizontal plane. the second value is the distance the plane is from the starting point. a -1 here means the plane is below the starting point. the sky_sphere object is a large sphere that surrounds the entire scene. it may have textures applied to it so that it appears more realistic. the sky_sphere in this scene is partially visible because the checkered plane is reflective. |