POV-Ray : Newsgroups : povray.advanced-users : Spherical camera Server Time
23 Nov 2024 22:34:36 EST (-0500)
  Spherical camera (Message 1 to 5 of 5)  
From: MadKairon
Subject: Spherical camera
Date: 17 Sep 2010 14:00:01
Message: <web.4c93ac0af7294bb1c1bde3960@news.povray.org>
Hello, I have this scene:

#include "colors.inc"

camera { spherical location .5 up <0,1,0> right<1,0,0> look_at <0,-1,0>}

#declare Sculptcolors = texture {
                          pigment {
                            average
                            pigment_map { //[1 gradient x color_map {[0 rgb 0][1
rgb <1,0,0>]}]
                                          [1 gradient y color_map {[0 rgb
<0,0,0>][1 rgb <0,0,1>]}]
                                          //[1 gradient z color_map {[0 rgb 0][1
rgb <0,1,0>]}]
                                        }
                                  }
                                finish { ambient 1 diffuse 0 }
                                }

sphere { .5 .5 no_image texture{Sculptcolors}}

sphere { .5, 1.001 inverse finish { ambient 0 diffuse 0 reflection 1 }}

basicalle it creates a sphere with a black to blue gradient on the y axis. This
sphere is hidden but it's image is reflected onto another one. Then I use a
spherical camera in the center, looking down and render it at a res of 128x128
pixels. The rendered image should be a small square looking black in the center
and blue near the edges... but that's not what happens. I think I'm not setting
my camera correctly. Anybody knows where is my mystake? Thanks!



Post a reply to this message

From: clipka
Subject: Re: Spherical camera
Date: 17 Sep 2010 14:39:36
Message: <4c93b5e8$1@news.povray.org>
Am 17.09.2010 19:57, schrieb MadKairon:
> Hello, I have this scene:
>
> #include "colors.inc"
>
> camera { spherical location .5 up<0,1,0>  right<1,0,0>  look_at<0,-1,0>}
>
> #declare Sculptcolors = texture {
>                            pigment {
>                              average
>                              pigment_map { //[1 gradient x color_map {[0 rgb 0][1
> rgb<1,0,0>]}]
>                                            [1 gradient y color_map {[0 rgb
> <0,0,0>][1 rgb<0,0,1>]}]
>                                            //[1 gradient z color_map {[0 rgb 0][1
> rgb<0,1,0>]}]
>                                          }
>                                    }
>                                  finish { ambient 1 diffuse 0 }
>                                  }
>
> sphere { .5 .5 no_image texture{Sculptcolors}}
>
> sphere { .5, 1.001 inverse finish { ambient 0 diffuse 0 reflection 1 }}
>
> basicalle it creates a sphere with a black to blue gradient on the y axis. This
> sphere is hidden but it's image is reflected onto another one. Then I use a
> spherical camera in the center, looking down and render it at a res of 128x128
> pixels. The rendered image should be a small square looking black in the center
> and blue near the edges... but that's not what happens. I think I'm not setting
> my camera correctly. Anybody knows where is my mystake? Thanks!

There are various things you should be aware of:

(1) The camera, as defined in your scene, does /not/ look directly down: 
You place it at location .5 = <.5,.5,.5>, looking at <0,-1,0>, so it is 
tilted slightly slightly sideways and towards the back (the direction 
vector is <-.5,-1.5,-.5>). That's why the darkest spot isn't at the center.

(2) The "spherical" camera is typically rendered at a 2:1 aspect ratio 
(e.g. 256x128 pixels), as it maps the scene to a "latitude/logitude" 
grid, ranging from -180 to +180 degrees and -90 to +90 degrees, 
respectively. You may of course have your reasons for using this camera 
type at a 1:1 aspect ratio, but it might just as well be an indicator 
that you haven't fully understood how the camera type works.

(3) As it is now, the scene could easily do without the reflective 
sphere: You could just as well make the main sphere visible and inverse 
itself (the latter is actually not even needed: With objects that have 
no IOR nor media, and ar neither CSG members nor unions, the "inverse" 
keyword doesn't make any difference whatsoever (unless you use an 
interior_texture, that is).


Post a reply to this message

From: MadKairon
Subject: Re: Spherical camera
Date: 17 Sep 2010 15:45:00
Message: <web.4c93c4dc1172e20dc1bde3960@news.povray.org>
lol, right!! I defined the look_at vector as a normal, silly me. And yeah, I
know about 2) and 3) I'm just trying to create scult maps (for Second Life
objects) from POV-Ray objects. That's why I need it this way. Thanks for the
help!! I'll try it in a few hours!


Post a reply to this message

From: MadKairon
Subject: Re: Spherical camera
Date: 18 Sep 2010 07:35:00
Message: <web.4c94a3001172e20dc1bde3960@news.povray.org>
Nop, it didn't work, I guess it's the perspective or the lens deformation. I
tryed with a box with the ggradients istead of the spere and I see deformation
of the sides in the final render. Any other way to make a good surface bake
render!


Post a reply to this message

From: SharkD
Subject: Re: Spherical camera
Date: 14 Jan 2011 13:25:00
Message: <web.4d3094bd1172e20dd70fe6f50@news.povray.org>
Try moving your scene so that the camera is located at the origin. Then you can
treat look_at as if it were a normal.


Post a reply to this message

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