Building Isometric Applications

The task is put to develop the three-dimensional graphic interface including visual stereocomponents (Stereo Vision compoNents), three-dimensional forms (Shapes) and isometric applications (Isometric Application). As means of development language C # and DirectX 9.0 has been chosen.

1. A three-dimensional font (AlfabitEn)

Usual generation of three-dimensional symbols by means C # gives model with too plenty of poligons, manual coding symbols in text X  format therefore has been executed. In result models with a small amount of poligons that has provided the fast text processing, submitted with use of these symbols have been received.
LAcut256.bmp
Fig. 1. Symbol A

2. The button (ButtonSph)

This component is used to begin, interrupt or finish process.

3. A Label (LabelCyl)

This component is used for display of the static text.

4. A text field (TextCyl)

This component is used for input of text type data.
TextCyl256i.bmp
Fig. 2.Text field

 
5. The list (ListCyl)

This component is used for a choice from the list of the set element. In the list it is possible to add new elements or to delete existing

6. The menu (MenuHypButton)

This component is used for creation of the hierarchical menu. There is a basic button of the menu. The menu will consist of several levels. At the top level the buttons representing elements of the main menu are located. They consist of  groups of the commands incorporated under the contents. At a choice of an element of the main menu automatically there is a menu of the second level with commands of  direct action.

7. The multiline text (TextHyp)

This component is used for input of several lines of the text. In the multiline text editing is carried out separately for every line. For display of invisible parts of the text it is used Scroller (the cylinder of scrolling). It allows to scroll the text in a vertical direction.
TextHypi256.bmp
Fig. 3. Multiline text

8. An elliptic image (ImageEll)

This component is used to draw models of objects in X format. For change of scale of X model it can be used Scaler. It allows to change a scale multiplier of model (to increase or reduce model).

9. Three-dimensional forms (Shapes)

3D forms are intended for visualization of objects of a subject domain. 3D the form enables to communicate with the user. Each form represents an object of class ShapeBox.
proj84cut256.bmp
Fig. 4.3D forms (ShapeBox)


10. Derivative component  Framer

This component is used for change of the size of forms.

11. Derivative component Translator


This component is used for change of position 3D forms and realizations of the general management (a call of the menu, change of representation, change of a transparency, closing of the form, demonstration of heading).


12. Architecture of applications

For realization of isometric applications use the following classes:

12.1.      Form - application object, which basic methods the following:
Form () - the designer, is used for initialization of objects,
SetupCamera () - an establishment of frustum parameters,
InitializeGraphics () - initialization of graphic objects (a call of designers of classes Components, Shapes, ShapesInputOutput), pointer, components, 3D forms,
UpdateInput () - management of navigation, a choice of objects,
OnPaint () - visualization of pointer, graphic objects (a call of methods Draw () graphic objects),
ButtonSph_Click () - click of the mouse on 3D  button,
TextCyl_Enter () - data input in the cylindrical text,
Translator_Move () - moving 3D forms,
Framer_Move () - change of the size 3D forms.

12.2.      Component - a component of SVN library, which basic methods:
Component () - the designer, is used for initialization of object,
Draw () - visualizes the given object.
(For example, LabelCyl, TextCyl, ButtonSph, ListCyl, TextHyp, MenuHypButton).

12.3.      ShapeBox - object the basic 3D the form, which basic methods:
ShapeBox () - the designer, is used for initialization of object,
     Draw () - visualizes the given object.
(For example, ShapeBoxT (editing of the text data), ShapeBoxI (editing 3D models in format X)).

12.4.      ShapeBoxInputOutput - object derivative 3D  form, which basic methods:
ShapeBoxInputOutput () - the designer, is used for initialization of object,
Draw () - visualizes the given object.
(For example, ShapeBoxAbout, ShapeBoxOpen, ShapeBoxSaveAs).

According to used classes it is possible to define(determine) the following types of isometric applications:
1.      SVN - application on the basis of class Form and classes Components.
2.      Single Shape - application on the basis of class Form, class ShapeBox and classes Components.
3.      Multi Shape - application on the basis of class Form, class ShapeBox, classes ShapeBoxInputOutput and classes Components.


13. SVN  application

     As an example of this type of application we shall consider application StaticCalculator « Calculation of value of arithmetic expression »
Z = (a:b+5.68) / (a*sin (x) +b*cos (y)) ^2
It is necessary to enter the following changes into class Form:
13.1.      To define  member variables of class Form, corresponding to the initial data a, b, x, y and to result R.
13.2.      In method InitializeGraphics () to add creation of objects of realizations of graphic interface components: cylindrical text TextCyl (TEXT A), TextCyl (TEXT B), TextCyl (TEXT X), TextCyl (TEXT Y), cylindrical labels LabelCyl (LAB A), LabelCyl (LAB B), LabelCyl (LAB X), LabelCyl (LAB Y), spherical button ButtonSph (BUT R), cylindrical labels LabelCyl (LAB R), LabelCyl (RES)
13.3.      In method OnPaint () to add: visualization of the cylindrical text, visualization of cylindrical labels, visualization of cylindrical buttons.
13.4.      In method OnKeyDown () to add saving of variables.
13.5.      In method ButtonSph_Click () to add calculation of result and output of the answer.

14. Single Shape  application

     As an example of this type of application we shall consider the editor of X models Moditor. It is intended for viewing and editing of models in X format with realizations of functions 3D forms, function of X file opening, end of work of the application, viewing of the description of the application.

Events

Events are inherited from ImageEll and ShapeBox.

Event FileOpen - opening of X format file, a output in working space 3D forms ShapeBoxInput for definition of a name of a file - FileOpen. For occurrence of this event it is necessary to click the mouse by the button of basic menu File_Open. Event FileExit - end of work of application Moditor. For occurrence of this event it is necessary to click the mouse by the button of basic menu File_Exit. Event HelpAbout - output descriptions of the applications (the name, the version, the developer, year of release), a output in working space 3D forms Shape-Box_Output_Help_About. For occurrence of this event it is necessary to click on the button of menu Help_About.

Properties

Properties of the editor of X models Moditor inherited from ImageEll and 3D forms ShapeBox. A member of class ShapeBoxI are objects of class derivative 3D form ShapeBoxOpen, and class derivative 3D form ShapeBoxAbout are.
proj12house256.bmp
Fig. 5.Editor of X models Moditor


15. Multi Shape application

As an example of this type of application we shall consider text editor Teditor. The text editor is intended for editing not structured text, with realization of functions 3D forms, with addition of functions of opening any svd file, saving of results of editing in svd  file, end of work of the application, viewing of the description of the application.

Events

Events are inherited from TextHyp, from TextCyl, from ShapeBox.

Event FileOpen - opening of svd file, output in working space 3D forms ShapeBoxInput for definition of a file name - FileOpen. For occurrence of events it is necessary to click the mouse by the button of basic menu File_Open. Event FileSaveAs - saving of results of editing in svd file, output in working space 3D forms ShapeBoxInput - FileSaveAs for definition of a file name. For occurrence of events it is necessary to click the mouse by the button of basic menu File_SaveAs. Event FileExit - end of work of application Teditor. For occurrence of events it is necessary to click the mouse by the button of basic menu File_Exit. Event Help_About - viewing of the description of the application (the name, the version, the developer, year of release), output in working space 3D forms Shape-Box_Output - Help_About. For occurrence of events it is necessary to click the mouse by the button of basic menu Help_About. Also events Edit_Cut, Edit_Copy, Edit_Paste are realized.

Properties

CharBuffer (the text buffer). Also properties of component TextHyp and 3D forms ShapeBox are inherited. A member of class ShapeBoxT are an object of class MenuHypButton (the basic menu of the following structure:
Menu - File-Open - SaveAs - Exit
-      Edit - Copy - Cut - Paste
-      Help - About)

Member of class ShapeBoxT are object of classes derivative 3D form ShapeBoxOpen, derivative 3D form ShapeBoxSaveAs, derivative 3D the form ShapeBoxAbout.
proj924cut256.bmp
Fig. 6 Text editor Teditor

16. Derivative 3D forms ShapeBoxOpen, ShapeBoxSaveAs, ShapeBox_About

These forms are used for input of file names  and for output of the description of the application. The name of the program, the version, the developer, year of release is draw.

Properties

Properties derivative 3D forms : shMesh (mesh), shMaterial (material), pos (position), orient (orientation), size (size), scale (scale factor), InFocus (in focus), Alfa (transparency), trans (object Translator), labelO (labels – cylindrical labels LabelCyl objects), buttO  (to open), buttC (to cancel) - (buttons - spherical buttons - ButtonSph objects), textO (the cylindrical text - TextCyl objects - are used for input of names), label0, label1, buttOK,( is used for end of viewing of the description).

Events

The first event - Button_GetFocus. For occurrence of this event it is necessary to move pointer to limits Bounding Box of this button. The second event - Button_LostFocus. For occurrence of this event it is necessary to move pointer from limits Bounding Box of this button. The third event - Button_Click. For occurrence of this event it is necessary to execute click of the mouse by the button.

17. Stereomode

For realization of a stereomode the active stereo is used on the basis of method Aternate Line. Stereopair decays for even and odd lines. Each element of stereopair, thus, contains twice less lines than a raster on the screen.
As an example of application of the given stereomode it is possible to use eDimensional shatter glasses (www.edimensional.com) with LCD monitor.

The list of the used sources

1. D.Bowman, E.Kruijff, J.LaViola, I. Poupyrev. 3D User Interfaces: Theory and Practice. Addison-Wesley, 2005, 512 p.
2. A. Thorn. DirectX 9 User Interfaces: Design and Implementation. Wordware Publishing, 2004, 330 p.
3. Lakhov A. Visual stereocomponents. // Information technologies of modelling and management. - Voronezh, 2008 - #7 (50) - P. 842 - 845.
4. Lakhov A. Basic three-dimensional forms. // Information technologies of modelling and management. - Voronezh, 2009 - #1 (53) - P. 21 - 25.

Up Next
    Ebook Download
    View all
    Learn
    View all