// Persistence of Vision Raytracer Version 3.5 Scene Description File // File: interpol.pov // Last updated: 23. Oct. 2001 // Authors: Wlodzimierz ABX Skiba // Description: From one range to the other with Interpolate macro from math.inc //******************************************* #version 3.5; #include "stdinc.inc" //------------------------------------------- global_settings { assumed_gamma 1 } #default { finish { ambient 1 diffuse 0 } } //------------------------------------------- // Number of graphs #declare MaxLevel=5; // The aspect ratio of the image. #declare AspectRatio = image_width/image_height; // Half of the "thickness" of the lines #declare Size = 0.006; // Ranges #declare XMin=-.75; #declare XMax=.75; #declare YMin=-.5; #declare YMax=1; #declare ImageMax=2.1*max(max(abs(XMin),abs(XMax)),max(abs(YMin),abs(YMax))); // colors for graphs #declare Colors=array[MaxLevel]{ color Red, color DarkGreen, color Blue, color Brown, // color Yellow, // color Cyan, // color Gray, // color Magenta, // color Khaki, color Black } // if animation than use Interpolate to return from frame numbers to <0,1> range // otherwise take arg=.5; #if(clock_on=0) #declare Arg=.5; #else #declare Arg=Interpolate(frame_number,initial_frame,final_frame,0,1,1); #end // Frame macro #macro FramePart(P0,P1) union{ sphere{P0 Size} cylinder{P0 P1 Size} } #end #macro Frame(X0,Y0,X1,Y1) union{ FramePart(,) FramePart(,) FramePart(,) FramePart(,) } #end // Get Point of result for arg #macro Result(Arg,Type) #end #macro Print(String) text{ttf "timrom.ttf" String 1, 0 scale .1} #end #macro PrintValue(Arg,Level) #local R=Result(Arg,Level); union{ Align_Object(Print(str(R.y,0,-1)),-x+y,) Align_Object(Print(concat("Type ",str(Level,0,0))),x+y,) sphere{R,4*Size} pigment{color Colors[Dims]} } FramePart(,) #end // Graph union{ // Frame for graph Frame(XMin,YMin,XMax,YMax) // cursor #local X=Interpolate(Arg,0,1,XMin,XMax,1); FramePart(,) // legend Align_Object(Print("XMin"),-x+y,) Align_Object(Print("XMax"),x+y,) Align_Object(Print("YMin "),x-y,) Align_Object(Print("YMax "),x+y,) Align_Object(Print("Arg="),x+y,) Align_Object(Print(str(X,0,-1)),-x+y,) #local Dims=MaxLevel-1; #while (Dims>=0) PrintValue(Arg,Dims) #local Dims=Dims-1; #end Align_Object(Print("Interpolate(Arg,XMin,XMax,YMin,YMax,Type)"),-x+y,) pigment{color .75*Gray} } // initialize #local LastPoints=array[MaxLevel] #local Dims=MaxLevel-1; #while (Dims>=0) #local LastPoints[Dims]=; #local Dims=Dims-1; #end // create Graph for interpolations #local Counter=Size; #while (Counter<1) #local Dims=MaxLevel-1; #while (Dims>=0) #local CurrentPoint=Result(Counter,Dims); object{ FramePart(CurrentPoint,LastPoints[Dims]) pigment{color Colors[Dims]} } #local LastPoints[Dims]=CurrentPoint; #local Dims=Dims-1; #end #local Counter=Counter+Size; #end camera { orthographic right ImageMax*x*AspectRatio up ImageMax*y location -z look_at <0, 0, 0> } background { color White}