File: float5.pov

package info (click to toggle)
povray 1%3A3.6.1-12
  • links: PTS
  • area: non-free
  • in suites: lenny, squeeze
  • size: 31,084 kB
  • ctags: 20,310
  • sloc: ansic: 110,032; cpp: 86,573; sh: 13,595; pascal: 5,942; asm: 2,994; makefile: 1,753; ada: 1,637
file content (72 lines) | stat: -rw-r--r-- 1,749 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//	Persistence of Vision Raytracer Version 3.5 Scene Description File
//	File: float5.pov
//	Author:
//	Description: Demonstrates various new float math functions and #while loop
// Modified for 3.5: changed "log()" to "ln()".
//
// -w320 -h240
// -w800 -h600 +a0.3

global_settings { assumed_gamma 1.0 }

#include "colors.inc"

#declare Rad=1/6;
#declare Font="cyrvetic.ttf"

#declare Xval=-6.0;

#while (Xval <= 6.0)
  sphere{<Xval,exp(Xval),0>,Rad pigment{Red}}

  #if (Xval != 0.0)
    sphere{<Xval,pow(Xval,-1),0>,Rad pigment{Green}}
  #end

  sphere{<Xval,pow(Xval,2),0>,Rad pigment{Blue}}
  sphere{<Xval,pow(Xval,3),0>,Rad pigment{Cyan}}

  #if (Xval > 0.0)
    sphere{<Xval,ln(Xval),0>,Rad pigment{Magenta}}
  #end

  #declare Xval=Xval+0.1;
#end

 text{ttf Font "Y=exp(X)",0.1,0    translate <-6.5, 0.5,0> pigment{Red}}
 text{ttf Font "Y=pow(X,-1)",0.1,0 translate <-6.5,-1.5,0> pigment{Green}}
 text{ttf Font "Y=pow(X,2)",0.1,0  translate <-6.5, 3,0>   pigment{Blue}}
 text{ttf Font "Y=pow(X,3)",0.1,0  translate <-6.5,-4,0>   pigment{Cyan}}
 text{ttf Font "Y=ln(X)",0.1,0    translate < 2.5, 2,0>   pigment{Magenta}}

camera {
   location  <0, 0, -120>
   direction <0, 0,  12>
   look_at   <0, 0,   0>
}

light_source { <5000, 10000, -20000> color White}
plane { -z, -Rad pigment {checker color rgb <1,.8,.8> color rgb <1,1,.8>} }

union{ // X-axis
 cylinder{-x*5.5,x*5.5,.1}
 cone{-x*6.5,0,-x*5.5,.2}
 cone{ x*6.5,0, x*5.5,.2}
 translate z*Rad
 pigment{rgb<1,.8,1>}
}

union{ // Y-axis
 cylinder{-y*4,y*4,.1}
 cone{-y*5,0,-y*4,.2}
 cone{ y*5,0, y*4,.2}
 translate z*Rad
 pigment{rgb<.8,1,1>}
}

union{ // Axes labels
 text{ttf Font "X",0.1,0 translate <5.5,-1,0>}
 text{ttf Font "Y",0.1,0 translate <-.75,4,0>}
 pigment{rgb<1,.4,0>}
}