/* File: MyButton.pov Author: Eric Ferrante Purpose: Intended to teach POV-Ray commands. Supplement to http://iocon.com/ferrante/how.html FIRST YOU NEED TO LEARN HOW TO CREATE A CUSTOM OUTPUT WINDOW SIZE Ok, choose Render--> Edit Settings/Render from the menu above, then click the Edit button. Now paste the following into the file and save it. [200x24, My Button, AA 0.3] Width=200 Height=24 Antialias=On Antialias_Threshold=0.3 [500x60, My Button, AA 0.3] Width=500 Height=60 Antialias=On Antialias_Threshold=0.3 Go back to Render--> Edit Settings/Render and choose [500x60, My Button, AA 0.3] from the pulldown menu. Click Render to see the scene. If you need to render a scene over and over for testing, then go back to the Edit Setting/Render menu and on the bottom line (command line options) type Antialias=off. That will speed things up. Erase it when you want a smooth picture again. Use [500x60, My Button, AA 0.3] for previewing. Use [200x24, My Button, AA 0.3] for button size. */ // By the way, this a comment and so is everthing between /*....*/ Otherwise the computer // will try to read this text as a command and you'll get errors. #version 3 #include "colors.inc" // Need this to use Red and Gold #include "stones2.inc" // Need this to use T_Stone40 texture #declare PI = 3.14159 // These are constants. I made them up. #declare INTERVAL = 2*PI/20 // We'll be using them for animation later. #declare MAX_ANGLE = 6 #declare THICKNESS = 0.5 camera { location <0, 0, -8.5> direction 4.5*z right 500/60*x look_at <0,-0.25,0> } background { Black } light_source { < 5, -50, -15> color White } light_source { <-50, 10, -10> color White } light_source { < 0, 50, -100> color White } text { // Try a different font and translate it to fit the button. #declare MyText = "My Button!" #declare MyFont = "c:\windows\fonts\times.ttf" ttf MyFont, MyText, THICKNESS, 0 // Draws the text translate <-2.3, -0.5, -0.5> // Center it translate MAX_ANGLE*sin(clock)*z scale <1.5, 1.4, 1> // Stretch it out texture { T_Stone40 } // Add a texture (more interesting than plain pigment) finish { phong 0.5 ambient 0.93 } // phong makes it shiny and ambient makes it glow with // its natural color (rather than from the lights) } object { sphere { <0,0,0>, 0.25 } // If you want another button shape, try a superellipsoid or cube scale <17, 3, 1> rotate MAX_ANGLE*sin(clock)*y translate <0, -0.25, 0.2> pigment { Red } finish { phong 0.8 ambient 1 } }