Abstract
In order to enable the students to experience the actual engine room working environment, have a full understanding of the Marine ship equipment, and have the same operating experience as the working environment in the real ship cabin to improve the effect of education and training, the rudder cabin of a Dalian ocean 10000-ton super large oil tanker “Yuanshan lake” is used as the virtual design object. First, the mathematical model of the rudder is set up on the basis of introducing the related concepts of the ship system. Then, the layout of the actual cabin is analyzed, and a complete three-dimensional model of the rudder cabin is established with 3ds Max. Finally, the three-dimensional model of the cabin is introduced into the virtual reality engine Unity3D, which realizes the interactive operation of the cabin equipment. An extended user interface is designed to complete the generation and release of the final virtual scene program. The research and design of this subject has certain reference significance in applying virtual reality technology to the various different compartments of the whole ship and broadening its application to different ship types.
Introduction
At present, the general marine engine room simulation system needs to establish a lot of real Marine ship equipment simulation subsystems, including centralized console, steering console, ship power station and so on. These are actually installed in the laboratory, which has some advantages of practical demonstration in teaching. However, there are many disadvantages in this way. For example, when it occupies more venues, the investment is very high. In addition, this teaching environment is quite different from the actual marine engine room environment, resulting in a decline in the effectiveness of education and training. If the marine equipment is updated, then the maintenance and upgrading investment is also very high. Referring to the actual cabin environment, a similar three-dimensional ship model is built, and then a virtual ship scene is formed. Users can roam autonomously in the virtual ship scene and produce experience similar to the actual ship working environment. It is also possible to observe the layout of marine engine room, the distribution of pipeline equipment, and the shape and structure of related mechanical and electrical equipment. Through the interactive operation of the equipment in the virtual cabin scene, their operation methods can be grasped and their operation principle can be understood better. On the other hand, this virtual cabin mode can also be applied to more ship types, which has greater advantages compared with the traditional simulation method.
The focus of this research is the design of virtual reality of ship’s snake cabin. The operating equipment and pipeline of the rudder cabin are relatively small compared with other ships, such as the main engine room and the auxiliary ship, and the rudder cabin can truly reflect the characteristics of the ship’s cabin. Therefore, the rudder cabin is selected as the object of the application of virtual reality technology. In this way, it will be able to meet the requirements of the virtual reality design of the general ship engine room and afford the input of research resources due to too large modelling and programming. In addition, for the research work of virtual reality design of different cabin or different ship type cabin, this research can provide some reference and experience and promote the development of marine education and training.
State of the art
There is no strict definition of virtual reality technology. Because of the limitations of software and hardware conditions and the different directions of research and application, the understanding of virtual reality technology is different, and its concept is also changing with the development [1]. In this way, virtual reality can be understood as that, in the sense of vision, hearing and touch, the virtual reality system generates a virtual digital environment that is highly similar to the real environment. Then, the user can interact with the object in the virtual environment and get the necessary feedback from it, and then enable the user have the same experience as that in the corresponding real environment [2]. Virtual reality technology takes computer technology as the core, and combines other related science and technology, which belongs to the advanced and new technology of comprehensive cross-application of various disciplines [3]. The basic characteristics of virtual reality are expounded by some scholars in their study, which are “immersion”, “interaction”, and “imagination”, respectively, and the three mutually influence and cannot be separated [4]. According to the different application of virtual reality system, it can be divided into several kinds [5], such as operation training, design planning and entertainment display. Based on the characteristics of computer technology itself, virtual reality technology can be divided into hardware system and software system. Virtual reality system is generally composed of software system, professional processing computer, input equipment, and output equipment [6]. The United States is the birthplace of virtual reality technology, and it also has the most advanced virtual reality technology. The computer department of the University of North Carolina, United States, focused on the research of architectural simulation, molecular modelling, and other aspects [7]. In the practical application of virtual reality technology, Germany has made many innovations, including renovation, product demonstration and training. In terms of ship simulation, Norway’s research has always been in the leading position in the world. At the same time, the research and development of virtual reality technology in Sweden, Holland and Spain has also made many achievements. In addition, in the research and development of large-scale virtual reality knowledge base, Japan is in the leading position, and it also promotes the related research work of virtual reality game [8].
Method
The traditional teaching marine simulator is combined with computer network technology, which uses many kinds of simulation methods, such as physical, semi-physical, physical and mathematical simulation. The overall structure is shown in Fig. 1.

Overall structure of the full task engine simulator.
The ship cabin of the “Yuanshan lake” is the object of virtual simulation, and the “Yuanshan lake” wheel uses the FE21-485-T050 electric hydraulic rudder system produced by Kawasaki. Three-dimensional engine Unity3D is selected as a tool to realize the virtual reality of ship steering engine room. The operation instructions of Kawasaki FE21-485-T050 steering gear are shown in Table 1.
Operation instructions
In order to simplify the analysis process, it is necessary to make some idealized assumptions when deriving the mathematical model of the hydraulic circuit of the steering gear system. These assumptions include: the pressure loss between the hydraulic oil pump and the hydraulic rainbow and between the valves and pipes is not considered; the leaking state of hydraulic rapeseed and hydraulic red is laminar flow; and the pulsation of the hydraulic pump flow is ignored.
The mathematical model of hydraulic circuit:
The Kawasaki FE21-485-T050 hydraulic rudder uses the L series hydraulic pump produced by Kawasaki as the main oil pump. By consulting its product instructions, the flow equation of the axial piston pump is obtained:
In Formula (1), q max indicates the maximum flow per unit time, n is the rate of rotation for the motor of the oil pump, which is rated as 1150r/min, α suggests the tilt angle, and ηv represents the volume efficiency.
The input torque equation of the hydraulic pump is shown as follows:
In Formula (2), p refers to the effective pressure difference between the inlet and outlet of the oil pump, and ηm is the mechanical efficiency of the oil pump.
The input power equation of the hydraulic pump is shown as follows:
In Formula (3), ηt denotes the overall efficiency.
The hydrodynamic model of the rudder:
The rudder torque is the torque exerted by the rudder mechanism on the rudder. When the rudder is turned at the uniform velocity, the rudder torque is equal to the algebraic sum of the hydrodynamic torque and the total friction torque at each support of the rudder. As a result, the following formula can be obtained:
In Formula (4), Mα=FLR, M is the steering torque of the steering mechanism, Mf is the total friction torque of the rudder, Mα is the hydrodynamic torque of the rudder, FL is the force on the tiller on the plunger, and R is the distance between the center of the rudder and the center line of the cylinder.
The rudder angle refers to the angle of the rotation of the rudder obtained from the distance from the displacement of the plunger and the center of the shifting fork to the center line of the oil rainbow. The following is the equation to be solved.
In the above formula, y is the displacement of the rudder blade after the rotating the angle of α, and the R is the distance from the center of the rudder to the center line of the oil.
3ds Max2013 software is selected as a 3D modelling tool to build a 3D virtual model of rudder cabin. The main modelling methods are basic form modelling, edit modifier modelling, two-dimensional graphics modelling, lofting modelling and polygon modelling. According to the characteristics of different models, these modelling methods are applied to complete the establishment of the complex model of the rudder cabin. The texture mapping, roasting and mapping are used to set up the material and the output of the 3D model. Finally, the virtual three-dimensional model having high similarity with the actual ship steering environment is obtained, which lays a solid foundation for the next three-dimensional model to be introduced into the virtual reality engine. The rendering process of the whole virtual steering ship’s three-dimensional scene is shown in Fig. 2.
3ds Max2013 is used to build a 3D model of rudder cabin. Its basic operation methods are as follows:

3D modelling process for the virtual scene of the rudder cabin.
First, establish the original model. The basic model is built with the basic form modelling, edit modifier modelling, two-dimensional graphics modelling, lofting modelling and polygon modelling. The model has not yet specified the material and the map. It is required to pay attention to minimizing the application of Boolean operations because Boolean operations will increase the number of faces of models. Because of the large number of models, the model is simply classified, and the models with different properties are placed in different layers. When naming a single model, different fields can be used to represent different properties and categories, maintaining a uniform format. In addition, the name of the model, the name of the map, and the name of the material should be consistent so as to avoid repeated naming. This is convenient to manage and reduce the amount of work in the later period.
Second, use material editor to specify material for model. In the material editor, the user can edit and modify the material of the object as needed. Users edit and produce specific materials here and specify the objects to be applied. If users are not satisfied with the material of previous editor, it can be modified by calling the material editor again, the modified material will be displayed immediately in the sample slot, and the material of the object in the scene will change accordingly.
Third, optimize the three-dimensional model. The purpose is to mainly subtract redundant model surface. There are many places that end users cannot see and there are overlaps between models and so on, so they can be deleted. In addition, using 3ds Max’s own model to simplify commands can also automatically reduce the number of faces.
Fourth, use texture baking technology to show the illumination and shadow effects of model objects. Because of the effect of light, the surface of the model changes. The illumination information is pre-rendered into maps, and the baked maps of the model are loaded directly during the real-time rendering, which saves a lot of system resources.
Fifth, export the scene model to FBX format file for importing Unity3D engine. Select Export in the system, pop up the dialog box “Select File to Export”, and choose the save type “FBX”. After specifying the save path, name the “FBX” file “Steering Gear Room”, and finally click “Save” button. After that, pop up the “FBX Export” dialog box, check the “Embed Media” check box, and export the embedded media together. Expand the “Axis Conversion” and select “Y-up” (indicating that the world coordinates in the Unity program are Y axial). After the parameter is set, click the “OK” button in the dialog box to export the “FBX” resource.
Unity3D engine
The scene object is a key concept in Unity 3D. A virtual reality scene is composed of multiple scene objects. Each scene object can be split into multiple components, and the component itself contains a number of variables. The developer can also add and adjust the variables to control the behaviour of the scene object. As shown in Fig. 3, it shows the concept of scene objects in Unity 3D.

Scene objet.
Collision detection is also needed in the virtual reality scene. In the virtual scene, collision detection makes us know whether there is interaction between two objects, so it is particularly important. In engine Unity 3D, by adding a collider component to an object, it actually uses an invisible net to wrap the object, and the physical engine can judge whether the object is colliding with other objects by using the information collected by the net. There are mainly two kinds of colliders in Unity 3D: prototype collider and grid collider. Fig. 4 is a specific introduction to the two kinds of colliders.

Collider category.
The task is to realize the function of operator to move freely in the scene of virtual rudder ship, and to observe the environment of the vessel freely, so that it can get a strong sense of experience. For this reason, the principle of collision detection and first person controller needs to be studied. Firstly, the FBX file of the steering gear room needs to be imported into the virtual reality engine. The specific import operation method is to open Unity 3D, select New project under the File menu, build a new project named “VLCC-steering gear room”, and put the FBX file of the three-dimensional model of the rudder cabin into the Assets subfolder of the VLCC-steering gear room project folder. Unity automatically imports the 3D model to the Assets folder in the Project panel, and drag the 3D model into the scene view. In this way, the FBX file of the rudder cabin is imported into Unity 3D.
In the first person perspective roaming, the whole view is like the operator’s eyes, and everything in the scene seems to be seen from his own eyes. The first person main view is used to roam in the virtual steering engine room, which can effectively increase the user’s final operating experience. It helps developers to implement these relatively complex logical operations, such as “up”, “left” “right”, “jump” and so on, and encapsulate them into role controller components. If the Character Controller (role controller) resource package is not imported before the new project, it is necessary to import Character Controller from the Import Package option in the Assets menu. In the Hierarchy Panel, expand the Standrd Assets folder and drag and drop the First Person Controller (FPC) prefabricated resources into the Scene View.
The objective is to achieve the user roaming in the steering gear cabin, and can operate the steering gear equipment, so that the steering gear operation, as well as the relevant instrumentation indicate the working state. The basic idea of its realization is as follows:
First, the first person controller is used to pick up the operation buttons in the virtual scene. This is done by the OnMouseOver method. The script is written and the mouse-lift-event is used to determine the corresponding button. The button action script is written on the button, making the selected button take action and the corresponding indicator light is lit, which is enabled by the point light source at the indicator light position. According to the actual situation of the steering gear room, the general button has two states, and a few have three states. The int class variable is used to store different button states. Here is the code to pick up buttons by using OnMouseOver.
Void OnMouseOver () {
If (Input.GetMouseButtonUp(0)) {
this. Transform. Translate (0, 0, -0.01, Space. Self);
OperationLight1. light. Range = 0.1f;
. . . . . .
}
}
Then, the operation logic of the navigation mechanism is realized. It is to realize the steering gear rotation, and display the parameters, data and so on in the scene through the relevant instruments. This involves the mathematical model of steering gear in 3.1, which is realized by programing the script in the procedure. The mathematical model of the rudder system involves solving the problem of differential equations. In order to balance the speed of operation and the accuracy of the result, the classical fixed step length Runge – Kutta method is used to solve the mathematical model. There is a panel in the steering gear cabin of the “Yuanshan Lake”, showing the principle of the hydraulic system of the steering gear system. There is also a panel in the same position of the virtual rudder cabin. When the rudder is moving, the function of the hydraulic oil path principle of the rudder system is realized by changing the map on the panel model.
Finally, the relationship between button operation and actuator action is realized. By judging the combination of different button states, the action of the rudder mechanism is decided.
The script programming of GUI class in Unity is adopted, and the interactive interface of virtual program is designed with GUI skin resources. The concrete methods are as follows:
First, select the Steering Gear room scene in the engineering panel, copy the scene, name the new scene as “Menu”, and delete the unrelated objects, such as First Person Controller, small map Camera in the Menu scene, and then add a new camera to adjust its position, so that its angle of view is perpendicular to the steering gear.
Second, select the Greate Empty option in the GameObject menu to create an empty object, so that a GameObject object with only Transform components is obtained in the hierarchy panel, and then add the GUI script menu to the empty object, and the C# script is used here. Because the placement of the GUI element is independent of the location of the empty object, there is no need to adjust the position of the empty object.
Third, name the newly created C# script file Menu and use Monodevelop to script it.
Fourth, the script mainly uses the OnGUI () function. Write the corresponding response code for different buttons, call the custom ButtonAction () function, and the user should play the sound effect when the button is pressed, so it needs to add the Audio Source component to the Gameobject object.
Generation and release of programs
In Unity, when exported, the relevant files will be put into the Unity player. This is posted to the PC single version, selecting PC, Mac and Linux Standalone, and setting relevant parameters in PlayerSetting, including icons, resolution, and boot screen, to complete the program generation and release.
The layout drawings of the “Yuanshan lake” on the steering engine room and the instructions related to the equipment of the rudder are collected and collocated. Referring to the relevant documents of applying the virtual reality technology to the simulation of the ship cabin, the Unity3D virtual reality engine is used to carry out the virtual reality design of the whole rudder cabin. The difference between the different platforms, including the size of the screen, the mode of operation, and the hardware conditions, will directly affect the progress of the developer. The migration development between the platforms will take more time for the developer, and the Unity3D is a good solution to this problem. The mathematical model of the steering gear can effectively reflect the overall steering gear operation of the “Yuanshan lake” cabin. On this basis, the model of the virtual rudder cabin built is closer to the actual training teaching, so that the college can clearly feel the equipment operation and the situational experience in the rudder cabin. Finally, the virtual reality engine Unity3D is introduced to realize the first person roaming of the virtual rudder cabin. As a result, the interactive operation of the cabin equipment is realized, an extended user interface is designed, and the generation and release of the final virtual scene program is completed, which has practical help to the whole college experience training with the instructor teaching.
Conclusion
Virtual reality technology is applied to a complete ship cabin, and the virtual reality system based on the rudder cabin is designed with the virtual simulation object of the “Yuanshan lake” ship rudder cabin. The system has friendly user interaction interface, and its virtual scene layout is as close as possible to the actual steering engine room. Through the autonomous roaming in the virtual rudder cabin scene, the trainees can walk in and get the experience similar to that in the actual working environment in the ship. Moreover, the trainees can repeatedly operate the steering gear in the virtual scene, observe the operating condition of the steering engine, and then improve the effect of the marine engine education and training.
