POV-Ray : Newsgroups : povray.advanced-users : Changing viewpoint of cylindrical camera Server Time
31 Oct 2024 06:00:28 EDT (-0400)
  Changing viewpoint of cylindrical camera (Message 1 to 9 of 9)  
From: Sebastian Kasperski
Subject: Changing viewpoint of cylindrical camera
Date: 9 Sep 2008 06:49:25
Message: <48c654b5@news.povray.org>
Hello all,

i'm trying to render a simple scene using a cylindrical camera like the 
following one. It uses the cylinder type 1 (vertical cylinder with fixed 


camera
{
   cylinder 1
   angle 360
   up 1.1*y
   location <0,0,0>
   look_at  <0,0,1>
}

This works pretty fine. The only problem is, that the viewpoint is 
always centered within the cylinder. What I want to do, is to move the 
viewpoint up or down on the cylinder's axis. Is there a way to archieve 
this?

Best regards
Sebastian


Post a reply to this message

From: Alain
Subject: Re: Changing viewpoint of cylindrical camera
Date: 9 Sep 2008 21:42:32
Message: <48c72608$1@news.povray.org>
Sebastian Kasperski nous illumina en ce 2008-09-09 06:49 -->
> Hello all,
> 
> i'm trying to render a simple scene using a cylindrical camera like the 
> following one. It uses the cylinder type 1 (vertical cylinder with fixed 
> viewpoint) and a full 360° viewing angle.
> 
> camera
> {
>   cylinder 1
>   angle 360
>   up 1.1*y
>   location <0,0,0>
>   look_at  <0,0,1>
> }
> 
> This works pretty fine. The only problem is, that the viewpoint is 
> always centered within the cylinder. What I want to do, is to move the 
> viewpoint up or down on the cylinder's axis. Is there a way to archieve 
> this?
> 
> Best regards
> Sebastian
Have you tried to translate the camera up or down?

-- 
Alain
-------------------------------------------------
Elevators smell different to midgets


Post a reply to this message

From: Sebastian Kasperski
Subject: Re: Changing viewpoint of cylindrical camera
Date: 10 Sep 2008 05:17:41
Message: <48c790b5$1@news.povray.org>
Alain schrieb:
> Sebastian Kasperski nous illumina en ce 2008-09-09 06:49 -->
>> Hello all,
>>
>> i'm trying to render a simple scene using a cylindrical camera like 
>> the following one. It uses the cylinder type 1 (vertical cylinder with 
>> fixed viewpoint) and a full 360° viewing angle.
>>
>> camera
>> {
>>   cylinder 1
>>   angle 360
>>   up 1.1*y
>>   location <0,0,0>
>>   look_at  <0,0,1>
>> }
>>
>> This works pretty fine. The only problem is, that the viewpoint is 
>> always centered within the cylinder. What I want to do, is to move the 
>> viewpoint up or down on the cylinder's axis. Is there a way to 
>> archieve this?
>>
>> Best regards
>> Sebastian
> Have you tried to translate the camera up or down?
> 
I did, but this translates the whole camera (viewpoint and image plane). 
What I need is to keep the cylindrical image plane in its position and 
change the viewpoint's relative position.


Post a reply to this message

From: Alain
Subject: Re: Changing viewpoint of cylindrical camera
Date: 10 Sep 2008 15:37:23
Message: <48c821f3$1@news.povray.org>
Sebastian Kasperski nous illumina en ce 2008-09-10 05:17 -->
> Alain schrieb:
>> Sebastian Kasperski nous illumina en ce 2008-09-09 06:49 -->
>>> Hello all,
>>>
>>> i'm trying to render a simple scene using a cylindrical camera like 
>>> the following one. It uses the cylinder type 1 (vertical cylinder 
>>> with fixed viewpoint) and a full 360° viewing angle.
>>>
>>> camera
>>> {
>>>   cylinder 1
>>>   angle 360
>>>   up 1.1*y
>>>   location <0,0,0>
>>>   look_at  <0,0,1>
>>> }
>>>
>>> This works pretty fine. The only problem is, that the viewpoint is 
>>> always centered within the cylinder. What I want to do, is to move 
>>> the viewpoint up or down on the cylinder's axis. Is there a way to 
>>> archieve this?
>>>
>>> Best regards
>>> Sebastian
>> Have you tried to translate the camera up or down?
>>
> I did, but this translates the whole camera (viewpoint and image plane). 
> What I need is to keep the cylindrical image plane in its position and 
> change the viewpoint's relative position.
Try a matrix transform.

-- 
Alain
-------------------------------------------------
  My bologna has a first name.

                    Oscar Mayer


Post a reply to this message

From: Chris B
Subject: Re: Changing viewpoint of cylindrical camera
Date: 11 Sep 2008 03:55:51
Message: <48c8cf07$1@news.povray.org>
>>> i'm trying to render a simple scene using a cylindrical camera like the 
>>> following one. It uses the cylinder type 1 (vertical cylinder with fixed 
>>> viewpoint) and a full 360° viewing angle.....
>>
>> Have you tried to translate the camera up or down?
>>
> I did, but this translates the whole camera (viewpoint and image plane). 
> What I need is to keep the cylindrical image plane in its position and 
> change the viewpoint's relative position.

Have you tried playing around with camera type cylinder 3 (vertical 
cylinder, viewpoint moves along the cylinder's axis)?

plane {y,0
  pigment {checker}
  finish {ambient 1}
  scale 0.5
}
camera {
   cylinder 3
   angle 360
   up y
   location <0,0.5,0>
   look_at  <0,0.4,1>
}

The docs seem a little light on an explanation of this and I don't know if 
this is exactly the sort of distortion you're trying to achieve.

If this fails, you may be able to achieve what you want in two passes:
If you are trying to map the scene to a cylinder and be able to place the 
camera so that it's looking down through the cylinder, you could first 
render the scene using a cylinder 1 camera, then use that image as an 
image_map that you map to a cylinder (ambient 1) and render the result. 
You'll then be able to place the camera wherever you want relative to the 
cylinder.
Likewise, if you want to just add a perspective distortion to the result you 
could map the image from the first render to a plane and move the camera 
around for the second render.

Otherwise, a few more words describing what you're trying to achieve would 
be helpful, or a link to an image that uses the sort of projection you seek.

Regards,
Chris B.


Post a reply to this message

From: Sebastian Kasperski
Subject: Re: Changing viewpoint of cylindrical camera
Date: 12 Sep 2008 05:42:06
Message: <48ca396d@news.povray.org>
Chris B wrote:

> 
> Have you tried playing around with camera type cylinder 3 (vertical
> cylinder, viewpoint moves along the cylinder's axis)?
> 
> plane {y,0
>   pigment {checker}
>   finish {ambient 1}
>   scale 0.5
> }
> camera {
>    cylinder 3
>    angle 360
>    up y
>    location <0,0.5,0>
>    look_at  <0,0.4,1>
> }

The cylinder type 3 realizes some kind of parallel projection, which is
clearly not what I need. (It's only parallel to the xy-plane though)

> The docs seem a little light on an explanation of this and I don't know if
> this is exactly the sort of distortion you're trying to achieve.

I found the documentation on this to be of little help as well. What I want
to do is a central projection like you get from a pinhole camera, just with
the image plane being a cylinder. The result would be a full panorama view,
somethiung like this:

plane {
  y,0
  pigment {checker}
  finish {ambient 1}
}
camera {
  cylinder 1
  angle 360
  up y
  location <0,0.5,0>
  look_at <0,0.5,1>
}

I this case the cylinder reaches from 0 to 1 ("up y" defines the cylinder to
be of height 1, and the viewpoint is in the middle.) What I need for
example would be a viewpoint at <0,1,0> and a cylinder reaching from y=0,5
to y=1.0 (Viewpoint on top and looking down through the cylinder)
I found a kind of cheap workaround by simply defining a higher cylinder (in
this case y=0.5 to y=1.5) and then cropping all the images, which works,
but is quite uncomfortable.

> If this fails, you may be able to achieve what you want in two passes:
> If you are trying to map the scene to a cylinder and be able to place the
> camera so that it's looking down through the cylinder, you could first
> render the scene using a cylinder 1 camera, then use that image as an
> image_map that you map to a cylinder (ambient 1) and render the result.
> You'll then be able to place the camera wherever you want relative to the
> cylinder.
> Likewise, if you want to just add a perspective distortion to the result
> you could map the image from the first render to a plane and move the
> camera around for the second render.

If I got that right, then it is not what I mean. See my example above, I
think it should make it clearer.
> 
> Otherwise, a few more words describing what you're trying to achieve would
> be helpful, or a link to an image that uses the sort of projection you
> seek.
> 
> Regards,
> Chris B.

I am simulating a real camera, so the projection is given by the hardware
and can't be changed. The camera also flips the image vertically, so that
it goes from 0° on the left to 360° on the right. (this is in positive
direction (counter clock wise) instead of povray, which does it in negative
direction(clock wise)). A solution would be again to flip all images by
hand, but since i'm doing an animation with 250 frames, this would be
impracticable as well. So is there a way to change the coordinates of the
image plane in povray? For normal cameras, I think it can be done using
the "up" and "right" vector, but I couldn't find out how the "right" vector
is used for cylindrical cameras. 

Best regards
Sebastian


Post a reply to this message

From: Chris B
Subject: Re: Changing viewpoint of cylindrical camera
Date: 12 Sep 2008 07:46:48
Message: <48ca56a8$1@news.povray.org>
> I couldn't find out how the "right" vector
> is used for cylindrical cameras.

I think you need to specify
  right -1
which seems to work.

> I found a kind of cheap workaround by simply defining a
> higher cylinder (in this case y=0.5 to y=1.5) and then
> cropping all the images, which works, but is quite
> uncomfortable.

If I understand correctly, what you want is what gets rendered with the 
'cylinder 1' type camera projection if you specify the command-line option 
+sr120 (or wherever you want the rendered image to start), but you want that 
rendered portion of the image to take up the full image height. Because you 
want to do it a lot of times it would be a pain to render the image at twice 
the height and subsequently crop it using an image processing product.

I can't see any POV-Ray options that would give you that (maybe someone else 
can).
I can think of ways of scripting that outside POV-Ray if you're interested.

Regards
Chris B.


Post a reply to this message

From: jan dvorak
Subject: Re: Changing viewpoint of cylindrical camera
Date: 12 Sep 2008 13:38:58
Message: <48caa932$1@news.povray.org>
Sebastian Kasperski napsal(a):
> Chris B wrote:
> 
>> Have you tried playing around with camera type cylinder 3 (vertical
>> cylinder, viewpoint moves along the cylinder's axis)?
>>
>> plane {y,0
>>   pigment {checker}
>>   finish {ambient 1}
>>   scale 0.5
>> }
>> camera {
>>    cylinder 3
>>    angle 360
>>    up y
>>    location <0,0.5,0>
>>    look_at  <0,0.4,1>
>> }
> 
> The cylinder type 3 realizes some kind of parallel projection, which is
> clearly not what I need. (It's only parallel to the xy-plane though)
> 
>> The docs seem a little light on an explanation of this and I don't know if
>> this is exactly the sort of distortion you're trying to achieve.
> 
> I found the documentation on this to be of little help as well. What I want
> to do is a central projection like you get from a pinhole camera, just with
> the image plane being a cylinder. The result would be a full panorama view,
> somethiung like this:
> 
> plane {
>   y,0
>   pigment {checker}
>   finish {ambient 1}
> }
> camera {
>   cylinder 1
>   angle 360
>   up y
>   location <0,0.5,0>
>   look_at <0,0.5,1>
> }
> 
> I this case the cylinder reaches from 0 to 1 ("up y" defines the cylinder to
> be of height 1, and the viewpoint is in the middle.) What I need for
> example would be a viewpoint at <0,1,0> and a cylinder reaching from y=0,5
> to y=1.0 (Viewpoint on top and looking down through the cylinder)
> I found a kind of cheap workaround by simply defining a higher cylinder (in
> this case y=0.5 to y=1.5) and then cropping all the images, which works,
> but is quite uncomfortable.
> 
>> If this fails, you may be able to achieve what you want in two passes:
>> If you are trying to map the scene to a cylinder and be able to place the
>> camera so that it's looking down through the cylinder, you could first
>> render the scene using a cylinder 1 camera, then use that image as an
>> image_map that you map to a cylinder (ambient 1) and render the result.
>> You'll then be able to place the camera wherever you want relative to the
>> cylinder.
>> Likewise, if you want to just add a perspective distortion to the result
>> you could map the image from the first render to a plane and move the
>> camera around for the second render.
> 
> If I got that right, then it is not what I mean. See my example above, I
> think it should make it clearer.
>> Otherwise, a few more words describing what you're trying to achieve would
>> be helpful, or a link to an image that uses the sort of projection you
>> seek.
>>
>> Regards,
>> Chris B.
> 
> I am simulating a real camera, so the projection is given by the hardware
> and can't be changed. The camera also flips the image vertically, so that
> it goes from 0° on the left to 360° on the right. (this is in positive
> direction (counter clock wise) instead of povray, which does it in negative
> direction(clock wise)). A solution would be again to flip all images by
> hand, but since i'm doing an animation with 250 frames, this would be
> impracticable as well. So is there a way to change the coordinates of the
> image plane in povray? For normal cameras, I think it can be done using
> the "up" and "right" vector, but I couldn't find out how the "right" vector
> is used for cylindrical cameras. 
> 
> Best regards
> Sebastian
You could use a camera_view pigment in MegaPov to do the cropping and 
flipping for you. This also causes that only the bottom half (the part 
not cropped) is rendered.


Post a reply to this message

From: Sebastian Kasperski
Subject: Re: Changing viewpoint of cylindrical camera
Date: 14 Sep 2008 06:04:45
Message: <48cce1bd$1@news.povray.org>
Chris B schrieb:

> I think you need to specify
>  right -1
> which seems to work.
> 

Yeah, that worked! And I really thought I had tried out that right 
vector. With "right -1" the image is flipped correctly.

About the cropping-problem: I got my test sequence now by cropping the 
images using a batch-script for IrfanView. This does the job so far. If 
someone finds a more elegant solution to this, please let me know. But 
there's no reason to spend more time on this.

Thanks all for the help
Sebastian


Post a reply to this message

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