POV-Ray : Newsgroups : povray.general : non spherical sphere Server Time
26 Nov 2024 11:41:29 EST (-0500)
  non spherical sphere (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: daedalouse
Subject: non spherical sphere
Date: 30 Nov 2010 11:35:01
Message: <web.4cf52768a337373dcbe06a8f0@news.povray.org>
Hi everybody,

I have the following toy scene, but it does not produce the correct output: the
sphere is not a sphere but an egg! what am I doing wrong? anyone help me?

thanks!

here the scene:

#include "colors.inc"
#include "stones.inc"
#include "woods.inc"
#include "textures.inc"
background { color White}
camera {
 location <50,0,0>
  look_at <0,0,0>}
light_source {
   <20, 0, 0> color White
}


sphere {
<0,0,0> , 21
pigment {
color rgbt <1,1,1,0.7> }}


Post a reply to this message

From: Stephen
Subject: Re: non spherical sphere
Date: 30 Nov 2010 13:18:22
Message: <4cf53fee$1@news.povray.org>
On 30/11/2010 4:33 PM, daedalouse wrote:
> I have the following toy scene, but it does not produce the correct output: the
> sphere is not a sphere but an egg! what am I doing wrong? anyone help me?
>

It could be due to the aspect ratio of your image. Read the docs 3.3.1 
Camera, especially 3.3.1.1.5  Up and Right Vectors, 3.3.1.1.6  Aspect Ratio.
Try adding, "right  <1.33,0,0>" to your camera statement if your aspect 
ratio is 4:3



-- 
Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: non spherical sphere
Date: 30 Nov 2010 13:33:11
Message: <4cf54367@news.povray.org>

> Hi everybody,
>
> I have the following toy scene, but it does not produce the correct output: the
> sphere is not a sphere but an egg! what am I doing wrong? anyone help me?
>
> thanks!
>
> here the scene:
>
> #include "colors.inc"
> #include "stones.inc"
> #include "woods.inc"
> #include "textures.inc"
> background { color White}
> camera {
>   location<50,0,0>
>    look_at<0,0,0>}
> light_source {
>     <20, 0, 0>  color White
> }
>
>
> sphere {
> <0,0,0>  , 21
> pigment {
> color rgbt<1,1,1,0.7>  }}
>
>

You render that at what resolution? With what aspect ratio?
If I render it with a classical 4:3 aspect ratio, then the sphere 
actualy looks circular.
But, if I render at 100 by 50, I get an hirizontal elliptical image. If 
you render a square image, or a prortrait, then you ger a vertical ellipse.

You can adjust the aspect ratio by adding the following to your camera:
up y
right x
This example is for a square image.
Some more examples follows:

up 2*y right x // for a 1:2 aspect ratio, tall and narrow.
up y right x*3/4 // 3:4 ratio, portrait.
up y right 3*x // for a 3:1 aspect ratio, prety whide image.
up y right x*4/3 // Normal 4:3 aspect ratio.

Another thing:
Whenever a sphere is NOT at the center of the scene, it will appears 
elliptical. It's normal. Your scene is projected onto a plane. A sphere 
define a cone and a cone-plane intersection at a non-perpendidular angle 
is an ellipse.
Sample to illustrate that effect:
replace your sphere with this:
union{
sphere{0,3 pigment{rgb<0.1, 0.3, 1>}}
sphere{<0,9,0>,3}
sphere{<0,-9,0>,3}
sphere{<0,9,9>,3}
sphere{<0,-9,9>,3}
sphere{<0,9,-9>,3}
sphere{<0,-9,-9>,3}
sphere{<0,0,-9>,3}
sphere{<0,0,9>,3}
pigment{rgb<0.2,1,0.3>}
scale 2
}
Here, only the center (blue) sphere looks circular. The "distortion" is 
normal and should be expected.


Alain


Post a reply to this message

From: Stephen Klebs
Subject: Re: non spherical sphere
Date: 5 Dec 2010 19:15:01
Message: <web.4cfc2a39321c6322fc413f510@news.povray.org>
Another trick: If you're using the standard up y perspective camera, by adding:
right x*image_width/image_height
to the camera statement, it will adapt to whatever aspect ratio you choose.


Post a reply to this message

From: Warp
Subject: Re: non spherical sphere
Date: 6 Dec 2010 13:22:11
Message: <4cfd29d2@news.povray.org>
Stephen Klebs <skl### [at] gmailcom> wrote:
> Another trick: If you're using the standard up y perspective camera, by adding:
> right x*image_width/image_height
> to the camera statement, it will adapt to whatever aspect ratio you choose.

  There are several reasons why you don't want to do that.

http://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_19

-- 
                                                          - Warp


Post a reply to this message

From: daedalouse
Subject: Re: non spherical sphere
Date: 7 Dec 2010 08:40:00
Message: <web.4cfe38ac321c6322cbe06a8f0@news.povray.org>
Many thanks to your numerous replies!

But it did not work out. I render with Width=1280 Height=1024.
Btw: it looks quite spherical at the first glance, but if you measure you see
cleary that it is an egg!!

any other ideas?

thanks!


PS:I know that spheres which are not centered will become ellipses when
projected, but my sphere is perfectly centered.


Post a reply to this message

From: scott
Subject: Re: non spherical sphere
Date: 7 Dec 2010 08:56:28
Message: <4cfe3d0c$1@news.povray.org>
>  There are several reasons why you don't want to do that.
>
> http://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_19

Did you write that FAQ? You seem to promote it an awful lot.  It also seems 
to assume you've already completed your scene, using "right 
x*image_width/image_height" is very useful whilst developing a scene, as it 
saves you having to adjust the camera block each time you want to render at 
a different aspect (I assume nearly everyone renders to square pixels).


Post a reply to this message

From: scott
Subject: Re: non spherical sphere
Date: 7 Dec 2010 09:02:00
Message: <4cfe3e58$1@news.povray.org>
> But it did not work out. I render with Width=1280 Height=1024.
> Btw: it looks quite spherical at the first glance, but if you measure you 
> see
> cleary that it is an egg!!
>
> any other ideas?

How are you measuring the dimensions of the sphere?


Post a reply to this message

From: Le Forgeron
Subject: Re: non spherical sphere
Date: 7 Dec 2010 09:20:45
Message: <4cfe42bd@news.povray.org>
Le 07/12/2010 14:37, daedalouse a écrit :
> But it did not work out. I render with Width=1280 Height=1024.

If you are rendering the scene at the root of the thread, it cannot work
with +W1280 +H1024

1280 / 1024 is a 5:4 ratio.
Default (3.6) ratio is 4:3;
No Cigare!


You need (notice, 1 more line!):

#include "colors.inc"
#include "stones.inc"
#include "woods.inc"
#include "textures.inc"
background { color White}
camera {
 location <50,0,0>
 right x*image_width/image_height
  look_at <0,0,0>}
light_source {
   <20, 0, 0> color White
}


sphere {
<0,0,0> , 21
pigment {
color rgbt <1,1,1,0.7> }}


-- 
A: Because it messes up the order in which people normally read text.<br/>
Q: Why is it such a bad thing?<br/>
A: Top-posting.<br/>
Q: What is the most annoying thing on usenet and in e-mail?


Post a reply to this message

From: Alain
Subject: Re: non spherical sphere
Date: 7 Dec 2010 19:45:30
Message: <4cfed52a$1@news.povray.org>

>> There are several reasons why you don't want to do that.
>>
>> http://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_19
>>
>
> Did you write that FAQ? You seem to promote it an awful lot. It also
> seems to assume you've already completed your scene, using "right
> x*image_width/image_height" is very useful whilst developing a scene, as
> it saves you having to adjust the camera block each time you want to
> render at a different aspect (I assume nearly everyone renders to square
> pixels).
>
>

As long as only YOU render a scene, then, it's ok.
If you create your scene and you plan to have it rendered at various 
aspect ratio, then it's also workable. You made it so that it's complete 
even if parts are not visible, and it's modeled outside the visible area.

If you create a scene using a specific aspect ratio and publish it, then 
it's not ok anymore.


Alain


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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