POV-Ray : Newsgroups : povray.newusers : how to generate transparent image : Re: how to generate transparent image Server Time
16 Apr 2024 06:12:11 EDT (-0400)
  Re: how to generate transparent image  
From: zhekai
Date: 21 Feb 2017 18:05:01
Message: <web.58acc5fb86bdcb1c311e660@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Do you have a sky sphere?
> I know I had problems the first time I tried this - I'd have to go dig up a
> relevant scene file to give you specifics.

Thanks for the reply. I did use sphere. But I am not sure if it is the same as
the "sky sphere". Here is my mini example, and I used "-W1920 -H1080 -A0.3 +UA"
to rendering it:
_______________________________________________
#include "colors.inc"
camera {
 orthographic
 location <300,5,5>
 look_at <0,5,5>
 sky <0,1,0>
 right <4/3,1,0>*20
 up <0,1,0>*20
}
light_source {<30,100,20> color White}
light_source{<500, 500, 0> color White}
light_source{<30,0,-20> color White}
light_source{<0,-5,35> color White}


#default {
 texture{
  pigment {rgb 1}
  finish {
   ambient 0.01
   diffuse 0.55
   specular 0.9 roughness 0.001
   reflection {0.0 1.0 fresnel on }
   conserve_energy
  }
 }
}
#macro Raster(RScale, HLine)
 pigment{ gradient x scale RScale
  color_map{[0.000   color rgbt<1,1,1,1>*0.4]
   [0+HLine color rgbt<1,1,1,1>*0.4]
   [0+HLine color rgbt<1,1,1,1>]
   [1-HLine color rgbt<1,1,1,1>]
   [1-HLine color rgbt<1,1,1,1>*0.4]
   [1.000   color rgbt<1,1,1,1>*0.4]} }
 finish { ambient 0.15 diffuse 0.85}
 #end// of Raster(RScale, HLine)-macro
//-------------------------------------------------------------------------
#declare RasterScale = 1.0/2;
#declare RasterHalfLine  = 0.035;
#declare RasterHalfLineZ = 0.035;

plane { <1,0,0>, -20    // plane with layered textures
 texture { pigment{color rgbt<1,1,1,0.2>}
  finish {ambient 1.0 diffuse 0.55}}
// texture { Raster(RasterScale,RasterHalfLine ) rotate<0,0,0> }
// texture { Raster(RasterScale,RasterHalfLineZ) rotate<0,90,0>}
 rotate<0,0,0>
 no_shadow
 }

#macro Axis_( AxisLen, Dark_Texture,Light_Texture)
union{
 cylinder { <0,-AxisLen,0>,<0,AxisLen,0>,0.05
  texture{checker texture{Dark_Texture }
   texture{Light_Texture}
   translate<0.1,0,0.1>}
 }
 cone{<0,AxisLen,0>,0.2,<0,AxisLen+0.7,0>,0
  texture{Dark_Texture}
  }
 } // end of union
#end // of macro Axis()
#macro AxisXYZ( AxisLenX, AxisLenY, AxisLenZ, Tex_Dark, Tex_Light)
//--------------------- drawing of 3 Axes --------------------------------
union{
#if (AxisLenX != 0)
object { Axis_(AxisLenX, Tex_Dark, Tex_Light)   rotate< 0,0,-90>}// x-Axis
text   { ttf "arial.ttf",  "y",  0.15,  0  texture{Tex_Dark}
 rotate< -90,180,-180> scale 0.5 translate <AxisLenX+0.05,-0.4, 0.40>}
#end // of #if
#if (AxisLenY != 0)
object { Axis_(AxisLenY, Tex_Dark, Tex_Light)   rotate< 0,0,  0>}// y-Axis
text   { ttf "arial.ttf",  "x",  0.15,  0  texture{Tex_Dark}
 rotate<90, 0,90>  scale 0.5 translate <-0.40,AxisLenY+0.20,0.50>}
#end // of #if
#if (AxisLenZ != 0)
object { Axis_(AxisLenZ, Tex_Dark, Tex_Light)   rotate<90,0,  0>}// z-Axis
text   { ttf "arial.ttf",  "z",  0.15,  0  texture{Tex_Dark}
 rotate<-90,0,180>  scale 0.5 translate <-0.4,0.0,AxisLenZ+0.10>}
#end // of #if
} // end of union
#end// of macro AxisXYZ( ... )
//------------------------------------------------------------------------

#declare Texture_A_Dark  = texture {
  pigment{color rgb<1,0.25,0>}
  finish {ambient 0.15 diffuse 0.85 phong 1}
  }
#declare Texture_A_Light = texture {
  pigment{color rgb<1,1,1>}
  finish {ambient 0.15 diffuse 0.85 phong 1}
  }

#macro GenSphere(Pos,Radius,Phi,Theta,Psi,Color)
 sphere {
  <0,0,0> Radius
  texture{ pigment { Color }
  }
 interior { ior 1.5 }

 translate Pos
}

#end

GenSphere (<1.51558, 2.14785, 5.24406>, 0.0606591, 0, 0, 0, rgb<0, 0, 0.832>)
GenSphere (<1.19626, 0.43805, 3.26232>, 0.133686, 0, 0, 0, rgb<0.688, 1, 0.312>)
GenSphere (<1.91334, 2.09569, 11.7824>, 0.0866581, 0, 0, 0, rgb<0, 0.496, 1>)
GenSphere (<0.86283, 0.465371, 6.85586>, 0.0695054, 0, 0, 0, rgb<0, 0.056, 1>)
GenSphere (<0.598038, 0.6617, 8.13589>, 0.0921074, 0, 0, 0, rgb<0, 0.632, 1>)
GenSphere (<0.766687, 1.89662, 3.35703>, 0.133602, 0, 0, 0, rgb<0.688, 1,
0.312>)
GenSphere (<1.93315, 1.02335, 8.97414>, 0.066854, 0, 0, 0, rgb<0, 0, 0.992>)
GenSphere (<0.210902, 1.62313, 9.50156>, 0.0713436, 0, 0, 0, rgb<0, 0.104, 1>)
GenSphere (<1.87113, 1.91253, 13.7022>, 0.12891, 0, 0, 0, rgb<0.568, 1, 0.432>)
GenSphere (<1.36497, 2.17113, 2.72943>, 0.0684504, 0, 0, 0, rgb<0, 0.032, 1>)
GenSphere (<0.799191, 1.24155, 2.94372>, 0.0965757, 0, 0, 0, rgb<0, 0.744, 1>)
GenSphere (<1.89194, 0.330974, 11.5185>, 0.106273, 0, 0, 0, rgb<0, 0.992, 1>)
GenSphere (<1.0336, 1.02171, 12.457>, 0.0667336, 0, 0, 0, rgb<0, 0, 0.992>)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.