|
|
|
Home :: Login :: Forgot Password :: Search :: FAQ
|
|
|
|
Published By OrionP on Saturday, September 20, 2003 - 06:11 PM
By: Ahui Herrera
Knowledge Requirements
Software Requirements
File Requirements
Optional Files
What will you learn in this tutorial
Theory
Step-by-Step Procedures Stage 3: Rendering
Step 1: Opening The POV File
Step 2: Important POV File Section #declare QUAL = 2; // Quality level
Make sure that the quality level is equal to 2 for FINAL rendering. It is recommended that you use level 1 when working on figuring out where to place the camera and when doing initial key animation frames if you have an older machine. Note that it is NOT RECOMMENED that you use level 3 unless one owns a high-end workstation PC or a dual-processor power Apple as rendering times per frame will take 5+ minutes. Level 3 requires A LOT of processing power and memory. The quality difference between 3 and 2 is not noticeable for animations. If you are doing still images, use quality 3 for the best results. I have done animation rendering on a dual P-3 1.4 GHz with 512 MB Ram machine and the time was still very slow.
Now scroll to the bottom of the file. Look for the commands that look similar to the image above. This is where the major parts of the animation hand coding will take place. Object { Y_dash_Wing_space_Right_space_Back_dot_ldr… is the command line that tells POV-Ray that all the lines above it create the Y-Wing Model. If multiple objects were in the scene you should have 1 ‘final’ object line per item. Background { color rgb <0,0,0>} tells POV-Ray to create a background with the color in parenthesis. One can change the color of the background by changing the values of the numbers. Rgb stands for red, green, and blue and acceptable values range from 0 to 1 for each color. Values above 1.0 can be used to create a bright neon color effect. The name of the game here is to experiment with the values. 0 means no color while 1 means full color saturation for the color in question. Camera {… } is the command that lets POV-Ray know where the camera should be placed and in which direction it should be looking. The only thing to remember when working with the camera is that in ldraw the sky is on the –y axis. Thus when rendering in POV-Ray remember that the sky is in the –y axis. Light_source { …. } is the command that lets POV-Ray know where to place lights in the environment. You need lights in order for the camera to see. Think of those big lights used in the photo studio. By placing the lights in various locations around the object you can get different effects.
Step 4: 1st Render of Y-Wing
In order to get this image ready to look like the final animation we need to add a background composed of stars and planets, relocated the light sources and move the camera a bit. Take a look at the final animation (ComplexMotion.avi) if you have done so yet to get an idea of what we will be doing.
Step 5: The Storyboard
STep 6: Adding The Star Field Add the following code to your POV file. You can read the Galaxy.htm for a detailed explanation of the commands below.
// Background: // GALAXY INCLUDE FILE OPTIONS #declare galaxy_distance = 25000 #declare galaxy_seed = -3030 #declare galaxy_colour1 = <1.084, 1.250, 0.750>; #declare galaxy_colour2 = <0.550, 0.484, 1.050>; #declare galaxy_pattern_scale = 0.813; #declare galaxy_pattern_origin = <-19.869, 16.733, -17.843>; #declare galaxy_turb_origin = <-5.753, -12.661, -23.418>; #declare galaxy_star_colouration = -0.315; #declare galaxy_bgstars = 2; #declare galaxy_bgnebula = 6; #declare galaxy_nebula_sphere = 5; #declare galaxy_nebula_ambient = <0.973, 1.029, 0.976>; #declare galaxy_object_name = "Nebula2" #declare galaxy_object_scale = 1.075; #declare galaxy_object_flatten = 0.128; #declare galaxy_object_rotate = 8.1; #declare galaxy_cluster_name = "Star2" #declare galaxy_cluster_objects = 8; #declare galaxy_cluster_scale = 0.432; #declare galaxy_cluster_rotate = -44.7; #declare star_type = 2; #declare star_colour = <1.000, 1.000, 1.000>; #declare star_colour_turb = <0.100, 0.100, 0.100>; #include "GALAXY.inc" Download the file Code_starfield.txt here. In general we are creating a sphere with a star field texture that is 25,000 units big. You want to make the sphere big because everything (props, lights and camera) must fit inside of it. To create a different star field or effects use the Rand.pov and Rand.ini files provided in the Galaxy.zip to generate 100 different star field scenes. Now render the POV file again. You should get something that looks like this.
Step 7: Placing The Camera & Finding Camera Location #2
This is perhaps the HARDEST part of the animation: Finding the camera position. There are some basic things to remember when looking for this position. First remember that the object is located at position <0,0,0> as we gave it this location in the LDraw file. So the best place to have the camera looking at is <0,0,0> (the center of the object). Secondly, place the camera close to the look at position at the beginning and do a quick render. Chances are that your camera is too close and you are either looking at the inside of the object or a very close up of the object. Something like the image below.
Once you have an image similar to this then start changing one value at a time and doing a rendering again. In my case the camera was at location <100,100,100> above so I changed the x-axis value on the next render to 0 getting <0,100,100> and so on until I came up with the final image. Lastly when doing this keep your numbers whole and use increments of 100s or 50s only. This way it’s easier to deal with the numbers when animation time comes. Also remember that you can use negative numbers. Location <100,-100,100> would have gave me a close up of the ship looking at it from above as oppose to below as in the image above.
Step 8: Placing The Camera & Finding Camera Location #1
The image on the right provides a better initial view of the starship. Thus I will use that location as my starting point and will move to position #2 from there. This will mean that I will be moving in two axes (x and z) instead of the original one (z-axis).
Step 9: Placing The Camera & Finding Camera Location #3 & #4
Note that all I had to do was make the z-axis value the opposite it was than position #2. –600 z-axis became +600 z-axis.
Step 10: Adding The Pink Planet
// Pink Planet Code
#declare My_Ground = pigment {
bozo
turbulence .4
octaves 6
omega 0.7
lambda 2
color_map {
[0.0 0.1 color rgb <0.14, 0.36, 0.10>
color rgb <0.36, 0.2, 0.061>]
[0.1 0.5 color rgb <0.36, 0.2, 0.061>
color rgbt <1, 1, 1, 1>]
[0.5 1.0 color rgbt <1, 1, 1, 1>
color rgbt <1, 1, 1, 1>]
}
scale 300
}
#declare My_Clouds = texture { pigment
{
bozo
turbulence 1
octaves 7
omega 0.7
lambda 2
color_map {
[0.0 0.1 color rgb <0.85, 0.85, 0.85>
color rgb <0.75, 0.75, 0.75>]
[0.1 0.5 color rgb <0.75, 0.75, 0.751>
color rgbt <1, 1, 1, 1>]
[0.5 1.0 color rgbt <1, 1, 1, 1>
color rgbt <1, 1, 1, 1>]
}
scale 850
}}
sphere
{
<-1000,-1000,0>, 400
pigment { color rgb <.19,.19,.29> }
texture { My_Ground }
texture { My_Clouds }
}
Download the file Code_PlanetTry1.txt here. Notice that this image is using camera position #4 and that the planet is not pink and you can’t see all of it. There appears to be not enough light. Before I go into fixing these problems let me tell you a bit about the code. Special thanks goes to the POV-Ray help files for creating this section of the code. We have two #declare statements that create two textures: My_Ground and My_Clouds. After that we created a sphere and placed the textures in it. The sphere is at location <-1000, -1000, 0> and it’s size it radius 400 units. The best way to appreciate this planet is to experiment with some of the values in the texture file and see what happens. So how did I know what the location was? Experimentation, experimentation! Now we need to fix the coloring of the planet to make it look pink because a bluish like planet looks too familiar. However, before we can fix the color we need to see the planet. What we need to do is add some light.
Step 11: Let There Be NO LIGHT!
As you can see the planet is black and you can barley make out the starship. So we need to play god and give this universe some light. “The light_source is not really an object. Light sources have no visible shape of their own. They are just points or areas which emit light.” (From the POV-RAY Help File) So where do we place our light source? Well the easiest way is to start at the center of the planet and work our way from there. The center of the planet is <-1000, -1000, 0>. So if we start with that location for the light source and render the file you will notice that you get the same image as above. Why? Well from the location of where the camera is you can NOT see the light which is inside the planet! Thus we need to move the light source. The following code looks the most promising.
All that is left is to fit the color on the planet. To change the color of the planet change the pigment from <.19, .19, .39> to <.49, .19, .19>.
Step 12: To Add A Star
// LARGE STAR (Yellow Star) #declare galaxy_object_name = "Star1" #declare galaxy_color3 = <0,1,2>; #declare galaxy_object_scale = 1; #declare galaxy_object_position = <560, 45, -1000>; #include "GALAXY.OBJ" Download the file Code_YellowStar.txt here. Notice that our star location is not conforming to the whole numbers lecture I gave earlier. The reason for this is because moving in increments of 50s or 100s would be too big and the star would ‘fall off’ the screen. For more detailed information on the other commands refer to the galaxy.htm file.
Step 13: Adding Another Star
The image above doesn’t look nice does it? Remember we removed all the lights from the scene except the light source from the yellow sun. This code should provide us with the blue sun and the light it emits. Notice that I have used very high values for the light_source color. Basically the higher the values the brighter the light will be.
// Blue Star #declare galaxy_object_name = "Star2" #declare galaxy_color3 = <2,.2,.2>; #declare galaxy_object_scale = 1.5; #declare galaxy_object_position = <-10, 35, 0>; #include "GALAXY.OBJ" Download the file Code_BlueStar.txt here.
Step 14: Understanding a .ini file So how does this correlate to our animation and the .ini file? Well the .ini file will let POV-Ray know how many images to render, what file to render, the size of each image, which frame to start and end with, and the final output file type.
Ini files are very easy to read. Look at the sample ini file above. The line numbers have been added to help explain each line of code. Line 1 – Comment lines are command lines that POV-Ray will ignore. They are denoted by a “;” in front of them. You can write whatever you want in them. Line 2 – Provides POV-Ray with the filename that it will render. Line 4 & 5 – These lines inform POV-Ray what to name the first and last frame for the animation. Line 6 & 7 – These lines inform POV-Ray where to start and end in the series of frames provided in lines 4 & 5. You use these commands only if you are NOT going to render the complete animation or need to restart from a certain point. This will make more sense in the next step. Line 8 & 9 – Let POV-Ray know where to start and stop the clock variable. The clock variable is the most important item to remember when doing your animation. It is how you will get the camera to move position in each of the frames. Line 10 & 11 – These provide the information need to know what size frames to create. Look at the QUICKERS.ini (default ini file) of POV-Ray for a list of common sizes. Line 12 – Optional animation that will NOT be discussed in this tutorial Line 13 – A POV-Ray option that will NOT be discussed in this tutorial Line 14 – Provides the specification for the type of output file that POV-Ray should create. Line 15 & 16 – Used to create smoothness in text so that it is easier to read in computer screens when set to ON.
Step 15: Creating a .ini file This file has been provided at the beginning of the tutorial. In the ini file above you can see that we have provide the filename of the file to render, the number of frames to render (5 secs of film x 30 frames per second = 150 frames), what frame size to create and output file type. I am using 320 x 240 for the file size as this will make a decent size video file with good quality but not create a very huge file. Look at the QUICKRES.ini file for different file sizes. You can choose whatever format type suits your needs, I know Ulead MediaStudio Pro 6.0 can handle the PNG format type so I will use it. Now for the hard part of the file: the clock variable. The beauty of POV-Ray animation is that you only need to know the major points of your animation. These are called keyframes. Remember how we spend all that time looking for the four camera positions. Those are our keyframes! We need to provide POV-Ray with a way to knowing that these are the major points of our animation. The table below shows this more clearly.
As you can see from the table it is the clock value that will allow us to ‘move’ the position of the camera over each frame. Furthermore since we want a smooth incremental movement over time, POV-Ray will calculate the clock variable increments so this happens. Currently the clock variable will create values in increments of 0.0067. The clock will start at 0 and add 0.0067 to each frame’s clock variable until it gets to the 150th frame in which the clock will be at 1. Clock is moving from 0 to 1 in 150 frames. 1 divided 150 equal 0.0067. So we need a clock increment that will allow us to go from –700 to 0 on the X-Axis and –3000 to –600 on the Z-Axis. As you can tell these are not moving in the same increment so two clock values will be needed.
Step 16: Figuring Out the Clock Values Next we want to go from –700 to 0 in moving from position 1 to 2. How do you do that? Well you can say that the initial clock is 0 and the final clock is 700 and then set the camera command line to ‘location <-700 + clock, -250, -3000>’. This should work, right? No, you will move the camera the desired X-axis movement but NOT in the Z-axis. Also note that the clock we stated is for the entire length of the animation 6 seconds but the movement from position 1 to 2 is only 2 seconds. We can do two things. 1) Figure out the complex math that will give us the clock values we need over the length of animation or divide the animation into three smaller parts. It is always a good idea to create smaller animations for each of the keyframes transitions you may have. In our case we have 3 transitions so we will have three mini-animations.
Step 17: One Animation Becomes Three Mini-Animations – Mini-Animation 1
We start out with –700 and –3000. The next frame will have –688.33 and –2960. This is accomplished by decreasing the X-Axis by 11.67 and the Z-Axis by 40. The difference of the two axes is 28.33. If you continue to each additional frame you will notice that the difference continues to increase by an additional 28.33 between the two axes. This constant increase must somehow be related. That is where the constant comes in. If you divide the difference by the X-Axis increase (the clock) you get 2.427592 for each frame. That is the key for the animation. Look below for the code. FOR INI FILE Initial clock value = 0 Final clock value = 700 FOR POV FILE #if (clock = 0) Location <-700, -250, -3000> #else Location <-700 + clock, -250, -3000 + clock + (clock * 2.427592)> #end If the clock is at 0 then we are at position 1 otherwise some movement in needed. Read the If…Else Statement out loud to yourself. “If the Clock is equal to 0 then the Location is… Else Locations is …” For the X-Axis the movement is dictated by the clock for the Z-Axis the clock movement is NOT enough for an additional 28.33 (the difference between the X and Z movement) is needed per frame! To get this additional movement we take the clock and multiple it by the constant we found. Now render the final frame of this mini-animation. To do this modify the Ywing_ini ini file to include the Subset_Start_Frame = 60 and SubSet_End_Frame = 60 and setting the ini file to Ywing_ini.ini in the ini options of POV-Ray. You should get something like this.
Notice how this render looks like our old camera position 2 render with one exception. There is too much light! Remember we set the blue sun light source to <4,4,4>. Well in the distance it looked okay but not anymore. So I think we should lower the light level to <2,2,2>. That should give you better results. If you have read Lego Animation 101 – Simple Movement then move on to the next step. If you want only a section of the animation you must use the SubSet command in the ini file as we did above. The reason for this is say you stop the animation when the 15th file is completed. If you then come back and set the Initial_Frame = 16 and the Final_Frame = 60 then the clock calculations will be based on 45 frames and NOT the original 60 frames. Thus you must use Subset_Start_Frame = 16 and Subset_End_Frame = 60 for the clock variable to be based off the original 60 frames.
Step 18: Rendering Mini-Animation 1
Step 19: Mini-Animation 2 FOR INI FILE Initial clock value = -600 Final clock value = 600 FOR POV FILE Location <-700, -250, clock> I commented out the commands for the mini-animation 1 but you can delete them if you like. I commented out just in case I need to later go back to them. Upon rendering the 60th frame you should have something like this.
Now create another subfolder under the Ywing folder and call it Mini2. Move the latest 60 images that have to the new folder.
Step 20: The Last Animation FOR INI FILE Initial clock value = 0 Final clock value = 700 FOR POV FILE #if (clock = 0) Location <0, -250, 600> #else Location <CLOCK, 2.427592) * (clock + clock 600 -250,> #end Upon render the 60th frame you should have something like this.
Now create another subfolder under the Ywing folder and call it Mini3. Move the latest images into the new folder. You are now done with the animations rendering. Now it’s time start the video production.
Stage 4: Video Production There are many video editing software packages available. I will be using Ulead MediaStudio Pro 6.0 because it’s the one I have and is pretty easy to use for our purposes. You can download the trial version of Ulead MediaStudio Pro 6.0 at the bottom of this tutorial. Also ensure that you download the DivX4.11 Codec. You can read more about DivX4.11 Codec from their website here [make the word here a link to http://www.divx.com] In a nutshell we will be creating a video file using the .avi format. Think of this format as a container that holds a) your movie, b) what type of compression you use for the movie, c) your sound (if any) and d) the compression you use for your sound. You don’t have to compress your video or sound if you don’t want to, but without compression video and sound files are huge! One example of a compression codec is very popular MP3 format. In our case, our animation will have video only. We will use the DivX 4.11 video codec because it’s one of the best ones in creating a high-quality video while keeping the final file size reasonable. Okay we are now ready to begin the final stage.
Step 1: Opening Ulead MediaStudio
Step 2: Importing Our Images
Step 3: Inserting Images To Timeline
The timeline image above has a lot of information. For our purposes we only need to worry about the VA timeline section. This section of the timeline deals with the A-Video. You can have multiple videos sections (VB, V1, V2, V3) when doing your movie but for our case we only need to concentrate on the VA section. Below the video sections are the Audio timeline sections. Aa corresponds to the audio section related to the video in section A. There is one special timeline section called Fx. This is for special transitions or effects.
Step 5: Importing Images Again (Mini-Animation 2 & 3)
Remember to click on the last image first and use the shift key to select the rest of the images. A word of warning. Mini1 – Ywing60.png is the same image as Mini2 – Ywing01.png .Mini2 – Wying60.png and Mini3 – Ywing1.png are also the same. So when you import the next set of images you can either NOT import the duplicates. Since this animation is tiny (6 seconds), 2/30ths of a second more is NOT going to be noticed. This is something to keep in mind if you plan on doing a bigger animation.
Step 6: Adding A Title & Credits Next insert the image called Title.png to the VA timeframe and give it a duration of 3 seconds. Insert the image Title.png again and this time give it a duration of 1 second. Now insert Mini1 – Ywing01.png and give it a duration of 1 second but put this image on the Vb timeline right below the 1 second Title.png image. Your timeline should look like this.
Note that I have enlarged my time line so that it is easier to view. Your timeline image may be smaller than this. Click on the icon in the red circle of the image above to look at the timeline display options. Now click on the Window menu and check off the Production Library. A new window should appear called Production Library. This Library houses an assortment of special effects that can be placed on the FX timeline section. Choose the one you like and drag it onto the FX timeline between the two 1-second images. If you double click on it you can get more options for the particular effect your choose. Your timeline should now look like this.
Now place the animations images we imported early in the correct order on the Vb timeline. Next we insert Mini3 – Ywing60.png onto the Vb timeline with a 1 second duration. On the Va timeline in the same location as the newly inserted Mini3 – Ywing60.png slot we insert the credits.png image also with a duration of 1 second. Choose another FX effect from the production library. Next insert the credits.png image again with a longer duration say 3 seconds. Your timeline should now look something like this.
Note that I have added something else after the credits image and look carefully at the arrows on my FX timeline section. They go down, up and then down again. Make sure that yours do the same go down and then up or vise versa depending on where you started you video. To change the direction of the arrow double click on the effect and choose the correct direction from the option window that appears.
Step 7: Creating the Video
Step 8 Final Thoughts Well, I hope you enjoyed and found this tutorial useful. It was fun writing it and if you have any questions feel free to email me at jedi_agh@yahoo.com or visit my website at http://www.geocities.com/jedi_agh/. Remember that the best learning tool is to experiment with the software. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|



