Author Topic: Understanding Zoom, Field of View, focal length, cameras and CAD  (Read 10300 times)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Understanding Zoom, Field of View, focal length, cameras and CAD
« on: November 02, 2014, 01:39:54 AM »
Realizing I'm about to hijack another thread, all because I need to get concepts straight in my mind, I thought maybe we talk and explore it here.

With a camera the view angle (zoom, field of view) doesn't change because you move the camera, but it does with DesignCAD.

Phil, if we use ordinary camera terminology (a real camera in your hand), and if "zoom" is more correctly meant to mean changing of the focal length, what is the proper term for simply moving the camera closer or away from what you are looking at? Or is the "at" concept also a bit wrong.  Maybe "in the direction of"?

And I know you like this sort of "let's get our definitions" straight too.  You and I often chat about the inappropriate naming of things in DC (concepts, commands, etc) which can cause trouble simply talking about them down the road (planes, Solid Surface).

edit:  Phil, and just so you know, I am deferring to your experience and knowledge with real cameras and terminology so my questions aren't meant to be a quibble but an "educate me".  I have no knowledge with real cameras.

Just thinking in terms of CAD which isn't always correct.  So in terms of the graphic below, if what we see is mapped onto computer screens (camera sensor notation and then electronically mirrored) and the camera lens position is in 3d space at some fixed absolute (x,y,z) point looking in some determined direction, help me understand the concept of zoom.

Please watch these two movies.  The camera is positioned at the top of the line (6') and is aimed at the middle of the window mullion.

Movie 1 - A typical CAD zoom
Movie 2 - A typical Camera lens zoom

Reminder: When the movie is playing, if it is going too fast, you can left click in the movie area to start/stop the action.  Also the slider to rewind.

Note in movie 1, the CAD zoom takes the camera with lens and moves it in 3d space backing out through the model.  But focal length stays the same.

Note in movie 2, specifically Camera zoom, the Camera lens stays fixed at the top of that line and you can't ever get behind the line to see it.  Look at the bottom right corner to see the focal length distances.

Two different zooming behaviors.

Questions:

Is the way SketchUP does it more or less correct (or also a twisted version)?
For the Camera Zoom, is our viewing screen moving relative to the fixed lens position? In other words, the model isn't moving, the lens position isn't moving, so what is moving?

« Last Edit: November 02, 2014, 04:26:40 AM by prl »

Dr PR

  • Hero Member
  • *****
  • Posts: 5434
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #1 on: November 02, 2014, 09:26:53 AM »
prl,

In so many words or more here are my thoughts.

Sketchup is doing it more or less right (see below). When you zoom a camera lens the effect you see is to change the view angles (horizontal and vertical).

Think of it this way - when you look up at the night sky you see stars from horizon to horizon (very wide angle of view). If you look through binoculars you see less of the sky (narrower view angle), but what you see is magnified so you can see more detail. If you use a good telescope you see far less of the sky (very narrow view angle) but you see much more detail. And if you use the Hubble Space Telescope (extremely narrow angle of view) you can details that are not visible in the other ways.

Camera zoom lenses work this way - zoom in (narrow field of view) to get a "telescopic" view with lots of small details visible - this is why long focal length lenses are called "telephoto" lenses. Zoom out to see a broader field of view, but less small detail is visible - this is why short focal length lenses are called "wide angle" lenses.

****

Keep in mind that CAD has one tremendous advantage over camera lenses - it has an infinite depth of field. With even the best camera lenses the image has an "in focus" field somewhere between the focal plane (where the optical sensor of film is positioned) and infinity (cameras lenses have a combination of nearsightedness and farsightedness). Real lenses can't focus from zero to infinity because of limitations in materials and manufacturing processes. In general, the higher the magnification (narrower the view angle) the shorter the depth of field. This is a shortcoming that we do not want to introduce to CAD!

So we don't want to have a perfect simulation of a camera in our CAD programs. Artsy-fartsy programs may want to do this in order to simulate the limitations of cameras, but I am very happy with my perfect virtual lenses in DesignCAD and I wish I had one for my cameras!

However, CAD also has a resolution problem - it is limited to the finite number of pixels in an image. Again, using the night sky example, you can use a telescope to view a closely spaced pair of stars, but when you just use the naked eye the pair may be so close together that they look like a single star. In CAD when you zoom out to a wide angle view two objects may be so close together that they fill only one pixel and can't be resolved. You need to zoom in (narrower view angle) to expand a small part of the overall view so individual small objects can be viewed.

****

I haven't used Sketchup so I don't know how they position the camera, unless it is with what you show in the movie - put the camera here and look there. This is what DesignCAD does, and it is a lousy way to view a design interactively.

****

I emphasized interactively for a reason. I have few problems with how DesignCAD zoom functions work while I am creating a drawing. My only real gripe is the bonehead way the "Set View by View Center" works. When I use it the thing I want to view invariably moves off screen because the thing I want to see is not at the view center, wherever that is! So I never use that function and have reassigned the "Y" key to execute the "vc.d3m" macro. This macro lets me gravity snap to a point and then the cursor causes the view to orbit around that point.

Yes, I know we are supposed to use "Set Viewer Points" or something like that before we use "Set View by View Center" but that is a PITA and I think I have never set a view center in the 27 years I have used the program (except when I use "vc.d3m").

So the "orbit the camera around a point" operation works fine when my attention is focused on a specific detail.

****

But it sucks when you want to just stroll through your entire drawing and "rubberneck" your view interactively to spontaneously look around in every direction. It just isn't the way we view things in the real world. We don't have some invisible force field that keeps our head and eyes fixed upon a single point while we walk around. We do not have to consciously reset the "view point" every time we want to move our eyes or head to look at something else.

Instead of having our view orbit around a specific object, all objects in our view spin around our eyes/head/camera. For realistic interactive viewing we want the entire virtual universe to spin around the viewer (camera/head/eyes) location. And, because our CAD camera has perfect lenses, everything in the drawing is always in focus!

****

To make the Sketchup version (almost) perfect you need to be able to walk around while zooming in/out. For interactive viewing just moving around step by step would do, just as we do in real life. The forward (Up), backward (Down), left (Left) and right (Right) cursor keys work fine for moving the camera position.

But since we aren't limited by gravity and other bothersome realities in our virtual CAD world we also need a way to move the camera up and down, not just to squat and stand up, but to fly. For this the Shift-Up and Shift-Down key combinations work. The Shift-Left and Shift-Right keys could cause rotation around the line of sight to make the view spin.

Some programs use Ctrl-Shift to amplify the motions for faster movement.

All of this is nothing new. It has already been implemented in games like "Microsoft Space Simulator" and such.

Using the mouse wheel to control view angle (zooming in camera terms) would complete the interactive viewing experience.

And even better, while we are walking around rubbernecking our design, just moving the mouse/trackball could control camera movement (left, right, up, down). And holding down a mouse button (or Ctrl, Shift, whatever) while moving the mouse/trackball could actually "turn our head" to control the camera's line of sight. "Microsoft Flight Simulator" has this feature (implemented with "top hat buttons" on a flight controller) so you can look out to the side or up/down while maneuvering. It takes a bit of getting used to but it is the way pilots fly airplanes. Microsoft has implemented it very nicely.

The idea here is to mimic reality.

****

Of course, since all of the actions are based upon normal simple keystrokes or mouse movements they would be easy to implement in macros or animation scripts.

Phil
DesignCAD user since 1987

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #2 on: November 02, 2014, 10:14:08 AM »
To make the Sketchup version (almost) perfect you need to be able to walk around while zooming in/out.

Sure it does that too.  They having walking mode.  Interactive walking while CAD zooming (moving the camera) while holding the focal length constant (about 35mm). Here is a sample (from 2002) . https://dl.dropboxusercontent.com/u/81411430/DesignCAD/20141101/walk.swf

I'll read your post a few more times to get it all.  Think I understood all the items about viewing angles.  But trying to relate the terms we use in CAD, the difference between a typical CAD zoom and a Camera zoom.  And of course one can really get into it by doing both a CAD zoom and Camera zoom at the same time. Lights, action,  showtime . . .


Edit: Okay, read it a few more times.  Yes we can skip "in focus", F stops, etc.  We certainly don't need to emulate "out of focus".

Also I reloaded both movies, taking out the back wall.  This way you can see the 6' line from the floor.  Just need a location that represents where I want to stand and at what eye level to position the camera.  But same point as before, my terminology,  CAD zoom versus Camera zoom.  Focal length numbers are in the bottom right corner. 2nd movie ends in a wide angle 10 mm focal length view.  Never backing up behind the line or exiting the building as the CAD zoom does in movie 1.

For me the CAD zoom is similar to that telescoping chair contraption movie directors use when they get in close or pull way back.  The camera guy and camera go for a ride.  But we know they often do both, CAD and Camera zooms, or at least they used to when we used real people and sets.

And to tie this back to DesignCAD, CAD zoom we do typically with the mouse wheel.  Camera zoom we do when we click those depth buttons (view toolbar) while in perspective mode. 

By the way, I was expecting more responses from the Super-8 crowd.  I know those cameras had zooms on them too. 
« Last Edit: November 02, 2014, 12:07:55 PM by prl »

Dr PR

  • Hero Member
  • *****
  • Posts: 5434
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #3 on: November 02, 2014, 02:40:28 PM »
prl,

I certainly don't want to change the way the program works during normal drawing and editing. I like the way the drawing mode zoom works now - mouse wheel and all. If it was changed now, after using the program the way it is for decades, it would drive me nuts.

But I would like to see a "walk through" view mode that would allow us to move through our drawings without stumbling over the "view point" obstacle everytime we want to move. For the walk through it would make sense for the view to behave like a camera, as I described above.

Something like this would also be good for animations, since we are trying to make movies within our virtual worlds.

****

In effect we are talking about two view modes:

1. Where the camera orbits the object being viewed (viewpoint). This is the way DesignCAD views work now.

2. Where the drawing orbits around the camera position. This is what I described above.

Phil
« Last Edit: November 02, 2014, 06:47:14 PM by Dr PR »
DesignCAD user since 1987

Lar

  • Hero Member
  • *****
  • Posts: 2540
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #4 on: November 02, 2014, 04:45:26 PM »
You can emulate a type of interactive rubberneck/focal point combo 'move'-thru using the buttons of the View Toolbox as a team:
Setup: Set the view to Perspective, Fit To Win, click 'Set Viewer Points', snap one point on something you want to focus on and press enter (ignore the 2nd point). Set the 'View Distance' to something small compared to the model size (for a building I would set somewhere around 20 feet for outside and 6 feet for inside {convert to whatever drawing units you use}) and zoom in on the focus-object (if the perspective distorts this will cure it). Turn on Hidden Line or Shaded mode.

You can now orbit around the focal object to study it if you desire. If your computer orbits fast in non-wireframe mode then use the 'Y' command ('Set View by View Center'). If not then use the arrows in the View Toolbox (the arrows rotate faster than the 'Y' command). When done studying the focus-object decide on what you want to look at next. Since in real life we would naturally divert our attention to something within view of the current focus, rotate the view until the the new focus-object comes into view. Now click the 'Set Viewer Points' button, snap somewhere on the new object and press enter. The new object would jump to the center of the screen and be zoomed in according to the 'View Distance' and the Zoom amount, both of which you can change to satisfy the proper viewing of the new focus-object and surroundings. You can now orbit around this or divert your attention to something else. As you continue diverting you would be moving  about the model. To spin around in a circle just repeat the "1-point 'Set Viewer Points'" while snapping onto things near the edge of the window. To move through a corridor just snap to something at the other end of the corridor.

Lar

Dr PR

  • Hero Member
  • *****
  • Posts: 5434
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #5 on: November 02, 2014, 06:52:31 PM »
Lar,

Thanks. Your description of how to look around a drawing is the best testimony yet to why we need something better!

Click a button, set this point here, set that number, push that button, change that number ... ad nauseum. Wouldn't it be a lot easier to just move the mouse to look this way or that?

Phil
DesignCAD user since 1987

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #6 on: November 02, 2014, 07:36:04 PM »
Phil, Lar.  This thread isn't really about debating a better interactive DesignCAD, we all agree there.  I was exploring the term "zoom" as used by Phil.

Quote
3. Zoom level. This is a change in the view angle - wide angle to telephoto. The mouse wheel would be ideal for this.

When I read that, I realized Phil's use of the word "zoom" is different than how "zoom" is used in CAD.  And as you can tell, SketchUp makes a distinction between "zoom" and "field of view".   Hence I chimed in pointing out the different use of the word.


In SketchUP,

CAD zoom (moving the camera, lens focal point is constant) is "zoom",
Camera zoom (camera is stationary, adjusting the lens) is "field of view".

Which brings me back to my original questions.

In camera terminology, is there a term for getting in close or far away with the camera itself?

In lens/film thinking, if the model is stationary which it is, and the lens is stationary which it is, and we spin the lens and the view that is mapped onto the film plate is changing, is the focal depth measurement a real physical measurement between the lens and the film plate or is that also an optics equivalent type of term?



« Last Edit: November 03, 2014, 06:06:33 AM by prl »

Rob S

  • Hero Member
  • *****
  • Posts: 4327
    • Construction Estimating Program for General Contractors
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #7 on: November 03, 2014, 07:57:49 AM »
Quote
Which brings me back to my original questions.

In camera terminology, is there a term for getting in close or far away with the camera itself?

I take tons of pictures in our travels, and the terminology has never been a big issue for me, but I think the word you are looking for here is "walk towards", or "walk away" - very little technology involved in that  :)

Sometimes, when walking closer is not an option, I canl take a picture with my superzoom camera, and look at enlarged details on the screen that I could not see by eye alone.

In cad, especially more so in 2D, zoom is more like "stretch the drawing in both directions, while looking at it through a defined opening size", and since the drawing does not move towards you or away from you, focus is not an issue. 

In 3D of course you could also use the "stretch the drawing - in all directions" analogy, but the distance from eye to model starts to enter into it.  Focus really doesn't come into play, as the computer draws the lines or shapes it thinks you would be seeing on a flat screen right in front of you.

While stretching the model, at some point your eye would begin to see from inside it rather than from the outside, and this or even approaching this, is where Designcad gets confused.

Of course, you could look at your drawing through a magnifying glass, and subject to screen resolution, see an enlarged portion, in which case your focal length analogy becomes important from screen to lens to your eye.

I think this is why the word "zoom" is used, the visual effect is basically the same, but the technology to achieve it is not at all the same.
« Last Edit: November 03, 2014, 08:00:56 AM by Rob S »
User since Pro-design

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #8 on: November 03, 2014, 08:17:56 AM »
I think this is why the word "zoom" is used, the visual effect is basically the same, but the technology to achieve it is not at all the same.

Rob, thanks for adding to the discussion.   Your quote is what I'm driving at, when "zooming" in, a CAD zoom and a Camera zoom can visually cause the same effect.  Maybe I should put together a SketchUP movie showing that effect.  The difference between the two zooms is when you back up.  In a CAD zooming out, you realize the camera is moving (backing up).  And we are purposely skirting the "in focus" issues with real lenses.  As Phil said, computers let us achieve perfect lenses.

By the way, your "stretching" way of thinking is a different but another valid analogy.  Rather than cameras, the user is consider fixed in size and the drawing in front of them at a fixed distance from their eyes is scaled or reduced in size.  Us soon to be older folks know this drill.  If you can't see it either get closer or have the item you're looking at get bigger.  I'm thinking of those phones with huge button numbers.  And poking fun at the younger crowd, as they age, their iphones will get larger.  It is happening already.  Same thing happened to us CAD guys.  Small screens when we were young, and now 36" screens.
« Last Edit: November 03, 2014, 09:22:36 AM by prl »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #9 on: November 03, 2014, 09:42:16 AM »
when "zooming" in, a CAD zoom and a Camera zoom can visually cause the same effect.  Maybe I should put together a SketchUP movie showing that effect.

Here are the two zooming INs compared.  Keep an eye on the bottom right corner.  As Rob mentions, visually you get a similar effect, but the two are very different in terms of where the camera is.  And yes, the cup is floating in the air.  I removed the table.

A movie - A CAD zooming IN (Camera is moving toward cup, focal length of lens is constant)

A movie - A Camera zooming IN (Camera is stationary, focal length of lens is being changed)


Here is what you see with a side by side graphic.  On the left side, the camera is almost at the cup.  On the right side, the camera is at the back of the building.




Conclusion:

I've beaten this topic to a pulp and we now know the Camera people don't have a single word for "give me a close-up" or "back up".  On the other hand, the CAD people borrowed the Camera people's "zoom" terminology but "it ain't the same".
« Last Edit: November 03, 2014, 01:08:10 PM by prl »

Dr PR

  • Hero Member
  • *****
  • Posts: 5434
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #10 on: November 03, 2014, 03:38:14 PM »
prl,

The camera people have another term - macro photography - that relates to very close up pictures, essentially high magnification. Special lenses and equipment are needed for this. And the magnification is the object size compared to image size on the film/photo element. I used to get 5X magnification using a Nikon 105 mm macro lens, two extension tubes and a bellows unit - the thing stuck out about two feet in front of the camera body!

Also, the depth of field of a lens is related to the "f-stop" - a way of describing the size of the hole in a diaphragm that the light passes through. Smaller f-stops gave better depth of field, but reduced the light so you needed longer exposures. I used a halogen light that would melt plastic after a few minutes, and 30-60 second exposure times. At 5x magnification I had a 5mm wide field (at the object) and a 5mm depth of field. Everything outside that 5x5xs5mm cube was out of focus.

And then there is micro photography through a microscope. I have done a lot of that and it is a whole 'nother bag of worms.

Fortunately, we don't have to worry about any of that stuff in CAD!

Phil
DesignCAD user since 1987

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #11 on: November 04, 2014, 12:21:36 PM »
Well, to end out this thread, a one-armed-bandit DC camera lens render. DesignCAD Can!

« Last Edit: November 04, 2014, 12:23:14 PM by prl »

Dean

  • Sr. Member
  • ****
  • Posts: 284
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #12 on: November 05, 2014, 05:31:10 AM »
Prl,
here's my perspective or point of view on the subject
 :)You are the Director, the Director's camera. "You create the view How You see it"
It’s your “perspective“on how the scene (the picture)  will look.
A director might be "closer" or "farther" away relating to the 'space,' distance between objects and “zoom” specifies  focal length. What is there  8)"really" to understand, there are endless possibilities!
There's also the element of "Time" to consider...
« Last Edit: November 05, 2014, 05:52:48 AM by Dean »
Windows 7 64 Bit Home Premium
AMD Turion™ 11 Ultra Dual Core Mobile M600 (laptop)
2.40 GHz - 4GB
ATI Mobility Radeon HD 4500/5100 Series (display adapter)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #13 on: November 05, 2014, 06:14:23 AM »
here's my perspective or point of view on the subject

 :)   I must be be making an impression on you (so said the 3d printer guy) , the wordplay, CAD, cameras, etc.  Endless fun . . . .

Lar

  • Hero Member
  • *****
  • Posts: 2540
Re: Understanding Zoom, Field of View, focal length, cameras and CAD
« Reply #14 on: November 05, 2014, 07:53:14 AM »
Prl,

I have yet to pin this down exactly but I think that in real life 'zooming in with the lens' and 'moving closer' results in the same image.

However, in CAD packages it depends on how the program was written, it seems.

Eg, from your SketchUp images it appears zooming in increases the perspective distortion, while moving closer does not.

In Dcad you can increase the perspective distortion independent of the zoom. Ie, you can set a very small camera-to-target distance and still 'fit-to-window' to see the whole model, which causes that insane distortion dcad is known for. However, this insanity is achieved by dcad being able to do something not possible in real life with the naked eye - be very close to a model while being able to encompass the entire model in the field of view (you would need a fish eye lens for that). If you simply 'zoom' in on any part of the model then the insane-distortion is eliminated.

In Cinema 4D zooming-in and moving closer has the same result<<see my post #18 for a retraction>> but you can increase distortion by widening the field of view (so you see more of the model) to  unnatural amounts to get the fish-eye effect. This would also results in seeing more of the model but you can then move the camera in closer to the desired area of interest while maintaining the distortion.

Lar,

Thanks. Your description of how to look around a drawing is the best testimony yet to why we need something better!

Click a button, set this point here, set that number, push that button, change that number ... ad nauseum. Wouldn't it be a lot easier to just move the mouse to look this way or that?

Phil
Phil, you are right, but have you ever played a 3d computer game? The interaction is great but it takes way more than one button on a keyboard to achieve it. In the games I know you control direction by moving the mouse but you have to synchronize this with movement by using one of the 4 arrow keys (or worse the "a-s-d-x" keys). To slide sideways ('straf' I think they call it), duck or jump you have to hold separate keys while pressing a movement key.  Plus, you can't set your focus on something and orbit around it, you have to develop the skill of keeping the crosshair on the target while pressing sideways keys. It takes a while to setup and a while to get use to. Using game controllers requires even more memory and dexterity, in my opinion.

I actually have a macro for 'touring' so I don't need the view toolbox open. However, other than saving me pressing enter to end the 'set view points' and allowing me control of the angle between movements of the move-left, right, up and down commands (the arrow keys in the view toolbox, which are set to 10 degrees) its about the same amount of work as using the view toolbox directly. Even in real life it requires lots of synchronized control to do a walk thru: your 2 feet have to walk, your various body parts have to turn, your eyes have to focus, etc. And it takes almost a year to learn to walk  ;D .
« Last Edit: November 05, 2014, 03:46:31 PM by Lar »