POV-Ray : Newsgroups : povray.general : Animation of changing focal length and camera distance to simulate orthogra= Server Time
24 Dec 2024 13:09:52 EST (-0500)
  Animation of changing focal length and camera distance to simulate orthogra= (Message 1 to 9 of 9)  
From: SharkD
Subject: Animation of changing focal length and camera distance to simulate orthogra=
Date: 17 Dec 2007 22:40:00
Message: <web.4767405290da908ed685a5c80@news.povray.org>
I was wondering if anyone had made an animation showing how changing the camera
distance and focal length can lead to an approximation of orthographic view. If
not, could someone describe how I might go about creating one?

Thanks!

Mike


Post a reply to this message

From: Jan Dvorak
Subject: Re: Animation of changing focal length and camera distance to simulate orthogra=
Date: 17 Dec 2007 23:09:23
Message: <476747f3$1@news.povray.org>
SharkD napsal(a):
> I was wondering if anyone had made an animation showing how changing the camera
> distance and focal length can lead to an approximation of orthographic view. If
> not, could someone describe how I might go about creating one?
> 
> Thanks!
> 
> Mike
> 
> 
I'm just rendering it. It might be finished around tomorrow. Somehow 
each frame takes half an hour to render. I'll post it when it finishes.


Post a reply to this message

From: SharkD
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 18 Dec 2007 00:05:01
Message: <web.476754b6c02813e5d685a5c80@news.povray.org>
Awesome! I would like the animation (GIF only, I think) added to this
(http://en.wikipedia.org/wiki/Orthographic_projection) article at Wikipedia. If
you know how to go about doing this, please upload your image to Wikimedia
Commons and add it to the article.

Jan Dvorak <jan### [at] centrumcz> wrote:
> SharkD napsal(a):
> > I was wondering if anyone had made an animation showing how changing the camera
> > distance and focal length can lead to an approximation of orthographic view. If
> > not, could someone describe how I might go about creating one?
> >
> > Thanks!
> >
> > Mike
> >
> >
> I'm just rendering it. It might be finished around tomorrow. Somehow
> each frame takes half an hour to render. I'll post it when it finishes.


Post a reply to this message

From: Jan Dvorak
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 18 Dec 2007 10:05:29
Message: <4767e1b9@news.povray.org>
SharkD napsal(a):
> Awesome! I would like the animation (GIF only, I think) added to this
> (http://en.wikipedia.org/wiki/Orthographic_projection) article at Wikipedia. If
> you know how to go about doing this, please upload your image to Wikimedia
> Commons and add it to the article.
> 
> Jan Dvorak <jan### [at] centrumcz> wrote:
>> SharkD napsal(a):
>>> I was wondering if anyone had made an animation showing how changing the camera
>>> distance and focal length can lead to an approximation of orthographic view. If
>>> not, could someone describe how I might go about creating one?
>>>
>>> Thanks!
>>>
>>> Mike
>>>
>>>
>> I'm just rendering it. It might be finished around tomorrow. Somehow
>> each frame takes half an hour to render. I'll post it when it finishes.
> 
> 
> 
> 
I'm doing something else. I do not move the camera nor I change its 
aperture. I only move the focal plane. I can do the latter after this one.


Post a reply to this message

From: SharkD
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 19 Dec 2007 00:15:00
Message: <web.4768a89468c45c83d685a5c80@news.povray.org>
Jan Dvorak <jan### [at] centrumcz> wrote:
> I'm doing something else. I do not move the camera nor I change its
> aperture. I only move the focal plane. I can do the latter after this one.

OK, that would be great. Ideally it would be a simple scene (of a cube maybe)
that converts well to GIF. I.e., GIF compression works best with images that
aren't too "busy" and use few colors. Anti-aliasing would need to be turned
off, as well as the diffuse parameter. Ambient light would need to be set to 1.
I could do it myself if you could describe the method of accomplishing this.

-Mike


Post a reply to this message

From: Chris B
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 19 Dec 2007 05:37:06
Message: <4768f452@news.povray.org>
"SharkD" <nomail@nomail> wrote in message 
news:web.4768a89468c45c83d685a5c80@news.povray.org...
> Jan Dvorak <jan### [at] centrumcz> wrote:
>> I'm doing something else. I do not move the camera nor I change its
>> aperture. I only move the focal plane. I can do the latter after this 
>> one.
>
> OK, that would be great. Ideally it would be a simple scene (of a cube 
> maybe)
> that converts well to GIF. I.e., GIF compression works best with images 
> that
> aren't too "busy" and use few colors. Anti-aliasing would need to be 
> turned
> off, as well as the diffuse parameter. Ambient light would need to be set 
> to 1.
> I could do it myself if you could describe the method of accomplishing 
> this.
>
> -Mike
>

Hi Mike,

The general approach I'd recommend is to move the camera back and adjust the 
camera angle so that roughly the same amount of screen area is captured in 
each render.

The following example renders a 100 frame animation in a couple of seconds 
at 160x120 using the command line parameters shown in the comment (initial 
frame 0 - final frame 100).


// +kfi0 +kff100
#include "math.inc"

#declare CameraDistance = frame_number/10;
#declare CameraAngle    = atan2d(5,CameraDistance);

camera {location <-1,1,-1>-CameraDistance*z look_at 0 angle CameraAngle}
light_source {<50, 10,-40> color rgb 1  }

box {0,1.5 pigment {rgb <1,1,0>}}
sphere {-0.5,1 pigment {rgb <0,1,0>}}
text {
  ttf
  "Arial.ttf",
  concat("Dist: ",str(CameraDistance,2,2),"  Angle: 
",str(CameraAngle,2,0)),0.2,0
  scale 0.4
  translate <-1.5,0.5,-0.5>
  texture {
    pigment {rgb <1,0,0>}
    finish {ambient 2}
  }
}

Hope this helps,

Regards,
Chris B.


Post a reply to this message

From: SharkD
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 20 Dec 2007 01:25:00
Message: <web.476a0a5a68c45c83d685a5c80@news.povray.org>
I decided to use the direction, up and right vectors instead of angle.

camera
{
 location -z*(2+CameraDistance)
 look_at 0
 direction z*(2+CameraDistance)
 up y*5
 right x*5
 rotate <45,45,0>
}

It works better for me; using your method it seemed as if the image were
shrinking as the camera moved away.

Thanks for the help!

Mike

"Chris B" <nom### [at] nomailcom> wrote:
> Hope this helps,
>
> Regards,
> Chris B.


Post a reply to this message

From: SharkD
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 20 Dec 2007 03:15:01
Message: <web.476a237ac02813e5d685a5c80@news.povray.org>
You can now find the finished product in the Wikipedia article:
http://en.wikipedia.org/wiki/Orthographic_projection

Mike

"SharkD" <nomail@nomail> wrote:
> I was wondering if anyone had made an animation showing how changing the camera
> distance and focal length can lead to an approximation of orthographic view. If
> not, could someone describe how I might go about creating one?
>
> Thanks!
>
> Mike


Post a reply to this message

From: SharkD
Subject: Re: Animation of changing focal length and camera distance to simulate orth=
Date: 20 Dec 2007 20:15:01
Message: <web.476b124568c45c83d685a5c80@news.povray.org>
Woops. There was a bug in the camera code. That should be:

camera
{
 location -z*(2+CameraDistance)
 look_at 0
 direction z*(2+CameraDistance)
 up y*5
 right x*5
 rotate <asind(tand(30)),45,0>
}

Mike

"SharkD" <nomail@nomail> wrote:
> I decided to use the direction, up and right vectors instead of angle.
>
> camera
> {
>  location -z*(2+CameraDistance)
>  look_at 0
>  direction z*(2+CameraDistance)
>  up y*5
>  right x*5
>  rotate <45,45,0>
> }
>
> It works better for me; using your method it seemed as if the image were
> shrinking as the camera moved away.
>
> Thanks for the help!
>
> Mike
>
> "Chris B" <nom### [at] nomailcom> wrote:
> > Hope this helps,
> >
> > Regards,
> > Chris B.


Post a reply to this message

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