Re: Ortho Cameras

Linas Vepstas (linas@innerdoor.austin.ibm.com)
Mon, 17 Oct 1994 19:53:33 -0500


Hi Gavin,

>From: "Gavin Bell" <gavin@krypton.engr.sgi.com>
>Date: Mon, 17 Oct 1994 16:22:36 -0700
>Subject: Re: Ortho Cameras
>
> I wrote:
>> > (I've never used non-perpendicular projections,
> And Linas responded:
>> The standard demo is the split screen demo -- where scwartzenegger
>> walks behind a screen and turns into a wire-frame stick figure.
>> You draw the scene once with gouraud shaded polygons, then set
>> up the camera, and again with wire-frame. (You also have to set
>> up the clip planes as well).
>
>OK, if needed we can add a viewplaneOrientation field to the cameras,
>to change the default viewplaneOrientation (which is perpendicular to
>the direction of view).

I am not wedded to requiring a viewplaneiNormal. However,
a viewplaneUp would be nice, as well as a focalPoint that is a
3D location value.

>But I don't think that is necessary enough to add as a VRML 1.0
>feature, especially since there are some nasty implementation issues
>when you have 2 perspective projections going on; lighting comes
>immediately to mind; to be fully general, you want may want two
>lighting calculations to happen, one for the objects being X-rayed
>(imagine the skeleton is a nice, lit model) which are then projected
>onto the X-ray screen, and then once for the X-ray screen itself
>(imagine specular highlights on the X-ray monitors...).

I think "nasty" is an excessively pejorative word. None of this
is terribly hard. I wrote a little demo to do this recently, I don't
think it was over 100 lines of code, counting the comment cards. OK,
so it was a toy demo ... and the function is obscure enough that maybe
most people don't want to mess with it.

>My point is that you can't choose a reasonable default for
>screenHeight. For example, if screenHeight 10 is the default value,
>then this might look OK:
>
>PerspectiveCamera {
> focalDistance 10
> screenHeight 10 # This is the default
>}
>
>... but if I then change my mind and do:
>PerspectiveCamera {
> focalDistance 20
> screenHeight 10 # This is the default
>}
>... my scene looks radically different, because changing the
>focalDistance and keeping the screenHeight the same changes the field
>of view.

Don't do that! This is a variation on the rigid-vs non-rigid
way of specifying things. If the vrml author fails to specify
screenHeight, then take the default value as being equal to
whatever the current focalDistance value is. (Or better yet,
equal to 0.6180339887 of the current focal distance ...)

Also, the "scene look radically different" comment is not
really true.

If you are looking at an isolated object (molecule, engine,
vase, teapot, vw bug, whatever) whose center is located
at the focal point, you will see minor-to-imperceptible changes
as the focal distance is moved while keeping screen height
constant.

But I agree that if you are looking at a landscape, where most
of what's visible is nowhere near the focal point, yes, things
will change. It'll be like playing with a wide-angle lens.

--linas