POV-Ray : Newsgroups : povray.newusers : animation camera problem Server Time
4 Nov 2024 19:22:21 EST (-0500)
  animation camera problem (Message 1 to 9 of 9)  
From: Dawn McKnight
Subject: animation camera problem
Date: 24 Jul 2003 12:18:32
Message: <d-mcknight-5D7DDD.09182224072003@netplex.aussie.org>
Hey, gang.

I'm trying to do a fly-by animation, with the camera moving to point at 
the object, and I'm getting an odd result.  My code looks like this:

camera {
   location <-6, 3, -100>
   translate 200*clock*z
   look_at 0
   }

But, instead of the camera twisting to look at the origin as it goes, it 
keeps pointing along the same vector.  Why is it doing that?

(I'm using POV 3.5 for MacIntosh, no extras or fancy stuff)


Post a reply to this message

From: mcavoys
Subject: Re: animation camera problem
Date: 24 Jul 2003 12:21:47
Message: <3f200738.176744745@news.povray.org>
On Thu, 24 Jul 2003 09:18:23 -0700, Dawn McKnight <d-m### [at] coxnet> wrote:

>Hey, gang.
>
>I'm trying to do a fly-by animation, with the camera moving to point at 
>the object, and I'm getting an odd result.  My code looks like this:
>
>camera {
>   location <-6, 3, -100>
>   translate 200*clock*z
>   look_at 0
>   }
>
>But, instead of the camera twisting to look at the origin as it goes, it 
>keeps pointing along the same vector.  Why is it doing that?
>
>(I'm using POV 3.5 for MacIntosh, no extras or fancy stuff)

Try  look_at  <0,0,0>

It needs a 3D point to look at.
Regards
        Stephen


Post a reply to this message

From: Tom Melly
Subject: Re: animation camera problem
Date: 24 Jul 2003 12:26:09
Message: <3f2008a1$1@news.povray.org>
"Dawn McKnight" <d-m### [at] coxnet> wrote in message
news:d-m### [at] netplexaussieorg...
>
> But, instead of the camera twisting to look at the origin as it goes, it
> keeps pointing along the same vector.  Why is it doing that?

look_at is relative to the location and is not affected by translate (I never
knew that).

So your code should be:

camera {
   location <-6, 3, -100+(200*clock)>
   look_at 0
   }

(untested)


Post a reply to this message

From: Tom Melly
Subject: Re: animation camera problem
Date: 24 Jul 2003 12:27:17
Message: <3f2008e5$1@news.povray.org>
<mca### [at] aolcom (S McAvoy)> wrote in message
news:3f200738.176744745@news.povray.org...

> Try  look_at  <0,0,0>
>
> It needs a 3D point to look at.
> Regards
>         Stephen

Well, one of us is wrong.....


Post a reply to this message

From: Christopher James Huff
Subject: Re: animation camera problem
Date: 24 Jul 2003 12:53:05
Message: <cjameshuff-417B8C.11530824072003@netplex.aussie.org>
In article <3f200738.176744745@news.povray.org>,
 mca### [at] aolcom (S McAvoy) wrote:

> Try  look_at  <0,0,0>
> 
> It needs a 3D point to look at.

This is not a problem. The 0 is expanded to < 0, 0, 0> automatically by 
the parser, this is a common shortcut.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: animation camera problem
Date: 24 Jul 2003 12:54:17
Message: <cjameshuff-78DFB0.11541824072003@netplex.aussie.org>
In article <3f2008a1$1@news.povray.org>,
 "Tom Melly" <tom### [at] tomandlucouk> wrote:

> look_at is relative to the location and is not affected by translate (I never
> knew that).

The look_at point is an absolute point, it is independent of the 
location.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: animation camera problem
Date: 24 Jul 2003 12:57:21
Message: <cjameshuff-7DC62F.11572324072003@netplex.aussie.org>
In article <d-m### [at] netplexaussieorg>,
 Dawn McKnight <d-m### [at] coxnet> wrote:

> camera {
>    location <-6, 3, -100>
>    translate 200*clock*z
>    look_at 0
>    }
> 
> But, instead of the camera twisting to look at the origin as it goes, it 
> keeps pointing along the same vector.  Why is it doing that?

Camera transformations are taken into account after the rest of the 
camera statements, to avoid ambiguities in the camera specification, so 
what you are doing is translating the entire camera, the same as:

camera {
    location <-6, 3, -100>
    look_at 0
    translate 200*clock*z
}

You want to translate the location point instead.

camera {
    location <-6, 3, -100> + 200*clock*z
    look_at 0
}

If you want to use a more complex transformation, look at the 
vtransform() macro in transforms.inc.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: mcavoys
Subject: Re: animation camera problem
Date: 24 Jul 2003 13:31:11
Message: <3f2017af.180960407@news.povray.org>
On Thu, 24 Jul 2003 17:27:17 +0100, "Tom Melly" <tom### [at] tomandlucouk> wrote:

><mca### [at] aolcom (S McAvoy)> wrote in message
>news:3f200738.176744745@news.povray.org...
>
>> Try  look_at  <0,0,0>
>>
>> It needs a 3D point to look at.
>> Regards
>>         Stephen
>
>Well, one of us is wrong.....
>
Oh dear I didn't check :-{

Regards
        Stephen


Post a reply to this message

From: Regan Pylman
Subject: Re: animation camera problem
Date: 24 Jul 2003 21:02:52
Message: <rpylman-476FEE.18023724072003@netplex.aussie.org>
In article <cja### [at] netplexaussieorg>,
 Christopher James Huff <cja### [at] earthlinknet> wrote:

> Camera transformations are taken into account after the rest of the 
> camera statements, to avoid ambiguities in the camera specification, so 
> what you are doing is translating the entire camera, the same as:

Ah, okay.  Thank you very much for your help!


Post a reply to this message

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