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.

DesignCAD Theory of Parallel Visibility morphs into a Phil question

Started by prl, November 09, 2014, 05:24:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

Not sure if all you guys (Lar, Sam, Dean, Phil, Robs, etc) realize we all keep dancing around why does DesignCAD display things the way it does.  My whole topic of cameras, zooming, etc. keeps coming back to What is DesignCAD doing and why/how?

So I'm now peeling off a question Phil asked in this topic

Quote from: Dr PR on November 08, 2014, 12:31:23 PM
One thing that I think I saw in one of the "movies" posted here was things disappearing from the background.
.
.
.
But why do the more distant objects disappear?

Phil,  apparently you and most everyone missed the interesting results we (Sam, Dean, myself) discovered in that long thread titled DesignCAD Theory of Parallel Visibility.  Although that topic was exploring axonometric projection views, the concept of 3d camera viewing boxes does also exist in perspective projection mode.  Sam originally started that exploration when he noted how weird things happened at certain perspective depth distances.  I discovered that is related to the view center and DesignCAD's 3d camera viewing box.

Yes I know, all the great discoveries are buried in these topics which have a mix of humor, irreverence, BS, and fact.

Watch this movie.

A movie - DesignCAD's 3d camera viewing box EXPOSED - Rated PR

When the movie is done playing, take the slider and move it back and forth.  It will show you the clipping planes as if you were moving the model.  But if you want to do it yourself, the DesignCAD file is attached.  Select the 3d group object in the left window and move it. Watch the right window which has the view center positioned accordingly.  No tricks.  Any version of DC can do that.

And the reason it is called Russian Dolls is because there are different colored solids contained within the outer solid.  You know, the doll within a doll within a doll . . . .


All this should be plenty to chew on!!!

prl

I'm curious if folks understand the implication of what is being demonstrated.  DesignCAD's camera in the right view is inside that 3d dashed box I have shown in the left view. That's why you can't see the 3d objects until I start moving them into the 3d viewing space.

And if you are confused.  DesignCAD maintains a different camera for each view.  That is why in the left view you can see the model.  The 3d viewing box for that view encompasses the smaller 3d view box.

Think about it.  It will come to you.

Dr PR

prl,

Note: I am using terms from the DesignCAD Reference Manual to avoid creating more terms that are meaningless to everyone else, especially those who take the time to read the manual.

What you call the "front clipping plane" is what DesignCAD calls "Viewer Position." This is the virtual plane that DesignCAD builds the image on. Anything behind this plane (relative to the View Center) is not displayed.

Somewhere between the Viewer Position and what you call the "rear clipping plane" is the "View Center." It is the View Distance away from the Viewer Position in the View Direction. The view is always centered on the View Center.

Is the View Center where you show the three axes?

I have long understood the relationship between View Center, View Distance and Viewer Position and how it causes objects that are farther away from the View Center than the View Distance to disappear as the view is changed. I guess I have been lucky because I have never seen the "rear clipping plane" before. I assume it is at the View Distance behind the View Center as seen along the View Direction, but I have never experimented with it.

Phil
DesignCAD user since 1987

prl

Quote from: Dr PR on November 09, 2014, 12:19:19 PM
Note: I am using terms from the DesignCAD Reference Manual to avoid creating more terms that are meaningless to everyone else, especially those who take the time to read the manual.

Glad I helped you see the rear clipping . . . which you've never seen.   Rolling my eyes.

Dr PR

There is one more very important concept that has not been brought up in the discussions that I have read (and I do skip those threads that have more BS than real content).

When DesignCAD creates a 3D image it draws a 2D image on the screen plane. This is the XY virtual plane of the image being created. The View Direction (line of sight) into the drawing is the Z axis of the image. The program subdivides the entire drawing into a stack of cells perpendicular to the View Direction. This is called a "Z buffer."

Note: Image X, Y and Z have nothing to do with the actual drawing X, Y and Z coordinates.

Each Z buffer cell is a thin section of the view, and the program places images of elements of the drawing (planes, facets, lines, etc.) into the appropriate Z buffer cell depending upon the distance from the object to the Viewer Position (center of the image plane). More distant object images go into the more distant Z buffer cells, etc.

Then it creates the display by drawing the closest Z buffer cells over the more distant cells.

****

The depth of a Z buffer cell is related to the View Distance. Each cell is a fixed fraction of the View Distance.

When the View Distance is short each cell depth holds a thin slice of the drawing. When the View Distance is significantly greater than the actual dimensions of the drawing each cell slice is relatively thick.

As the view distance increases each cell depth increases, so objects that are close together (along the View Direction) get lumped together in a single Z buffer cell. When the display is created this can result in two or more surfaces being intermingled, creating a zebra stripe pattern, or just causing one to be hidden behind the other, even though it may actually be closer. It is a matter of the order in which the images were generated, and that may not correspond to the actual positions in the drawing.

My guess (I am not certain of this) is that the Z buffer is centered on the View Center, and the depth is twice the View Distance. So it extends from the Viewer Position (screen plane) through the View Center and one View Distance beyond.

This would explain why objects disappear from the far side of the image when the View Distance is shortened to less than the actual drawing depth along the View Angle (line of sight). More distant objects are too far away to fall into one of the Z buffer cells, just as objects behind the Viewer Position also do not fall into a Z buffer cell.

****

The problem of having more distant objects disappear is the result of having a View Center. A better way to do it would just be to use the distance along the View Direction from the Viewer Position (view point) to the most distant objects in the drawing to create Z buffer depth.

This would prevent more distant objects from disappearing, but would not change the other issues. Objects behind the View Position shouldn't be shown, and if the Viewer Position is moved back far away from all the objects in the drawing everything might be lumped in a single Z buffer cell and they might be displayed strangely. But who cares? This is an operator problem.

A better way would be to make the Z buffer depth equal to the actual drawing depth along the View Direction, regardless of the distance between the Viewer Position and the drawing. Changing the View Distance wouldn't change Z buffer cell depth or how the different Z buffer cells are displayed relative to each other. Only the sizes of the displayed objects would change relative to the screen size as the View Distance changed.

Phil
DesignCAD user since 1987

prl

OK Phil, I'll explain why I rolled my eyes.  Nice detailed info and everything about perspective, view distance and buffers.

But the movie and the model was showing an axonometric feature of DesignCAD.  Technically no view distance . . . . . . and it was following up on what Dean refers to as "space", fundamentally the effective range we can see things in the DesignCAD universe.  It is a function of OpenGL acceleration code and perhaps some DesignCAD implementation quirks.  So since things are moving in/out of the effective range in Dean's movie, I was offering a suggestion of what is going on (which you asked about.) 

Dr PR

prl,

I guess the reason I have never seen rear clipping is that I learned a long time ago that I should use a View Distance about 3-5 times the greatest dimension of the drawing. That, along with with a total indifference to the location of the View Center, combined to prevent your "rear clipping" from happening.

I say "indifference" to View Center position because I normally use the "Set View by Drawing Center" to rotate the entire drawing view, and I use the "vc.d3m" macro for close inspection of individual objects - that macro sets the View Center automatically. In all cases my View Distance is relatively large so I am seeing the "jeweler's view" from the outside in.

It is only when you move the Viewer Position inside the drawing that the clipping problems occur, and I learned long ago that DesignCAD did a lousy job of "architectural" walkthroughs and gave up on it. The program wasn't designed for that so don't do that!

Much of my way of using the program has developed from 25 years of learning what not to do in order to avoid the bugs and design shortcomings.

Phil

DesignCAD user since 1987

prl

Dt - if you could look behind the curtain and tell me the mathematical relationship between  the perspective view distance (camera to target) and focal length, I'll take it from there.

Lar

Prl, I don't think there is any linked relationship between the 'view distance' and the field of view. If there was then when you press the 'Increase/Decrease View Distance' arrows of the View Toolbox the zoom factor would change, but it doesn't and this accounts for dcad's signature insane distortion. Eg, you have a model of a building zoomed to fit-to-window... you decrease the camera distance... you should no longer see the entire model, which would happen if you reduce the camera distance in real life... however in dcad the full model is still visible... and to accommodate this the perspective has increased... imagine that as you walk closer to a building you eyes bulge out more and more so you always see the whole building.

Soooooo... I guess the relationship you seek can be figured in this way: draw a line from the camera location to the left side of the model's bounding box, then draw one from the camera location to the right side. The angle between these 2 lines is the field of view.

What you should be interested in finding is: for a given field of view, camera location and viewing angle, what should be visible in the drawing window. This can easily be investigated with simple geometry: where the field of view lines cross the model should be at the edges of the drawing window. Dcad does not have a field of view setting but you can just decide on one yourself. I think the normal field of view for humans is supposed to be 60 deg but in Cinema 4D I set it to 90 deg for building interiors.

Dcad's Clipping Planes
I thought it was common knowledge that a dcad camera has a clipping cube and only things within the cube is drawn in shaded and hidden line modes. DT mentioned it way back and I posted how I made use of the 'feature' in one of the 'parallel visibility' post (thought it's difficult to portray with images only) and its dimensions (reply #27, http://forum.designcad.com/index.php?topic=5532.15). Its purpose is to generate non-destructive slices and I guess to get in between objects. I find it a humbug because 1] it's always perpendicular to the camera, 2] you can't manipulate its size, 3] the front plane is in front of the camera rather than at the camera... and 4] you can't turn off the rear clipping plane.

*************************************************************
Oops... This part of the reply is in the wrong topic... The proper topic can be found here (reply #71, http://forum.designcad.com/index.php?topic=5968.msg42187#msg42187)
Quote from: prl on November 08, 2014, 12:11:11 AM
Lar, referring to your graphic above.  May I ask you snap three graphics of your example building.  One using aw = 36, fl = 31.117,  aw = 72, fl=31.117, and aw=72, fl=62.354.  Seeing is understanding.

Image attached... Note that both settings of the 3rd camera are doubles of the 1st, so the field of view is the same and thus the view in their respective windows are the same. The 2nd camera's aw is double the 1st but its fl is unchanged, resulting in a wider fov angle, thus we see more of the scenery. essentially zooming out.
Lar

Dr PR

Lar is correct.

The view angle is dependent only on the zoom extent. Zooming does not change the View Distance, it simply increases or decreases the view angle.

The "Fit to Window" function will adjust the zoom level (view angle) so everything is in view if the View Distance is greater than the dimensions of the drawing.

Note: This does not necessarily put the View Center in the center of the screen.

Then as you zoom in (+ key) objects at the edges of the view move off screen and the view narrows so only objects near the cursor are seen.* Continue to zoom in (+ key) and if the cursor is not over an object the view will narrow so much that none of the drawing objects can be seen.

The Zoom functions use an existing image and enlarge or reduce it without regard to the Viewer Position, View Distance or View Center. This is a relic of the original Prodesign which was totally screen image oriented.

All the zoom functions do is examine a part of an image already generated with the Viewer Position and View Center. This is essentially what you do in Photoshop or any other image editor. The photograph may have been taken with a camera pointing at a particular object in the scene, but you can zoom in to any other part of the image to enlarge it.

Note: As you zoom in/out the View Center, Viewer Position, View Distance do not change and the View Direction is still pointing at the View Center. If you use "Set View by View Center" the view will still orbit the View Center. But if you are zoomed in so far that the view angle is extremely narrow you may not see anything.

Phil

* In older versions the program always zoomed in/out from the center of the screen. In later versions the +/- zoom key functions enlarge/reduce the part of the image around the cursor.

DesignCAD user since 1987

prl

Quote from: Lar on November 09, 2014, 10:01:17 PM
Dcad's Clipping Planes
I thought it was common knowledge that a dcad camera has a clipping cube

Lar, it is/wasn't obvious to me.  Doesn't happen in wireframe.  Doesn't happen in GDI.  Only happens in OpenGL accelerated graphics.  And to purposely quibble with Phil a bit, it isn't documented in the reference manual.

Anyway, thanks for attaching the C4D graphics I asked for.  I'll give things a rest for a bit.

edit:  Argh, you said something in your post which is at odds with what I think or thought was happening.

In DesignCAD I am/was assuming that when you click those view distance buttons, because the perspective image/distortion changes, I assumed that is/was the equivalent of rotating the zoom ring on a real camera zoom lens thereby adjusting the FOV/focal length.  As I said, time for me to sleep on all this.