![]() ![]() ![]() |
![]() ![]() ![]() ![]() ![]() |
CAD / Jimmy Figiel / tutorials / animation1 / createscenefile |
Create Scene File Previous Next Now we are going to start using our files. You need to get a copy of my ldrawcam.inc to do this. You can get it from the POVRAY files section of the tutorial. Go into POVRAY and create a new file. Type in this...
We have now put a scene that normaly would take 3661 lines of POVRAY code in a file that has 9 lines of code in it. This size file is much easier to manage. We also can fully manipulate the model we built in this scene. Lets go line by line through the POVRAY code #include "digger.inc"This line says to take the file that we created and include it in this file when we render. digger(default_options)This line says to call a macro (function) named digger. The call to the macro will create an instance of our model in the scene.This macro was generated by the program we ran in the last step. It will always have the name of the include file without the .inc. The default_options specifies that the model be set in its normal position. #include "ldrawcam.inc"This line says to include a file named ldrawcam.inc in our file. This file is one that I wrote to make life eaisier in POVRAY. It has several different kinds of cameras in it. It also contains some simple backgrounds and grounds that you can use in your scenes. The file listing is in the POVRAY files section of this tutorial. TrackingCamera(<0,-90,-170>,350,45,13)This line specifies a camera to use in the scene. The Tracking Camera is the one I use most. The first parameter <0,-90,-170> specifies the location that you want the camera to look at. It is in LDRAW units. The next parameter is the distance that you want the camera from this point. The third parameter is the rotation around the Y axis you want to look at the point from. The last parameter is the amount of tilt you want on the camera. Ill talk about the other cameras when I do the rest of the animation tutorials. BlueBackground()This says to put a nice sky blue color in the background. GreenFloor(0)This says to put a nice green ground for my models to sit on. The parameter 0 specifies where along the Y axis you want the ground to be. Light(<0,-280,-220>) Light(<200,-220,80>) Light(<-100,-300,30>)These three lines specify to use three lights in the scene. Three helps light up things from all sides. The parameters specify the LDRAW location of the light <x,y,z>. Save it to diggerscene.pov and render. Your image should look like this. ![]() Now lets move our model. Each of the joint names that we specified in the comments of our ldraw models has become a function that we can use to move our model. The name of the function is the name of the model, an under score, and the name of the joint. Change the line digger(default_options)to digger(digger_cockpit(45))Now render the image. It should look like this. The cockpit of the digger is now rotated 45 degrees around the Y axis. A negative number will rotate it the other way. ![]() If you want to adjust more than one thing at a time, you put all the functions together with plus signs. You can put them on multiple lines to make it more readable. Now change the line to digger(digger_cockpit(45)+ digger_lowerarm(-30)+ digger_upperarm(90)+ digger_bucket(135))The image should now look like this. ![]() If you made it this far you have come a long way. There is a lot of detail here. Take some time and move the model around and the camera around. Next time we will create a digger movie. Previous Next |
Primary content in this document is © Jimmy Figiel. All other text, images, or trademarks in this document are the intellectual property of their respective owners. |
|
©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR |