// Persistence of Vision Ray Tracer Scene Description File // File: 3DStars.pov // Vers: 3 // Desc: Adds Random 3d stars // Date: 10/7/96 // Auth: Jason Widdy // ==== Standard POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions #declare R1 = seed(1701) //Any number #declare R2 = seed(2000) //Any number #declare Dis = 100000 // Distance #declare Count=0 #while (Count < 5000) //Number of stars #declare Xzang= rand(R1)*360 #declare Yang= (rand(R2)*180)-90 // For space //#declare Yang= rand(R2)*90 // For a starry night #declare Adis= (cos(radians(Yang)))*Dis #declare Tmpy= (sin(radians(Yang)))*Dis #declare Tmpx= (cos(radians(Xzang)))*Adis #declare Tmpz= (sin(radians(Xzang)))*Adis sphere { <0, 0, 0> 0.5 scale 400 // Scale to what ever you want translate < Tmpx, Tmpy, Tmpz> pigment { color White } finish { ambient 1.0 diffuse 0.0 } } #declare Count=Count+1 #end camera { location // location <0.0 , 0.0 ,-5.0> look_at <0.0 , 0.0 , 0.0> } light_source { 0*x color red 1.0 green 1.0 blue 1.0 translate <-20, 40, -20> } sphere // A simple test planet { <0, 0, 0> 2 pigment {color White} } // End /* Note from Jason: I was playing with the idea of writting a c program to write 3D star scenes, but one day I was looking through the PovRay3 docs and found the new programing commands and found out that I can put the program into a scene file. The scene above can be animated to see the 3d stars at work. Note from Constantine: I personally find that setting Count (the number of stars) at 15000 and setting the radii of the stars at 0.25 looks more realistic. However, this means it takes quite a while just to parse the file (up to about 2 minutes longer!), though the rendering speed doesn't seem to be affected. I also find that setting the colour of the stars as Grey instead of White makes them come out a little less harsh. But twiddle around with the values as you like, and let Jason know what you think of his program (his email address is in the header). One more thing - I think it's best to use this as an #include file. */