Page 1 of 1

View Blog (restored)

Posted: Thu Jul 25, 2024 8:16 pm
by Nick
In this thread I would like to expand more informally concepts related to interactive view manipulation and its programming. See also Concepts of 3D Graphics

The best way to understand it is probably to open any sample (View Point or Zoom are good to see the programmatic manipulation) and play with the
Birds Eye view a little why reading.

The core concept of View Volume is simple. You need to define which part of the world is displayed on the screen. It is determined by the View Volume which is simply an arbitrary oriented 3D box.

Whatever is inside the box is projected to the front side of the box, converted to pixels and this is what you get in the DGK window.

The view manipulations, either interactively with mouse or in code, are simply manipulations of position, orientation and size of the box. Zoom in, for example, is reduction of size of the view volume without changing anything else.

For case of perspective projection, the difference is minor in my view: Instead of a box you get a frustum, which is a slightly distorted box, but later about that.

More to follow...

Programming

Posted: Wed Jul 31, 2024 3:49 am
by Nick
More precisely View Volume is defined as a box (three ranges) aligned to a set of axes (frame) called Eye Frame.

To access and manipulate Eye Frame use
dgk > GetView() > IView_DG > IView_DG.GetEyeFrame() > IFrame_DG.

For an example, Calls to IFrame_DG.Translate() on the interface will result in pan.

IView_DG.ViewingVolume property defines the three local to eye frame ranges of the View Volume.

Normally it is more convenient to use higher level methods of manipulating View Volume. IView_DG.Reset() is the most frequent operation to fit the scene into the view with default initial rotations to show the scene at some angle.

See also IView_DG.GoTo(), IView_DG.LookAtEntity(), etc.

Remember to call IView_DG.Update() or dkg.UpdateView() to repaint the window after series of manipulations.

Direct manipulation of ranges of the View Volume needs attention to keeping x and y ranges (horizontal and vertical) to have the same aspect range as the window. During modification, the component adjusts the input, when necessary, to make sure it is true.

Depth range (z range) is also little tricky. More on this in the next post

Depth zoom

Posted: Fri Aug 02, 2024 2:00 am
by Nick
Part of the scene outside the Z range of the View Volume is rendered, do it is not visible. Normally the range should include al objects, otherwise it can be very confusing.

Making the range too long is not good as it changes center of the viewing rotations which navigating interactively. It also reduces precision of surface point selection. For these reasons the depth range is updated automatically very frequently to include all objects with some extra room for rotations.

Sometimes with very clattered scene, like analyzing problems with mesh in high zoom, it is useful to reduce the range to cut off the part before or behind the focus area. For this there is depth zoom functionality.

Changing depth zoom in the code is possible, but it is better to avoid it.

Advanced

Posted: Mon Aug 05, 2024 1:48 am
by Nick
For completeness: We do not use Camera concept often mentioned in literature and graphical software. We believe it a secondary notion coming from some traditions. View Volume is clearer and more convenient for both interaction and programming, in our view ( :? :lol: ).