CSC400-Katie

From CSclasswiki
Jump to: navigation, search

Mathematica to POV-Ray

View of the image from camera location <0,0,-5>

While I was researching on how to export from Mathematica to POV-Ray, I didn't get very clear answers. Some of the websites that I was directed to simply stated that it was possible while others kept mentioning MathGL3d, which I don't believe is on the computers here at school. The most information I got was from Mathematica's Documentation. It told me that I simply had to use the following command: Export["file.pov", expr]. After doing that, I kept getting an error that said that said that the list (ganim Mathematica code: BloomingCube.nb) could not be exported to the POV format. I research more about the export function and it mentioned that for POV, it would need to be a Graphics3D object. So, I changed ganim to a Graphics3D object and successfully exported the file into .pov format.

You can slightly see the images required to unfold the cube

When I opened the POV-Ray file, I just saw a white screen, so I decided to play around with the camera controls to see what image was being shown. First, I looked at the box from the camera location <0,0,-5>, which means that the camera is at position 0,0,-5 on a x,y,z graph. The image shows the cube fully unfolded. I was curious to see if the file exported the 20 images of the cube being unfolded (from Mathematica). So, I changed the x and y positions of the camera location to find that it had all 20 images.

Exporting Individual Frames

I decided that exporting each frame would be better to import into POV-Ray. I have 20 frames of the unfolding cube and I am currently trying to make the image look more "realistic." It has been a while since I have used POV-Ray, so I am using the documentation and testing different attributes to see how I can make the cube look more visually appealing.

Future Plans for Unfolding Cube

After I make the first frame look the way I want it to, I will apply all the changes I made to the rest of the frames. Then, after obtaining software that will create the animation, I will try to create the animation with the existing frames. I first want to see how the animation looks without the clock variable. I expect it to look very similar to the animation seen in Mathematica. If needed, I will add the clock variable to make the animation a little more "fancy."

From the research I have done, it seems like a clock variable may not be necessary at this point if we want to see a similar animation as the one in Mathematica. However, if we want to add a rotation (of the object or camera) or even change an object property, we will have to add the clock variable and create a .ini file.

Animation in POV-Ray

I have not had much experience with the animation side of POV-Ray, so I began researching on that as well. I found a website that showed how to make 3D text and animate it. Tutorial 1 Although I am not trying to rotate text, I thought it would be helpful to learn some simple animations before continuing and successfully animating the unfolding cube.

In the tutorial, I learned that first you need to have 2 files: a .pov file and a .ini file. The .ini file is the animation you want to apply to your .pov file. From the website I found, the author created a clock variable that controls how long the object should be rotating for.

I also found another tutorial that showed how to move something in a straight line along the z axis. Tutorial 2

I decided to continue my research on how to animate in POV-Ray and found the following site. Tutorial 3

  • POV-Ray animation relies on the variable "clock," which POV-Ray defines internally.
    • An example of using this variable is making a simple animation of a rotating object. To accomplish this, the following line of code must be put in the appropriate part of the scene description. The animation that appears consists of frames where the camera's viewpoint spins around the object in a full circle. rotate <0,clock*360,0>
    • The variable "clock" has a normalized value that varies between 0 and 1 during the number of frames that the user select.
      • For example, if a user chooses 20 frames, the clock value will start at 0 and increase in increments of 1/20 until it reaches 1.
      • You don't have to make any other calculations. A scene description will produce the expected animation no matter the number of frames that are chosen.

After looking among these tutorials, I became a little confused because Tutorial 1 and Tutorial 3 gave me different instructions. Tutorial 1 gave me some information about how we need to create another file with a .ini extension, but Tutorial 3 had information about using a script. There are 2 ways that you can animate in POV-Ray. One way is to use a script and another way is to create another file with a .ini extension. I think that it will be easier to learn the .ini extension first and after becoming more comfortable with it, learn how the scripting works.

.ini Files

Tutorial 4

To comment in the .ini files, you have to use a semicolon (;) instead of the double slashes (//) that we use in the POV-Ray files.

Basic Animation Statements

Input_File_Name="_____.pov"

Initial_Frame=1
Final_Frame=10

Initial_Clock=0
Initial_Clock=1

Cyclic_Animation=On
  • The first line specifies the name of the POV-Ray file we want to render
  • The second line specifies which frame number to start with
  • The third line specifies which frame number to end with
  • The fourth line specifies which clock value to start with
  • The fifth line specifies which clock value to end with
  • The sixth line turns cyclic animations on

Anti-Aliasing

All of the images looked too rough around the edges, so I decided to use anti-aliasing. I found that applying it to all of the frames was really simple. By using this link, I found that you can add the following lines to the .ini file.

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
  • The first line turns on anti-aliasing.
  • The second line specifies that anti-aliasing will start if the difference between a new pixel and the previous pixel is bigger than a certain number, 0.3 in this case.
  • The third line means that POV-Ray uses a 3x3 grid for one pixel.

Other Animation Statements

Partial Rendering

Subset_Start_Frame=11
Subset_End_Frame=27
  • This allows you to only render a particular part of the animation without the changing clock or frame rate.

Gamma Correction Items

Display_Gamma=1.5
File_Gamma=1.5
  • The first line sets the display gamma to 1.5
  • The second line applies the File_Gamma value to the image file

Changing Rendered Image Type

One thing that bothered me about the rendered images was that it would always be in a .bmp format. I wanted to figure out how to change the image type to either .jpg, .gif, or .png.

I found that this was actually much simpler to do than previously thought. After looking at the POV-Ray Documentation, I found that this was much easier than I had previously thought.

All that is needed is the following line of code in the .ini file:

Output_File_Name=file_name.file_type

For the purposes of this animation, I thought that we would only need to use .jpg, .gif, or .png. I tested out that line of code by specifying all three file types and found that it worked.

Using Scripts

Tutorial 5 I found another site that had some more information about animations in POV-Ray. This one also uses scripts to create an animation. It looks the use of scripts is not a part of POV-Ray. Although these sites do explain a little bit about the script, I will have to focus on learning the script so that I can understand what each part means. The following script was a part of this tutorial.

#!/bin/bash
# This script expects two arguments:
#    1) source file root name - "sample" for "sample.pov"
#    2) clock value - some numerical value
# Example call "clockpov sample 05" calls the infile "sample.pov" with
# a clock value of 05, and then generates "sample05.ppm" as the output
#
x-povray -I$1.pov -V +D1 +P +X100 +A +FP16 +O$1$2.ppm +K$2

I am still not 100% sure what each part of the line does.

Information from Pov-Ray's Animation Wiki

Creating Animations

The wiki starts off saying that POV-Ray is able to help produce a sequence of still images, but it doesn't put them into an animations. In order to do this, we will need additional software to assemble it.

  • The ini file (.ini) that POV-Ray uses tells the renderer which frames to render and what clock values that it should use. The scene file (.pov) then can use the settings from the clock variable to control a part of the image or frame in the sequence.

Example of .ini file code:

+W150
+H150
Input_File_Name=robot.pov
Initial_Frame=1
Final_Frame=30
Initial_Clock=0
Final_Clock=1

So what does the code above do?

  • POV-Ray will render 30 frames, specified by Initial_Frame and Final_Frame and the clock variable will run from 0 to 1, specified by Initial_Clock and Final_Clock. If the clock is not specified, the value of the clock variable will pass from 0 to 1. The change during the animation will be controlled by the clock variable or the frame_number variables.

Animating the Camera/Object Properties

  • It is also possible to animate more than just the objects in the scene. You can also animate the object properties and the camera.
  • When animating the camera, it can often be very choppy/jerky. This is noticeable in the animation where I change the camera location. In order to make the movement smoother, this wiki page suggests taking gravity, speed, and acceleration into account so that we can adjust the way the camera moves. Other websites suggest creating more frames to make it look less choppy. I have not yet compiled the animations yet, but once I do and see how smooth the animation runs, I will determine if I need to figure out a way (other than increasing the number of frames) to do it.

Complex Behaviors

  • Example on POV-Ray's Wiki
  • Lots of programming will be involved for this. However, we don't necessarily have to program everything by detail.
  • In the example animation provided by POV-Ray's wiki, we can see the birds flying around in the sky. According to the wiki, you can define an array of an object (in the example's case: the birds), set up variables for position, orientation and speed, and create a macro to draw them. Every time a frame is rendered, calling the macros is the only thing needed to be done. One will draw the figures and another will calculate the new state for each object and will store it for future use.

State Variables

Code taken from POV-Ray's Wiki

State variables are very important for this method because they are at the core of the method. The following is information about how they created the flock of birds animation.

  • First, you need to put the behaviors of the object in a data structure, such as an array.
#declare Blocation = array[max_birds];
#declare Bvelocity = array[max_birds];
#declare Bphase = array[max_birds];
  • As mentioned above, we need to transfer the state of the objects (in this case birds) from one frame to another, which can be accomplishing using macros. Macros can write out and readback the variables to a file on disk. The following macros can be easily extended to save and load more complex data-sets.
#macro SaveState()
       #fopen wfile "state.txt" write
       #local i = 0;
       # while (i<max_birds)
               #write ( wfile, Blocation[i], ",", Bvelocity[i], "," , Bphase[i], ",")
               #local i=i+1;
       #end
       #fclose file
#end

#macro LoadState()
       #fopen rfile "state.txt" read
       #local i = 0;
       #while (i<max_birds)
               #read ( rfile, Blocation[i] ,Bvelocity[i], Bphase[i] )
               #local i=i+1;
       #end
       #fclose file
#end

Drawing Objects

  • Once again, you will need macro(s) to draw the objects onto the scene. The macro that draws the object takes all the relevant parameters into account.
  • For example, when the bird is taking a turn and rolls or the wings, which have a current state that will determine if the wings are up or down.

Rules

  • The rules act on the state variables, but they can also gather information from other variables as long as they are in scope.
  • For example, we can define a speed.
#local Speed = vlength(Bvelocity[i]);

Later on, when you need to create a rule to stop the birds from stalling, you can use the following code:

#if (Speed<1)
    #declare Bvelocity[i]=Bvelocity[i]*1.2;
#end

Detailed Control

  • When using these rules, we do not have control of the objects at the position-level. We have access to all of the variables when rendering, so it is possible to do extra checks then. But, this will not work at parse-time.


Cyclic Animations

  • When you want to create an animation that loops, the animation must end with the same scene it started with. In other words, parsing the file when clock=0 and clock=1 must generate the same image.
  • However, we may run into a problem in the animation. Because the first and last frames are identical, the animation may look like it stops for a while. To prevent this from happening, you can delete the last frame after rendering or render a subset of the frames in order to leave out the last frame.
  • POV-Ray's solution to this is to add the line Cyclic_Animation=On to the .ini files.
    • This increases the number of frames by one
      • If you choose to have 50 frames in the animation, POV-Ray will make it 51 frames.
    • However, it will not render the last frame
      • Only 50 images will be rendered, since the 51st one is identical to the first one.

Putting the Animation Together

When POV-Ray renders the "animation," it will output an x number of images, depending on the number of frames you specify in your .ini file. In order to create a .gif animation, we need to use another piece of software. On one of the POV-Ray wiki pages, they suggested that we use a program called Ogg Theora.

After creating some more "animations," I will try to compile the frames using Ogg Theora. (Would it be possible to install Ogg Theora onto the PC? I believe it is a free piece of software.)

Includes

One important aspect of POV-Ray that I have discovered is the include. This makes things much easier and cleaner when trying to code one frame of the animation.

The current animation that I am working on is a unfolded cube folding into a shape of a parallelogram. From the way I currently have it set up, I have 25 .pov files that contain one frame from animation. When I first started writing the code for the frames, I quickly found that there were a lot of repetitive chunks of code throughout the entire .pov file. In order to clean up the code and get rid of any redundancies, I decided to use multiple include that will allow me to bring in information from other .pov files.

Example from My Code

In the zip file that I have (that contains all of the .pov files I mention in this section), I have 5 includes in my CubeUnfolding1.pov file for the first frame of this animation. (The first include is not one that I am using to bring my code in from a different .pov file.)

  • I am currently having some problems trying to upload the zip file right now. I will try to upload it again later.

#include "cameralight.pov"

  • This include statement contains all of the information that has to do with the camera positioning and lighting

#include "data.pov"

  • This include statement contains all of the data that has to do with the making of each object
  • This file contains all of the unions for the triangles that make up the object as well as the finish for the object

#include "radiosity.pov"

  • This file contains all of the code related to radiosity, which is taken from the towers.pov that Professor O'Rourke provided
  • I have not made any changes to this file for now because with the image mapping, the lighting does not seem as harsh as it did before
    • However, there are still some areas that seem to be a little lighter than others. I will discuss this with Professor O'Rourke to see if any changes need to be made

#include "table.pov"

  • This file contains all of the code related to the plane that the object is resting on

Arrays

Instead of having to create every frame manually, there is a way that we can combine the code with a .ini file that will allow us to "create an animation" after only rendering one file.

I have this completed from a previous file that I have.

.pov file

In this file, I created an array (size will vary depending on how many frames you have) and add an object to the next empty cell every time a new object is created. This repeats until the last object is created.

For example, let's say that you have an array called AniArr which is initialized to a size of 2. This would be an appropriate size if you have 3 objects that you want to add to the array. After adding all of the objects to the array, you would call on the array and give the variable clock as an argument. This clock variable is set in the .ini file that is associated with this .pov.

.ini file

In this file, you need to specify the .pov file that is associated with this .ini file. In the file I have provided, you can see that I specify the input file as the .pov file I want to "animate." The output file is the name/type of the image file. If there is more than 1 frame, it will automatically add a number at the end of the name that increases by 1 every time. So, if the first one is unfold1.png, the next will be unfold2.png, and so on. Next, you need to specify how many frames there are in the animation you want to create. According to the example I gave above (where the array size is 2, meaning that there can be up to 3 objects in the array), the initial frame should be 1 and the final frame should be 3. The initial/final clock should be initialized to the same values as the initial/final frame. After all, you do want your animation to be completed in the appropriate amount of time.

Then you would render from the .ini file and in the folder where you saved your .ini and .pov, there should be 3 images (still following the example from earlier) there. From here, you will need other software to string the images together (such as iMovie) to create the animation.

My Animations

Animation Using Tutorial

This is the first "animation" that I "created" with the help of a tutorial listed on my wiki page. It is a simple animation of a rotating cube. In order to achieve this, I added the following line of code in camera:

rotate <0, clock * 15, 0>

I noticed that the "animation" was really choppy when it was rendered. After looking online and trying to figure out a way to make the animation seem smoother, many sites said that a simple way to do it was to increase the number of frames in the animation.

Animating My Own POV-Ray File

I have not uploaded my files yet. I will post them as soon as I can.

Instead of trying to animate on a boring scene with only one object (like I did for the very first animation I created), I decided to use one of my files from Graphics (CS240) that I created during the Fall '09 semester. The scene I chose to use depicted a pool table (with an infinite length).

Each zip file will contain both the .pov and .ini files.

This animation moves the red billiard ball up the Z-axis by a fixed amount per frame. In order to do this, I had to change the coordinates of where the red billiard ball originally sat.

sphere { <0, 0, -clock>, 3 }

This animation increases the radius of the red billiard ball so that it grows during the specified time period. This was very similar to the previous one. Instead of specifying a fixed radius size, I substituted it with the clock variable.

sphere { <0, 0, 0>, 0.5*(1+clock) }

This animation increases the reflection on the red ball. This is also very similar to the previous animations.

sphere { 
        <0, 0, 0>, 3 
        texture {
                pigment { color Red }
                finish {  
                        reflection 0.5*(clock)
                }    
        }      

This animation makes it seem like we are getting closer and closer to the cue ball. It almost seems as if we are playing and are trying to get close to the cue ball in order to line up our cue stick with the ball we want to hit.

camera {
        location <0,-20,-10+clock>           
        look_at 0          
        angle 120
}   

Unfolding Cube

I originally had 20 different POV-Ray files that had the code for each frame. In order to consolidate the code, Professor O'Rourke and I found that we could create an array in POV-Ray that could store each frame of the cube. We successfully implemented this for 2 frames in the animation. The new file will contain all of the frames and I will use the clock variable to create an "animation." By this, I mean that the clock variable will allow POV-Ray to output each frame so that we can combine them.

iMovie

After some research, I found that one of the easiest ways to string together the separate frames was to use iMovie. I found that I needed to upload the images to iPhoto first, which isn't a problem since all Macs come with iLife. However, I found that iMove doesn't recognize the .bmp image file that POV-Ray outputs. In order to fix this problem, I have to change the image file format to something else (possibly either .jpg or .gif). Once I change the file format, I will try using iMovie again. I googled the best ways to string the images together and many people recommended either iMovie or Quicktime Pro.

I converted all of the .bmp image files to .jpg image files and imported all of them to iPhoto. After importing them to iPhoto, I then imported the images to iMovie. In the end, an animation does appear, but I don't think that the image quality is very good.

I am not sure if the output from Quicktime Pro will be any better than this. I may have to start looking into other programs that can string together images. Maybe the image conversion also caused the image quality to decrease.

These animations were created with the .png files when rendering the images from POV-Ray.

One thing that bothers me about iMovie is that the automatic setting for still is the Ken Burns crop effect. In order to stop this from happening, you need to select all of the frames and then change the crop settings from "Ken Burns" to "Fit."

2/27/11

I am getting close to the final stages of completing this animation and now I have to figure out what is the best way to make the object look like paper. I originally had the paper be colored a light steel blue, which was fine for testing purposes. However, in order to make this into a high quality image/animation, I need the object to look more like paper.

After taking a look at the discussion link that Professor O'Rourke posted to the wiki, I found a website that had some images that the author had used to make an object look like it was paper. I tried out a couple of different images and found that the rice_paper.jpg looked the more realistic. So, the animation that is posted below shows the animation of the object with the rice_paper.jpg image mapped onto it.

4/4/11

In this animation (where a cube transforms into a cross), I used the same textures/images as the previous animation that I created. There are 30 frames that last for about 0.5 seconds each.

One thing that was different about this animation vs. the cube to parallelogram animation were the camera settings. I had to move the camera a bit in the z axis. Also, I noticed that when the cube was unfolding, the original top part of the cube kept sinking into the table. So, the way that I fixed this was to rotate the entire cube, which I put into the "cubeFinish.pov."

Cube to Cross

Cube to Parallelogram

After successfully getting the unfolding cube animation to work, I decided to start on the cube to parallelogram transformation. I tried exporting 20 frames. It seems like after a certain number of frames, the animation starts to get chopped up. I think this error occurs somewhere in Mathematica because when run the animation there, towards the end I see the same results.

Because of the error that I saw in the frames, I decided to make 2 animations from iMovie. One with all 20 frames that I exported and another with only 6 of the frames that I exported. These frames were all rendered as .jpg files from POV-Ray.

The second animation is the one that only consists of 6 frames and it passes by quite quickly. If the animation needs to be extended, I will probably have to export more frames and take the first quarter of the frames or so.


After some changes to the Mathematica notebook was made, I re-did the animations so that it would look smoother. There are a total of 25 frames per each animation. The first one only has 2 light sources so it looks a lot darker than the second one which has 3 light sources.

MathGL3d

While researching on how to export from Mathematica to POV-Ray, I kept reading about a free program called MathGL3d. After seeing it a couple of times, I decided to look into it and see what it was. It is a interactive 3D-graphics add-on for Mathematica. This add-on allows for real-time interaction with the graphics with features such as rotation, animation, visual viewpoint, and light-source editing. Any of the OpenGL-rendered images can be pasted into the Mathematica notebook and be saved as a PNG or EPS bitmap pictures. This program can export to POV-Ray. Information Taken from Here

Embedding a Youtube Video on a Web Page

This was much easier to accomplish than I had previously thought.

This link gives instructions on how to embed a youtube video onto your website.

  • Find the "Embed" box that is located in the "About this Video" section
  • Copy the HTML code in the box
  • Paste it into your HTML file

Your video should now be on your web page.

You can change the height and width of your video by editing the "height" and "width" fields of the object tag. You also need to change the height and width in the embed tag as well. Don't forget to do that or else the size of the embedded player will remain the same!

Also keep in mind that you want to keep the same height to width ratio (as the default numbers). That way the video won't get stretched out. Youtube suggests multiplying the width by 0.8235 to get the height. Round it to the nearest whole number.

Example: Rice Paper

POV-Ray Files

The following files use this following rice paper image to map around the object that is being unfolded to give a paper-like effect.

Note: .ini files do not work with Mega-POV on the Macs. In order to make this work, I had to use POV-Ray on a Windows machine.

Cube to Cross

In this set of POV-Ray files, I used the .ini file to "animate" the cube unfolding. This is easier than creating an x number (x depends on the number of frames that you want) because instead of having to render an x number of files, you can simply render the .ini and it will render all the frames of your animation.

  • .ini File
    • This .ini file contains all of the necessary information that has to do with creating the number of frames you want using the clock variable
  • Main File
    • This .pov file includes all of the necessary information (camera, light, data, finishes, radiosity, and table) needed in order to create the frames of the animation
    • The only things specified in this file are the background color (which isn't necessarily needed since we see a never-ending table surface) and a line that tells the .ini file what frames to render
  • Camera/Light File
    • This .pov file contains all of the information necessary for camera position and light settings
  • Cube Finish File
    • This .pov file contains the information necessary to make the cube look like it is made out of paper
    • For this particular file, it also contains the information that rotates the cube so it looks like it is unfolding on top of the table rather than through it
  • Data File
    • This .pov file is probably the most important because this contains all of the information that is necessary to construct the cube (which is made out of triangles)
    • All of the frames are put into an array, which the clock variable will call on in the main.pov to create the separate x number of frames (in this case 30)
  • Radiosity File
    • This .pov file has all of the information that makes the image look more realistic
  • Table File
    • This .pov file contains all of the information that is needed to create the table-like surface the cube is unfolding on

Cube to Cross Animation (slow)

Cube to Cross Animation (faster)

Z-Shape to Parallelogram

In this set of POV-Ray files, I originally had 25 different .pov files in order to create each frame. However, it is much easier to create a .ini file like I did for the cube to cross animation. I am going to post the version that uses the .ini file. However, I will include an example of what one .pov file containing one frame would look like.

  • .ini File
    • This .ini file contains all of the necessary information that has to do with creating the number of frames you want using the clock variable
  • Main File
    • This .pov file includes all of the necessary information (camera, light, data, finishes, radiosity, and table) needed in order to create the frames of the animation
    • The only things specified in this file are the background color (which isn't necessarily needed since we see a never-ending table surface) and a line that tells the .ini file what frames to render
  • Camera/Light File
    • This .pov file contains all of the information necessary for camera position and light settings
  • Cube Finish File
    • This .pov file contains the information necessary to make the z-shape look like it is made out of paper
    • It also includes the information necessary to rotate the object so it looks like it is folding on the table
  • Data File
    • This .pov file is probably the most important because this contains all of the information that is necessary to construct the shapes from the z-shape to the paralleogram (which is made up of triangles)
    • All of the frames are put into an array, which the clock variable will call on in the main.pov to create the separate x number of frames (in this case 25)
  • Radiosity File
    • This .pov file has all of the information that makes the image look more realistic
  • Table File
    • This .pov file contains all of the information that is needed to create the table-like surface the z-shape is folding on

Z-Shape to Parallelogram

Cube to Z-Shape

  • .ini File
    • This .ini file contains all of the necessary information that has to do with creating the number of frames you want using the clock variable
  • Main File
    • This .pov file includes all of the necessary information (camera, light, data, finishes, radiosity, and table) needed in order to create the frames of the animation
    • The only things specified in this file are the background color (which isn't necessarily needed since we see a never-ending table surface) and a line that tells the .ini file what frames to render
  • Camera/Light File
    • This .pov file contains all of the information necessary for camera position and light settings
  • Cube Finish File
    • This .pov file contains the information necessary to make the cube look like it is made out of paper
    • For this particular file, it also contains the information that rotates the cube so it looks like it is unfolding on top of the table rather than through it
  • Data File
    • This .pov file is probably the most important because this contains all of the information that is necessary to construct the cube (which is made out of triangles)
    • All of the frames are put into an array, which the clock variable will call on in the main.pov to create the separate x number of frames (in this case 30)
  • Radiosity File
    • This .pov file has all of the information that makes the image look more realistic
  • Table File
    • This .pov file contains all of the information that is needed to create the table-like surface the cube is unfolding on

Cube to Z-Shape Animation

How To Fold It Web Page

The image below is a very rough idea of what the web page would look like.

Draft of Web Page



Questions

  • Rounded corners for the "book"
  • Color scheme
    • Take picture of the actual book to use the exact colors
  • Dimensions
  • Bad idea to use iframes

CSS

Videos

I found a video of a finished 3D animation that someone did by constructing in Mathematica and then exporting to POV-Ray.

Links

Useful Links

Mathematica's Documentation

Exporting from Mathematica to POV-Ray

The following information came from the Mathematica Documentation Center.

  • Export["file.pov", expr] exports a Graphics3D object to a POV file.
  • Export["file.pov", expr, elem] creates a POV file by treating expr as specifying element elem.
  • Export["file.pov", {expr1, expr2, ...}, {elem1, elem2, ...}] treats each expri as specifying the corresponding elemi.
  • Export["file.pov", expr, opt1->val1] exports expr with the specified option elements taken to have the specified values.
  • Export["file.pov", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.