POV-Ray : Newsgroups : povray.general : how to use the SKY vector for CAMERA? Server Time
15 Nov 2024 03:21:45 EST (-0500)
  how to use the SKY vector for CAMERA? (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: bruce mackay
Subject: how to use the SKY vector for CAMERA?
Date: 17 Mar 1999 02:05:39
Message: <36ef5443.0@news.povray.org>
Can anyone explain the use of the sky vector for the camera better
than the documentation?  It is a little a little vague and brief .  It would
be great to be able to roll the camera in a predictable way.
Thanks.
Bruce MacKay
(bma### [at] hevanetcom)


Post a reply to this message

From: Nieminen Mika
Subject: Re: how to use the SKY vector for CAMERA?
Date: 17 Mar 1999 06:23:28
Message: <36ef90b0.0@news.povray.org>
bruce mackay <bma### [at] hevanetcom> wrote:
: Can anyone explain the use of the sky vector for the camera better
: than the documentation?  It is a little a little vague and brief .  It would
: be great to be able to roll the camera in a predictable way.

  Why don't you just use the 'rotate' keyword?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nathan Kopp
Subject: Re: how to use the SKY vector for CAMERA?
Date: 17 Mar 1999 16:11:39
Message: <36F01A3B.B74614EA@Kopp.com>
I really don't think rotate will roll the camera... it just moves its
position.

I don't know what the documentation says, but sky points towards the sky
(perpendicular to the horizon).  So if your camera is looking towards
+x, and the sky is usually +y, then if you change it to +z, you'll roll
the camera by 90 degrees.  If you use, for example, <0,1,1>, you'll
roll the camera 45 degrees.

here's a script that is interesting

#declare cam_dir = cam_lookat - cam_location;
#declare cam_right = vcross(cam_dir, old_cam_up);
  // old_cam_up would be y (unless you changed it)
  // cam_right is a vector that is perpendicular to both the direction
  //  that the camera is pointing and to the up vector
#declare cam_up_perp = vcross( cam_right, cam_dir);
  // cam_up_perp is an up vector that you could use to give the same
  //  results as 'y', but it is now perpendicular to the camera's
  //  direction

/*
Now, you can rotate cam_up_perp around cam_right (using
vrotate_axis(), IIRC) and use that as your new UP vector.

This code has not been tested... I just whipped it up now.  I hope
it helps.

Side view of what we this did:

  y  / cam_up_perp
  | /
  |/
  *--__  <-- cam_dir
       --__
           --#

* camera position
# camera look_at

*/

Nieminen Mika wrote:
> 
> bruce mackay <bma### [at] hevanetcom> wrote:
> : Can anyone explain the use of the sky vector for the camera better
> : than the documentation?  It is a little a little vague and brief .  It would
> : be great to be able to roll the camera in a predictable way.
> 
>   Why don't you just use the 'rotate' keyword?
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Mika
Subject: Re: how to use the SKY vector for CAMERA?
Date: 18 Mar 1999 08:47:48
Message: <36f10404.0@news.povray.org>
Nathan Kopp <Nat### [at] koppcom> wrote:
: I really don't think rotate will roll the camera... it just moves its
: position.

plane { y,-1 pigment { checker rgb 1,rgb .5 } }
plane { -y,-1 pigment { checker rgb x*1,rgb x*.5 } }
light_source { 0,1 }
camera { location -z look_at 0 rotate z*30 }

http://www.cs.tut.fi/~warp/rotate.jpg

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nathan Kopp
Subject: Re: how to use the SKY vector for CAMERA?
Date: 18 Mar 1999 09:37:30
Message: <36F10F54.DD3E7750@Kopp.com>
I stand corrected.

-Nathan

Nieminen Mika wrote:
> 
> Nathan Kopp <Nat### [at] koppcom> wrote:
> : I really don't think rotate will roll the camera... it just moves its
> : position.
> 
> plane { y,-1 pigment { checker rgb 1,rgb .5 } }
> plane { -y,-1 pigment { checker rgb x*1,rgb x*.5 } }
> light_source { 0,1 }
> camera { location -z look_at 0 rotate z*30 }
> 
> http://www.cs.tut.fi/~warp/rotate.jpg
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Josh English
Subject: Re: how to use the SKY vector for CAMERA?
Date: 18 Mar 1999 12:52:55
Message: <36F13DCE.135CC6AA@spiritone.com>
the problem with rotating the camera is that you have to place the camera at
the origin, rotate it, then translate it.

Adjusting the sky vector does this with less of a head ache.

Normal cameras are placed at the location, then pans around it's y-axis to
match the look_at vector, then tilts up or down to look directly at the look_at
point.

The sky vector alters the cameras Y axis. Since I see this question asked by
more than one user, I'm going to put up a small tutorial on my website on how
this works...


Nathan Kopp wrote:

> I stand corrected.
>
> -Nathan
>
> Nieminen Mika wrote:
> >
> > Nathan Kopp <Nat### [at] koppcom> wrote:
> > : I really don't think rotate will roll the camera... it just moves its
> > : position.
> >
> > plane { y,-1 pigment { checker rgb 1,rgb .5 } }
> > plane { -y,-1 pigment { checker rgb x*1,rgb x*.5 } }
> > light_source { 0,1 }
> > camera { location -z look_at 0 rotate z*30 }
> >
> > http://www.cs.tut.fi/~warp/rotate.jpg
> >
> > --
> > main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> > ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Lance Birch
Subject: Re: how to use the SKY vector for CAMERA?
Date: 19 Mar 1999 04:40:54
Message: <36f21ba6.0@news.povray.org>
Why doesn't someone just make a macro that allows the user to enter Roll and
Dolly values, this would make using a POV-Ray camera SOOO much easier!

(It would also make vertigo zooming an easier thing to do)

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone


Post a reply to this message

From: Nieminen Mika
Subject: Re: how to use the SKY vector for CAMERA?
Date: 19 Mar 1999 05:15:09
Message: <36f223ad.0@news.povray.org>
Josh English <eng### [at] spiritonecom> wrote:
: the problem with rotating the camera is that you have to place the camera at
: the origin, rotate it, then translate it.

  I really don't see the problem here. You do this with all your objects,
don't you? Why the camera should be any more difficult?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Lance Birch
Subject: Re: how to use the SKY vector for CAMERA?
Date: 19 Mar 1999 05:21:51
Message: <36f2253f.0@news.povray.org>
Because with a camera there should be an easier way to control it's roll,
since the axis should not be a world-coordinate system by an
object-coordinate system...  (it's got the feature built into it, so why do
some complex rotate and translate when you can use its built-in keyword?)

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone


Post a reply to this message

From: Nieminen Mika
Subject: Re: how to use the SKY vector for CAMERA?
Date: 19 Mar 1999 05:40:33
Message: <36f229a1.0@news.povray.org>
Lance Birch <lan### [at] usanet> wrote:
: Because with a camera there should be an easier way to control it's roll,
: since the axis should not be a world-coordinate system by an
: object-coordinate system...

  I still don't understand. I don't see any difficulty in controlling the
roll of the camera. I roll it just like any other object.
  Or do you mean that you have to use rotate _after_ location and look_at
and after that making the camera to look at a certain point is difficult?
Well, you can use something as simple as this:

#declare CamTiltAngle=radians(30);

camera
{ sky <sin(CamTiltAngle),cos(CamTiltAngle),0>
  location <1,2,-4>
  look_at 0
}

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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