NOTE: This page has been translated automatically from Russian to English. Original page.
1C.Net:Предприятие + DirectX = 3D-graphics on forms 1C: Enterprise
The above example for 1C: Enterprise 8.1 is dedicated to three-dimensional graphics. Information on the use of 3d 1C Internet does not provide. Example 1C will be useful to developers, the programming for the soul. Since it is difficult to imagine accountants, both in the game, walking inside the virtual 3D 1C-warehouses, flipping a virtual 3D-magazine documents. Although, why not. Who knows what will happen in a few years and how to change the familiar program.
Immediately it should be noted that the information on 3D-programming in .Net Framework in Russian and almost none. In English units, and worthy of articles as a basis for an example taken article «the Windows Presentation Foundation (a WPF) 3D the Tutorial» . Article volume and its translation into Russian may take a long time, so there is not so furnished. Who has problems with English, I offer good service to use Google Translate to translate.
As WPF uses DirectX
Application in .Net-technology applications to work with WPF rich graphics (Windows Presentation Foundation) already implies the use of DirectX. Below is a diagram of the key components of WPF, which shows that the lower level is DirectX technology.
WPF (Windows Presentation Foundation) in its work uses DIrectX. For these purposes is MILCORE (Media Integration Layer Core) - unmanaged component that handles the 2d, 3d, animation, referring to DirectX. Speed work - DirectX dignity - this is the main reason why milcore designed as an unmanaged component. Milcore - an interface between DirectX and CLR (Common Language Runtime). PresentationCore assembly does not contain controls, but contains basic types to determine the UI-elements. PresentationFramework contains definitions of elements of WPF controls and the implementation of related functionality.
How to use DirectX 1C: Enterprise
When it comes to 1C .Net framework, to the rescue comes Elisy .Net Bridge component. The component is sufficient to describe the Internet dozens of examples written for him. In this case, the basis will be taken an example which shows how to embed WPF-control on the form 1C. More information on this subject can be found in the article «1C.Net:Предприятие - use .Net framework rich graphics capability" . The problem pasting WPF-kontrola involves the use of an auxiliary Elisy.HwndHost ActiveX-component, which is necessary to implement the handler Created event.
The interface is described in WPF XAML language. The description file is attached to the external processing as Xaml layout. The description file is a key target Viewport3D class named mainViewport. It identifies the camera (PerspectiveCamera) and lighting (DirectionalLight). Properties cameras are configured through the user interface and are stored in the details of the external processing.
The impression of an example
Working with 3d-graph in any environment, be it C ++, C # or 1C - it is not a simple one. But the possibility of using three-dimensional graphics in the 1C: Enterprise, which previously could only dream of, 1C puts on a par with other popular systems.
To successfully develop 3d-applications, it is necessary to recall the course of high school and understand the vectors point in three-dimensional space, the surface normal.
Example lets you draw a triangle, cube and the surface. Properties view camera and configured through the user interface and are stored in the details of the external processing. If necessary, the normal to the planes can be visualized. And if you want - to show the net and see, based on what primitives are constructed three-dimensional figures.
The entire sample is replete with reference to the space System.Windows.Media.Media3D names , information about which can be found on MSDN, even in Russian.
Alarming fact that the implementation of a simple example with the construction of, say, a cube, you need to write a lot of code. But it is not cost 1C, a common problem of any three-dimensional graphics programming.
conclusions
Subject to the three-dimensional graphics 1C fairly new, in this regard, the Internet can not find examples of this connection. It turns out that the example shown here is a pioneer in the 3d-graphics. The advantages include full integration with 1C, where drawing is conducted in the form of other family members 1C control.
Although the practical value of the technology applied to 1C think hard. Fantasia tells only the virtual 3D warehouse or planogram marchendayzerov. However, the method makes it possible to program 1C for the soul. After all, many young designers dream to create the future of the game, and the technology will allow them to practice in familiar 1C system right now.
Related Links
The original example in C #: «Windows Presentation Foundation ( WPF) 3D Tutorial»
System.Windows.Media.Media3D - namespace
1C.Net:Предприятие - .Net Framework use rich graphics capabilities
// //