DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Understanding Zoom, Field of View, focal length, cameras and CAD

Started by prl, November 02, 2014, 01:39:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

To add more perspective projection (distortion), same process as above but with 20 mm focal length.

Lar

Quote from: prl on November 10, 2014, 11:39:30 AM
Just so you know, you're the only one, or actually C4D is the only program that can verify if what I'm doing with SketchUP is correct.  ...
C4D screen capture is attached...

My analysis: Even though the capture areas of the 2 cameras are the same at the target (see camera cones in window-1, the target is the blue object) the 2 camera images are different because the closer camera (GREEN Cam) has a wider field of view (therefore more perspective??) and just being in different locations results in different parallax.

What you may find interesting is that the target object is nearly the same in both camera images. If you open the attached image in an editor and cut out one of the blue object (from the camera images) and place it over the other blue object you will see that their perspectives are only slightly different. If the target was shorter you may not notice the difference.

Lar

prl

Thanks Lar, you've done exactly what I needed.  Time for me to think about this.  (I like the way C4D shows those cameras!!!!!!)

From your previous graphic in reply #68. http://forum.designcad.com/index.php?action=dlattach;topic=5968.0;attach=14356;image, I thought focal length was the controlling variable.  Everything else appeared as a cropping on the image sensor with a re-computed FOV. But I was wrong. And so perspective projection is the result of the cone angle (FOV) with the other values (fl, iss) re-computed (rearranging the equations so to speak).

And of course this brings me back to DesignCAD and how it computes some unknown FOV using the perspective distance buttons.  Which is what I was hoping Dt could look behind the curtain for.  Specifically the math DesignCAD is using to convert camera-to-target distances into FOVs resulting in perspective projection distortion.

Ultimately I would like to boil this thread down into defining the various zoom terms, (so they aren't misused or misunderstood as this thread started) and then of course write some code that will let me have DesignCAD conform to the more normal camera terms used by SketchUp (and C4D).



Lar

Quote from: prl on November 11, 2014, 12:00:58 AM
And of course this brings me back to DesignCAD and how it computes some unknown FOV ...
At this point in eternity just ignore dcad's FOV (field of view) and consider its ZP (zoom percentage). Whatever the camera distance is, if you fit to window dcad shows the entire model. If the model is outside of the camera's FOV cone this widens the FOV without moving the camera distance. Result: distortion.

To correct this distortion simply zoom in on the target area until the perspective looks ok.

If you want to get the correct zoom: decide upon a FOV (60 to 90 degrees, depending on the artistic perspective desired, works for me - in real life photographers get this artistic perspective by changing lenses), draw a 3D pyramid of that FOV angle. Vector Convert and Group it. Locate it so its peak is at the camera location and orient it along the camera's Z axis (set handle-0 at the peak and handle-1 at the base-center of the pyramid... place handle-0 at the camera location and handle-1 at the target location. With 'original scale' off the base would frame the target area). In the window that shows the camera's view the base should visually be perfectly square (if not then set 3 handles when orienting the pyramid), but not at the edges of the window. Zoom by snapping at diagonally opposite points of the base. If your window is square then the base should fit the entire window. The window would probably not be square so only two opposite side of the base would be at the window's edges. I have not tested this method myself but I guarantee you the insane-distortion would be cast into the abyss, replace by a more natural perspective.

If your final rendered image is to be non-square you can make pyramid of the aspect ratio of your desired final image so as to get a preview of the final image area. When saving the image you can snap the 2 points at the base (so the pyramid don't show in the final image you can set very tiny pointmarks and remove the pyramid from sight).

Lar
ps: it just hit me that using my pyramid method you can have visual icons of dcad's cameras, which can all be placed on a dedicated layer and turned on/off to show/hide your desired camera positions, all adjustable using the move command with 2 or 3 handles and 'original scale' off. In fact, it'll probably take Prl about 5 minutes to write a macro where you select a pyramid and you get the view through that pyramid cam. If he's in a cozy mood he will probably throw in the creation of those pyramids as well.

prl

Quote from: Lar on November 11, 2014, 06:41:08 AM
To correct this distortion simply zoom in on the target area until the perspective looks ok.

That's funny.  Yes that's my method too.  I just keep pushing buttons till it looks the way I want it to.  Or in the case of some of those IDX insane distortion renderings, when it looks wild enough.


Edit: Your C4D aperture field is still making me ponder why they (the C4D) people have it.  It adds another twist to perspective projections.  Also wonder what it would mean physically if you were sitting in the zip-line chair.  Since the model is stationary, you're in the chair stationary, what the heck is happening to the camera in your hand?

Lar

Quote from: prl on November 11, 2014, 07:04:04 AM
Edit: Your C4D aperture field is still making me ponder why they (the C4D) people have it.

Quote from: Lar on November 07, 2014, 05:18:50 AM
The A/W control seems to be unnecessary in CAD but C4D goes overboard with everything, which is cool and can be very educational but can also be very daunting.

prl

Quote from: Lar on November 11, 2014, 06:41:08 AM
  write a macro where you select a pyramid and you get the view through that pyramid cam

That is a clever idea.  You're thinking outside the pyramid.

I'll try this manually and compare images with SketchUP.  Looking for a little more predictably in DesignCAD and you may have just invented the new LarCam viewing method.

Lar

I just stole some of my own time and tried it. It works just as I described. Even down to using 3 handles.

If you are not concerned about a precise FOV angle then it's easier to create the pyramid than I thought:<<...redundant: if not concerned about angle then just zoom in until the distortion goes away...>>

1] draw a line from your target position to your camera position (in that order, so it'll be easy for a macro to use in the 'set viewer points' command)...

2] if the line's angle is not ortho then set a working plane using the 2 points of the line...

3] draw a pyramid: point-1 at the target (point-1 of the line), turn on ortho mode and set point-2 perpendicular from there to cover your subject. This will be your base and will determine your field of view angle. Turn off ortho and set the last point at the camera location (point-2 of the line)...

2] To draw a pyramid of a precise angle: Draw an 'Arc' (first one in the 'Main Toolbox' arc drawer), set the angle as desired (60 seems to work well for exteriors, 90 - 110 for interiors), set pt-1 for the center and pt-2 wherever. Select the arc and set 3 handles: center, midpoint, and endpoint. Use the move command to straighten the arc so its absolutely flat from the top and probably pointing in the drawing's Z direction. Draw a cross-line from endpoint to endpoint, select it and put a point at its midpoint (point select mode). Now draw the pyramid: activate 'midpoint' in the little dialog, set pt-1 at the midpoint of the cross-line, pt-2 at an endpoint and pt-3 at the center point of the arc (even if in ortho mode the last point will be set properly).

4] reset the working plane...


3] start the 'set viewer points' and set pt-1 at the target and pt-2 at the camera. The view will change accordingly and probably be distorted. If the base of the pyramid is not a visually straight square then you will have to adjust it using 3 handles as described in my reply #78 above...

4] now zoom by setting points at opposite ends of the base.

Note: Move/duplicate the line and pyramid together, but don't group them. That way you can adjust the end points of the line, without changing its angle, by selecting it in point select mode, putting the cursor close to an end while holding the shift key (3 dots will appear at the cursor) and moving the mouse. Click when satisfied. Then start the move command and move the pyramid along the line using the 3 handles with 'original scale' off. The pyramid will scale to fit the new target area.

Lar