**8. Regular/tilted/truncated pyramid**

The algorithm for building a regular/ tilted /truncated pyramid (**Figures 3** and **4**) is as follows:


**Figure 4.** *Truncated pyramid.*

**Figure 3.**


The traditional way to generate a regular polygon is through trigonometry. It is characterized by the number of vertices and radius—its length. To generate a cone, the traditional method (**Figures 5** and **6**) is used. The following are set:


The traditional method of generating a regular polygon is based on trigonometry and is characterized by the number of vertices and radius. To construct a prism and a pyramid through this method, the 3D graphics modeling technique is

#### *Virtual Reality in Stereometry Training DOI: http://dx.doi.org/10.5772/intechopen.107422*

**Figure 5.** *A straight cone.*

used—extrusion, which is a big drawback. The new authoring method for generating polygons is characterized by the number of vertices and the side length of a regular polygon. This method gives a more accurate result than the traditional one because it does not need to be extruded. It uses only the ratio of parallel segments, not trigonometry, which differs from the traditional method. The author's method accurately results because it does not use trigonometry. A disadvantage of the new approach is that it requires a lot of computing power. Also, another limitation is that for now it is limited to 6 vertices. The new method can be applied to any regular polygon with unlimited vertices growth. The proof that the method works is that it allows visualization through a 3D virtual reality library and the ability to export to a .obj file.This paper uses the author's new boundary method to generate a regular quadrilateral pyramid. Values are set for the 4 vertices and the length of the base, respectively. Next, set a value for the height. While for the geometric body cone, the traditional method is used. Defines the base by a number of vertices, radius, and extrude height.

Before starting the process of 3D printing or adding a 3D model to a virtual/augmented reality device, it is necessary to create a file (.obj) containing the necessary information about the geometric object's spatial characteristics. This type of data is stored in text format and can be modified using a text editor (eg, notepad). These files contain the following information about the geometry of the object:


The stereoscopic system makes it possible to represent geometric objects in two ways—solid and wireframe mesh. The wireframe mesh representation will make it possible to understand the geometry of the three-dimensional model. While the solid gives a finished look to the geometric figure. These are its visual characteristics. It is preferable that before exporting the geometry object to a .obj file, it should be generated as a solid body. The Canvas3D class is a component of the AWT interface library and extends a two-dimensional object into a three-dimensional one by including the necessary 3D information. It represents the canvas where the three-dimensional objects are drawn. One of the modes for stereoscopic visualization is Mixed Immediate. The stereoscopic system uses this mode for stereo visualization through active glasses. The advantage of StereoMV is that it uses the Java3D library. And so it can be realized by a virtual reality device, such as:


In **Figure 7** presented: traditional, anaglyph, and stereo visualization of a objects. After exporting the geometry object to a .obj file. It can be added to an augmented or virtual reality device. The article uses the 3D viewer program in Mixed Reality mode using animation (**Figure 8**). In (**Figure 9**) HMD mode, each eye needs to have its own display. For this purpose, two canvas3D objects for the left and right eye need to be added.

**Figure 7.** *Traditional, anaglyph, and active visualization.*

**Figure 8.** *Mixed reality 3D viewer.*

**Figure 9.** *Stereo cone—2 Canvas3D objects for HMD, left and right eye.*
