The basic primitives, or shapes, include the following: torus
cylinder
torus{major radius, minor radius}
cone
cylinder{end1, end2, radius}
box
cone{end 1, radius 1, end 2, radius 2}
and a plane
box{corner 1, corner 2} plane{axis, location} the Sphere
Looks pretty bad; thats because it doesn't have a pigment (color). The Syntax for pigment is: pigment{color} so render: sphere{<0,0,0>,3 pigment{rgb<1,0,0>}}Pigment is stuck into the object. This is a Red Sphere. Now the whole scene should look like this: camera{location<0,0,-8> look_at 0} light_source{<5,5,-10> 1} background{rgb 1} sphere{<0,0,0>,3 pigment{rgb<1,0,0>}} the Torus torus{major radius, minor radius}
As such: torus{4, 0.5}Put this torus in the scene with the pigment blue, right under the sphere: torus{4, 0.5 pigment{rgb<0,0,1>}}Render it! Now the torus looks too 2D, lets rotate it. The syntax for rotate is: rotate<> Inside the tri-brackets goes the vector for how the object will rotate. Play around with it for a bit. Here it is: torus{4, 0.5 pigment{rgb<0,0,1>} rotate<-45,0,0>} Here is the source code: camera{location<0,0,-8> look_at 0} light_source{<5,5,-10> 1} background{rgb 1} sphere{<0,0,0>,3 pigment{rgb<1,0,0>}} torus{4,0.5 pigment{rgb<0,0,1>} rotate -45*x}If your think the camera is too close in, move it back on the Z axis. (change the -8 to a -10) the Cylinder Now that we're moving right along, try to make a green cylinder (in phong.pov) on your own, from -4 X to 4 X. Remember the cylinder: cylinder{end1, end2, radius} If you get stuck here is the answer: cylinder{<-4,0,0>,<4,0,0>,0.5 pigment{rgb<0,1,0>}}Notice the inefficiencies in writing the locations of the two ends of the cylinder. Must we tell it every time that we want the location on Y to be 0? No we don't. To simplify the cylinder look at this: <4,0,0> is the same as 4*x The 4*x indicates that the value is to only be altered on the X axis by 4, and assumes that all other values (Y+Z) have a value of 0. I similar variation works with pigments. For example: pigment{rgb<0,1,0>} = pigment{rgb y}. The Y following RGB indicates that the pigment is Green (Y is the second vector, and G is the second color.) So X in Red and Z in Blue. If you don't understand, read this again. You might be looking harder than you should be, it's quite simple. The simplified code: camera{location -10*z look_at 0} light_source{<5,5,-10> 1} background{rgb 1} sphere{0,2 pigment{rgb x}} torus{4,0.5 pigment{rgb z} rotate -45*x} cylinder{-4*x,4*x,0.5 pigment{rgb y}} the Cone Not to be confused with the cylinder, a cone has two ends, but each with a different radius.
Put this white cone in your scene and play around with it for a while. Rotate, change the pigment... whatever.
cone{end 1, radius 1, end 2, radius 2} cone{0,1,4*y,0 pigment{rgb 1}} the Box The box object is quite easy. You must simply descibe the two vecors of the two corners; although it looks simple, placing the vectors can sometimes be tricky.
Here is a teel box:
box{corner 1, corner 2} box{<1,1,1><-1,-1,-1> pigment{rgbt<0,1,1>}}BUT if you put it in the scene... it is nowhere to be seen! It must be inside of the sphere, and to get it out we have got to translate it. The syntax for translate is: translate<> The translate function moves the object the amount scecified in the brackets. For example: To move the box into visibility translate it -2 on Z, translate -2*zThen rotate it: rotate -45*x the Plane Right now these shapes are floating in the middle of nowhere. Let's stick a plane under it to float above, so it looks better. A Plane is like an infinte box.
A plane with a Y axis will be a horizontal plane, while one with an axis of X will be verticle.
Here is a horizontal plane, located -2 on Y.
plane{axis, location} plane{y,-2 pigment{rgb 1}}Here is all the code we have covered so far: camera{location<0,0,-10> look_at 0} light_source{<5,5,-10> 1} background{rgb 1} sphere{<0,0,0>,2 pigment{rgb<1,0,0>}} torus{4,0.5 pigment{rgb<0,0,1>} rotate -45*x} cylinder{-4*x,4*x,0.5 pigment{rgb y}} cone{0,1,4*y,0 pigment{rgb 1} rotate -45*x} box{<1,1,1><-1,-1,-1> pigment{rgbt<0,1,1>} translate -2*z rotate -45*x} plane{y,-2 pigment{rgb 1}} |