POV-Ray : Newsgroups : povray.general : cylindrical camera: unexpected results Server Time
9 Aug 2024 13:25:52 EDT (-0400)
  cylindrical camera: unexpected results (Message 1 to 5 of 5)  
From: ryan constantine
Subject: cylindrical camera: unexpected results
Date: 25 Jul 2000 18:31:28
Message: <397E150F.9CECF0CC@yahoo.com>
i'm using camera3b.pov and camera3d.pov which come with pov as the basis
for my tests.  i have changed the camera to read as follows:

camera {
  cylinder 2  //as a comparison to type 4.
  angle 360   //i want total wrap around.
  location <0, 10, 0>  //middle of the object.
  right <15, 0, 0>  //long enough vector to poke out the end of the
cube.
  up <0, 6, 0>     //tall enough vector?
  direction <0, 0, 2.5>  //not sure what this does with
  look_at <10, 10, 0>  //this following it. notice i changed this.
}

i see what i expect; a curvy version of the cube thing and i can see all
of the sphere corners.  what i really want is to use cylinder type 4,
however the results are not what i expect.  what i expect to see is all
four corners with straight rods conecting them instead of the curved
ones from type 2.  all i get, however are four horizontal rods.  i don't
see any of the sphere-corners.  changing the right and up vectors has no
effect.

i am using the windows megapov 0.5a.


Post a reply to this message

From: Bob Hughes
Subject: Re: cylindrical camera: unexpected results
Date: 18 Aug 2000 17:21:53
Message: <399da8f1@news.povray.org>
Hi Ryan, saw you asking about this in the other group.

Been a long long time since I messed with those cylindrical cameras trying
to figure them out myself.  Haven't ever really used that besides.  You seem
to be wanting a spherical thing out of a cylindrical one though.  Guess I
just don't understand what the idea is.
That type of projection is meant to be wrappable onto a cylinder, if I'm
understanding it right.
Type 4 being horizontal and using 360 degree full field of view is going to
be confined to the dimensions of a cylinder no matter what.  Or so I believe
that is the way it goes.  Anyway, all 4 types should be likewise mappable,
thus only dimensioned, for cylinders.  So the trouble you're having might
have something to do with that.  The up and right keywords don't do anything
(I think not); only the angle or direction + right vectors do, depending on
which way you do the field of view.

Bob

"ryan constantine" <rco### [at] yahoocom> wrote in message
news:397E150F.9CECF0CC@yahoo.com...
| i'm using camera3b.pov and camera3d.pov which come with pov as the basis
| for my tests.  i have changed the camera to read as follows:
|
| camera {
|   cylinder 2  //as a comparison to type 4.
|   angle 360   //i want total wrap around.
|   location <0, 10, 0>  //middle of the object.
|   right <15, 0, 0>  //long enough vector to poke out the end of the
| cube.
|   up <0, 6, 0>     //tall enough vector?
|   direction <0, 0, 2.5>  //not sure what this does with
|   look_at <10, 10, 0>  //this following it. notice i changed this.
| }
|
| i see what i expect; a curvy version of the cube thing and i can see all
| of the sphere corners.  what i really want is to use cylinder type 4,
| however the results are not what i expect.  what i expect to see is all
| four corners with straight rods conecting them instead of the curved
| ones from type 2.  all i get, however are four horizontal rods.  i don't
| see any of the sphere-corners.  changing the right and up vectors has no
| effect.
|
| i am using the windows megapov 0.5a.


Post a reply to this message

From: Peter J  Holzer
Subject: Re: cylindrical camera: unexpected results
Date: 19 Aug 2000 10:01:04
Message: <slrn8pt3q1.ac9.hjp-usenet@teal.h.hjp.at>
On Tue, 25 Jul 2000 15:30:39 -0700, ryan constantine wrote:
>what i really want is to use cylinder type 4,
>however the results are not what i expect.  what i expect to see is all
>four corners with straight rods conecting them instead of the curved
>ones from type 2.  all i get, however are four horizontal rods.  i don't
>see any of the sphere-corners.  changing the right and up vectors has no
>effect.

Strange. It works (almost) fine for me (megapov 0.5a on linux). I can
see all horizontal rods, all spere corners, and two of the vertical
rods (one in the center of the image, the other is split at the top and
bottom of the image). I don't see the other two vertical rods, but I
think this is because the camera is intersecting them. If I move the
camera a bit, they appear.

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: ryan constantine
Subject: Re: cylindrical camera: unexpected results
Date: 30 Aug 2000 14:35:45
Message: <39AD5402.B9741184@yahoo.com>
could you post your camera code?

"Peter J. Holzer" wrote:
> 
> On Tue, 25 Jul 2000 15:30:39 -0700, ryan constantine wrote:
> >what i really want is to use cylinder type 4,
> >however the results are not what i expect.  what i expect to see is all
> >four corners with straight rods conecting them instead of the curved
> >ones from type 2.  all i get, however are four horizontal rods.  i don't
> >see any of the sphere-corners.  changing the right and up vectors has no
> >effect.
> 
> Strange. It works (almost) fine for me (megapov 0.5a on linux). I can
> see all horizontal rods, all spere corners, and two of the vertical
> rods (one in the center of the image, the other is split at the top and
> bottom of the image). I don't see the other two vertical rods, but I
> think this is because the camera is intersecting them. If I move the
> camera a bit, they appear.
> 
>         hp
> 
> --
>    _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
> |_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
> | |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
> __/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Peter J  Holzer
Subject: Re: cylindrical camera: unexpected results
Date: 3 Sep 2000 12:01:00
Message: <slrn8r4rmj.g94.hjp-usenet@teal.h.hjp.at>
[XP and Fup2 povray.unofficial.patches, since this seems to be a problem
of megapov only]

On Wed, 30 Aug 2000 11:35:46 -0700, ryan constantine wrote:
>"Peter J. Holzer" wrote:
>> 
>> On Tue, 25 Jul 2000 15:30:39 -0700, ryan constantine wrote:
>> >what i really want is to use cylinder type 4,
>> >however the results are not what i expect.  what i expect to see is all
>> >four corners with straight rods conecting them instead of the curved
>> >ones from type 2.  all i get, however are four horizontal rods.  i don't
>> >see any of the sphere-corners.  changing the right and up vectors has no
>> >effect.
>> 
>> Strange. It works (almost) fine for me (megapov 0.5a on linux).
                                           ^^^^^^^^^^^^^^^^^^^^^
Oops. I obviously used povray 3.1g when I tried that (I tried both with
several camera statements, but it seems I missed some combinations).

>could you post your camera code?

camera {
  cylinder 4
  angle 360
  location <0, 10, 0>
  right <20, 0, 0>  
  up <0, 6, 0> 
  direction <0, 0, 2.5>
  look_at <100, 10, 100>
  rotate <0, clock, 0>
}

With megapov the picture looks very strange. If the camera points
directly to one of the vertical rods, the rod fills the whole width of
the picture and I can see a mirror image of the other rods in it. If it
points between vertical rods, I see only the horizontal rods. 

Looks like the camera is much too narrow. 

Looking at the source, I see that this block has been added in megapov:

      /* 1999 July 10 Bugfix - as per suggestion of Gerald K. Dobiasovsky 
           added this if(Precompute_Camera_Constants) block */
      /* Get aspect ratio, normalize camera vectors  */
      if (Precompute_Camera_Constants)
      {
        VLength(lx, FCR);
        VLength(ly, FCU);

        /* The inverse of the usual aspect ratio */
        Camera_Aspect_Ratio = ly / lx;

        VNormalize(FCR, FCR);
        VNormalize(FCU, FCU);
        VNormalize(FCD, FCD);  /* If not normalized in "angle"-statement in parse.c */
      }
      /* ---- */

      /* 2000 May 8 Bugfix - added Camera_Aspect_Ratio */
      x0 /= Camera_Aspect_Ratio;

This is wrong for two reasons:

1) It tries to scale the cylinder in inverse proportion to its radius
(i.e, if you specified { up <0, 5, 0> right <20, 0, 0> } it gets transformed
into { up <0, 1, 0> right <4, 0, 0> }, which is totally unexpected.

2) The if (Precompute_Camera_Constants) block is obviously intended to
be entered only once (since it normalizes FCR and FCU,
Camera_Aspect_Ratio will always be 1 after the first pixel). 

Fixes:

1) Change 
        Camera_Aspect_Ratio = ly / lx;
   to
        Camera_Aspect_Ratio = lx;
    and 
      x0 /= Camera_Aspect_Ratio;
    to
      x0 *= Camera_Aspect_Ratio;

2) Add 
	Precompute_Camera_Constants = 0;
   at the end of the if-block.

This will restore the length of the right vector, but will normalize
the up vector (so the length of the up vector will be ignored, only its
direction counts).

If you just want the same behaviour as in povray 3.1g, remove the whole
normalization stuff. I don't see any problems with that.

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

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