//This file is designed to plot a graph similar to a graphing calculator. //Please note that the line used to graph must be in the math language used by POV-Ray, //not the notation used by most graphing calculators. (See POV-Ray's Float Functions in Help) #include "colors.inc" background {color Gray75} // Change the following parameters to change the way the graph is presented, then // proceed to line 42 to plot your graph #declare ViewSize=10; // Units across the screen and up and down #declare GraphUnits=1; // Changes how far apart the red dots are placed #declare DotsPerUnit=20; //Number of white dots per unit in X direction //WARNING! DO NOT MAKE THIS VALUE TOO HIGH!!! Render times will shoot through the roof. camera { location <0,0,-10> look_at <0,0,0> orthographic up <0,ViewSize,0> right } union { // Axis box { <-ViewSize,0.1,-0.1>, } box { <-0.1,ViewSize,-0.1>,<0.1,-ViewSize,0.1> } pigment {color Green/3} finish {ambient 1} } #declare X=-ViewSize ; #while (X < ViewSize) #declare Y=sin(X*pi*2)/2+0.5; // <---- CHANGE THIS LINE TO CHANGE THE GRAPH!!!!! (USE CAPITAL X & Y) box { <0.05,0.05,0.05>,<-0.05,-0.05,-0.05> pigment {color White} finish {ambient 1} translate x*X translate y*Y } #declare X=X+(1/DotsPerUnit); #end #declare Count2=0; //Marks red dots up and across the axis #while (Count2 < ViewSize) box { //Positive X Direction <-0.05,0.05,-0.15>,<0.05,-0.05,0.15> pigment {color Red} finish {ambient 1} translate x*Count2 } box { //Positive Y Direction <-0.05,0.05,-0.15>,<0.05,-0.05,0.15> pigment {color Red} finish {ambient 1} translate y*Count2 } box { //Negative X Direction <-0.05,0.05,-0.15>,<0.05,-0.05,0.15> pigment {color Red} finish {ambient 1} translate -x*Count2 } box { //Negative Y Direction <-0.05,0.05,-0.15>,<0.05,-0.05,0.15> pigment {color Red} finish {ambient 1} translate -y*Count2 } #declare Count2=Count2+GraphUnits; #end