Interactive device control method, device, equipment and readable storage medium for simulation scene
By adjusting the viewing angle and orthophoto projection technology, multiple state switching is realized at one time in a three-dimensional simulation scenario, solving the problems of cumbersome operation and low simulation in the existing technology, and improving the simulation and user experience of interactive devices.
Patent Information
- Application Number
- CN202111497840.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The prior art is difficult to effectively map the operation of physical devices to interactive devices in three-dimensional simulation scenarios, especially when the interactive devices have multiple states, the user needs to operate multiple times to adjust to the target state, and the existing operators have reduced Simulation and user experience.
By obtaining the position and viewing angle of the target operation control on the first interface, adjusting the viewing angle to the user's viewing angle, displaying the second interface and moving the operation control to the target position, determining the state using orthophotographing, realizing multi-state switching at one operation, and improving the simulation degree and response speed.
It enables users to switch multiple states with just one operation, improves the simulation and response speed of interactive devices, avoids the use of virtual operators, and improves the user experience.
Smart Images

Figure CN114237431B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent terminals, and more specifically, to a method, apparatus, device and readable storage medium for controlling interactive devices in a simulation scenario. Background Art
[0002] With the rapid development of the field of 3D simulation, industries for the purpose of teaching, demonstration, etc. will use simulation systems instead of real equipment to reduce the operation and maintenance costs of the equipment and increase the amount of displayed information.
[0003] Interactive devices with multiple states in a 3D simulation scene, such as light rotary buttons and air switches, require users to select and control them through physical devices such as touch panels, mice, and keyboards. However, the data input by these physical devices only includes symbols, touches, and swipes, while the interactive devices in the simulation scene include multiple states. For example, each scale of the light rotary button represents a different light intensity, and the two do not have a one-to-one correspondence. Therefore, how to map the user's operation on the physical device to the interactive device in the simulation scene is an urgent problem to be solved.
[0004] In view of the above problems, the prior art provides two solutions. One solution is to select and change the state of the components through the touch operation input by the mouse or touch panel. Each time the user touches the target interactive device, the target interactive device will change its state. This method can only change one state per click. When the target interactive device has many states, it takes a long time to adjust to the target state. Another solution is to add an operator to the operable interactive device. After the user touches and selects the target interactive device, the user can adjust the target interactive device to the target state by swiping in the form of a semi-transparent wheel surrounding the target interactive device. However, the operator displayed in this way reduces the simulation of the interactive device and reduces the user experience. Summary of the invention
[0005] The purpose of the present application includes providing a method, apparatus, device and readable storage medium for controlling an interactive device in a simulation scene, which can achieve the purpose of changing multiple states of the interactive device at one time by allowing the user to directly operate the interactive device with multiple states in a three-dimensional simulation scene without the aid of other software operators.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for controlling an interactive device in a simulation scenario, the method comprising:
[0008] In response to a user clicking operation on a target operation control in a target interactive device on a first interface, obtaining a position of a first viewing plane and a first operation plane of the target operation control in the target interactive device on the first interface, wherein the first viewing plane is a plane where a bottom surface of the target operation control is located, and the first operation plane is a plane where a control portion of the target operation control is located;
[0009] Adjusting the viewing angle of the first operation plane to the viewing angle of the user to obtain a second operation plane of the target operation control on the second interface, and obtaining a second viewing angle plane of the target operation control on the second interface according to the viewing angle of the second operation plane;
[0010] Displaying a second interface, and displaying the target operation control on the second interface from the perspective of the second operation plane and the perspective of the second viewing plane;
[0011] In response to a triggering operation of the target operation control by a user on the second interface, moving a control portion of the target operation control to a first target position on the second interface;
[0012] According to the first target position of the control part of the target operation control on the second interface, the second target position of the control part of the target operation control on the first interface is determined, and the control part of the target operation control in the first interface is moved to the second target position.
[0013] In an optional implementation, determining the second target position of the control part of the target operation control on the first interface according to the first target position of the control part of the target operation control on the second interface includes:
[0014] The target operation control located at the first target position is orthographically projected toward the second viewing plane, and the second target position of the control part of the target operation control at the first interface is obtained according to the result of the orthographic projection.
[0015] In an optional implementation, performing an orthographic projection on the target operation control located at the first target position toward the second viewing plane, and obtaining the second target position of the control part of the target operation control at the first interface according to the result of the orthographic projection, includes:
[0016] Dividing the second viewing angle plane into a plurality of mapping areas, each mapping area corresponding to a plurality of states of the target device;
[0017] Determining a target mapping area on the second interface according to the orthographic projection result;
[0018] Determining the state of the target operation control according to the target mapping area;
[0019] The second target position of the control part of the target operation control on the first interface is obtained according to the state of the target operation control.
[0020] In an optional implementation, in response to the user's triggering operation on the target operation control on the second interface, moving the control portion of the target operation control to the first target position on the second interface includes:
[0021] In response to a triggering operation of the target operation control by the user on the second interface, obtaining an actual position after the operation;
[0022] If the actual position is within the operation area corresponding to the target operation control on the second interface, the actual position is used as the first target position, and the control part of the target operation control is moved to the first target position on the second interface.
[0023] In an optional implementation manner, after obtaining the actual position after the operation, the method further includes:
[0024] If the actual position is outside the operation area corresponding to the target operation control on the second interface, the first target position is selected from the second interface, and the control part of the target operation control is moved to the first target position on the second interface.
[0025] In an optional implementation, the step of responding to a user's click operation on a target operation control in a target interactive device on a first interface and acquiring a position of a first viewing plane and a first operation plane of a target operation control in the target interactive device on the first interface includes:
[0026] In response to the operation of the virtual object controlled by the user moving to the target interactive device, the target interactive device is displayed on the first interface, and the target operation control is displayed from the perspective of the first operation plane and the perspective of the first viewing plane.
[0027] In an optional implementation, displaying the second interface includes:
[0028] In response to the user's operation of adjusting the viewing angle of the second operation plane, a new second operation plane is obtained.
[0029] In a second aspect, an embodiment of the present application provides an interactive device control device for a simulation scene, the device comprising:
[0030] a response module, configured to respond to a user's click operation on a target operation control in a target interactive device on a first interface, and obtain a position of a first viewing plane and a first operation plane of the target operation control in the target interactive device on the first interface, wherein the first viewing plane is a plane where a bottom surface of the target operation control is located, and the first operation plane is a plane where a control portion of the target operation control is located;
[0031] a processing module, configured to adjust the viewing angle of the first operation plane to the viewing angle of the user, obtain a second operation plane of the target operation control on the second interface, and obtain a second viewing angle plane of the target operation control on the second interface according to the viewing angle of the second operation plane;
[0032] The processing module is further used to display a second interface, and display the target operation control on the second interface from the perspective of the second operation plane and the perspective of the second viewing plane;
[0033] The response module is further configured to, in response to a trigger operation of the target operation control by a user on the second interface, move the control portion of the target operation control to a first target position on the second interface;
[0034] The processing module is also used to determine the second target position of the control part of the target operation control on the first interface according to the first target position of the control part of the target operation control on the second interface, and move the control part of the target operation control in the first interface to the second target position.
[0035] In an optional embodiment, the processing module is also used to perform an orthographic projection of the target operation control located at the first target position toward the second viewing plane, and obtain the control part of the target operation control at the second target position of the first interface based on the result of the orthographic projection.
[0036] In an optional implementation, the processing module is further used to divide the second viewing angle plane into a plurality of mapping areas, each mapping area corresponding to a plurality of states of the target device;
[0037] Determining a target mapping area on the second interface according to the orthographic projection result;
[0038] Determining the state of the target operation control according to the target mapping area;
[0039] The second target position of the control part of the target operation control on the first interface is obtained according to the state of the target operation control.
[0040] In an optional implementation, the response module is further used to respond to the user's triggering operation on the target operation control on the second interface, and obtain the actual position after the operation;
[0041] If the actual position is within the operation area corresponding to the target operation control on the second interface, the actual position is used as the first target position, and the control part of the target operation control is moved to the first target position on the second interface.
[0042] In an optional implementation manner, the response module is further configured to, after acquiring the actual position after the operation, further include:
[0043] If the actual position is outside the operation area corresponding to the target operation control on the second interface, the first target position is selected from the second interface, and the control part of the target operation control is moved to the first target position on the second interface.
[0044] In an optional embodiment, the response module is also used to respond to the operation of the virtual object controlled by the user moving to the target interaction device, display the target interaction device on the first interface, and display the target operation control from the perspective of the first operation plane and the perspective of the first viewing plane.
[0045] In an optional implementation, the response module is further configured to obtain a new second operation plane in response to an operation of the user adjusting the viewing angle of the second operation plane.
[0046] In a third aspect, an embodiment of the present application provides a computer device, characterized in that the computer device includes: a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the steps of the interactive device control method for the simulation scenario as described in any one of the aforementioned embodiments.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the interactive device control method for a simulation scenario as described in any one of the aforementioned embodiments are implemented.
[0048] The beneficial effects of the embodiments of the present application include:
[0049] The interactive device control method, apparatus, device and readable storage medium of the simulation scene provided by the present application can, firstly, respond to the user's trigger operation on the target operation control, directly move the control part of the target operation control to the first target position in the simulation scene, and obtain the state corresponding to the first target position, so that the user can achieve the goal of switching the states of multiple target operation controls with only one trigger operation. Secondly, the present application divides the target operation control into a second operation plane and a second viewing plane, and can directly determine the first target position of the control part adjusted by the user based on the operation performed by the user on the control part of the target operation control in the second operation plane, so as to achieve the purpose of changing the state of the interactive device by directly reading the user's operation without the help of a virtual operator, thereby improving the simulation degree of the interactive device.
[0050] In addition, the present application calculates the orthographic projection result of the target operation control on the second viewing plane in the second interface, and converts the state of the target operation control, so that the user can adjust the target operation control to the target position with one operation, which is more accurate and faster in response. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A schematic diagram of an operator of an interactive device in the prior art;
[0053] Figure 2 A schematic diagram of a second operation plane and a second viewing plane of a rotary button of the interactive device control method for a simulation scene provided in an embodiment of the present application;
[0054] Figure 3 Another schematic diagram of the second operation plane and the second viewing angle plane of the rotation button of the interactive device control method for the simulation scene provided by an embodiment of the present application;
[0055] Figure 4 A schematic diagram of a second operating plane and a second viewing plane of an air switch of an interactive device control method for a simulation scenario provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the steps of the interactive device control method for the simulation scenario provided in an embodiment of the present application;
[0057] Figure 6A schematic diagram of another step flow of the interactive device control method for the simulation scenario provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of another step flow of the interactive device control method for the simulation scenario provided in an embodiment of the present application;
[0059] Figure 8 A schematic diagram of the structure of an interactive device control device for a simulation scenario provided in an embodiment of the present application;
[0060] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.
[0061] Icons: 101 - operator; 102 - joystick; 103 - interactive device; 201 - operating control; 202 - operating plane; 203 - viewing plane; 10 - interactive device control device for simulation scene; 1001 - response module; 1002 - processing module; 2001 - processor; 2002 - memory. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0063] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0064] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0065] In the description of the present application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, it is based on the orientation or position relationship shown in the drawings, or is the orientation or position relationship in which the product of the invention is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0066] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0067] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0068] A three-dimensional simulation scene used for teaching and demonstration purposes may include interactive devices with multiple states. For example, a simulation scene that demonstrates the operating principle of an electrical cabinet includes a light rotary button, an electrical air switch, etc., wherein multiple scale values are evenly set around the light rotary button, representing different light intensity states. An indicator mark is set on the rotary button. When the user rotates the rotary button and aligns the indicator mark with one of the scale values, the rotary button adjusts the light so that the current light intensity changes to the light intensity state represented by the scale value adjusted by the user.
[0069] In the 3D simulation scene, such interactive devices with multiple states require users to select and control them through physical devices such as touch panels, mice, and keyboards. However, the data input by these physical devices only includes symbols, touches, and swipes, and cannot directly establish a one-to-one correspondence with the multiple states of the interactive devices. Therefore, how to map the user's operation on the physical device to the interactive device in the simulation scene is an urgent problem to be solved.
[0070] In this regard, the prior art provides two solutions. One is to change the state of the interactive device by the user clicking on the interactive device. However, this method can only change one state per click. When there are many states of the target interactive device, it takes a long time to adjust to the target state. Figure 1 As shown, another solution is to display the operator 101 around the interactive device 103, and the user drags the operating ball on the operating rod 102 added to the interactive device 103, and the target state of the interactive device 103 is converted according to the position of the operating ball on the operating rod 102. However, the operator 101 displayed in this way reduces the simulation degree of the interactive device and reduces the user experience.
[0071] Based on the above problems, the applicant has proposed a method, device, equipment and readable storage medium for controlling interactive devices in simulation scenes, which can respond to the user's trigger operation on the target operation control, directly move the control part of the target operation control to the first target position in the simulation scene, and achieve the goal of the user switching the states of multiple target operation controls with only one trigger operation. It can also directly determine the first target position of the control part adjusted by the user based on the operation made by the user on the control part of the target operation control in the second operation plane, achieving the purpose of changing the state of the interactive device by directly reading the user's operation without the help of a virtual operator, and improving the simulation degree of the interactive device.
[0072] The embodiments of the present application can be applied to a three-dimensional simulation scene displayed on an electronic device, wherein the three-dimensional simulation scene includes at least one interactive device with multiple states, and a user can control the operation controls of the interactive device through a mouse or a touchpad. When the user operates, the user's operation can be mapped to the operation control based on the method of the present embodiment, and the control part of the operation control can be moved to the target position selected by the user.
[0073] In the embodiment of the present application, for the operation control 201 in the three-dimensional simulation scene, two planes are defined: the operation plane 202 and the viewing plane 203. The operation plane 202 is the plane where the control part of the operation control 201 is located, and the viewing plane 203 is the plane where the bottom surface of the operation control 201 is located. For example, taking the rotation button as an example, Figure 2 The figure shows a top view of the operating control 201 of the rotary button. Figure 3 The figure shows a side view of a rotary button. Since the rotary button rotates clockwise in a plane parallel to the bottom surface, the operation plane 202 is parallel to the viewing plane 203. The viewing plane 203 is located in the plane where the bottom surface of the rotary button is located, and the operation plane 202 is located in the plane where the control part of the rotary button is located. For a rotary button, the control part may refer to a rotatable knob connected to the bottom surface. Figure 4 As shown, the operation control 201 of the air switch can also be used as an example for explanation. Since the air switch moves up and down in a plane perpendicular to the bottom surface of the air switch, the operation plane 202 of the air switch is perpendicular to the viewing plane 203. The operation plane 202 is the plane on which the air switch moves up and down, and the viewing plane 203 is the plane on which the bottom surface of the air switch is located. For the air switch, the control part can refer to the part connected to the bottom surface that can be turned.
[0074] Figure 5 The flowchart of the interactive device control method for the simulation scene provided in the embodiment of the present application is a step flow chart. The execution subject of the method can be an electronic device with computing and processing capabilities, such as a cloud server. Figure 5 As shown, the method includes:
[0075] Step S301, in response to a user clicking operation on a target operation control in a target interactive device on a first interface, obtain the position of a first viewing plane and a first operation plane of the target operation control in the target interactive device on the first interface, wherein the first viewing plane is the plane where the bottom surface of the target operation control is located, and the first operation plane is the plane where the control part of the target operation control is located.
[0076] The first interface may be an interface for displaying a three-dimensional model in a three-dimensional simulation scene, which is displayed on a screen of a terminal device. For example, the three-dimensional model may be an operation panel for displaying all interactive devices operable by a user. The first interface may be displayed from a perspective facing the user, so that the user can browse and select a target interactive device.
[0077] Optionally, the target interactive device may be an electrical cabinet including a rotary button, an air switch, etc., and the target operation control is an operation control on the three-dimensional model of the target interactive device that can be operated by the user, and may include various types, such as a rotary button, an air switch, etc., which is not limited in this application.
[0078] The user's click operation on the target operation control in the target interactive device on the first interface can be performed through a mouse or through a touch panel of the terminal device, but of course, it is not limited to this.
[0079] After the user selects an operation control of one of the multiple interactive devices in the first interface, the electronic device calculates the position of the first viewing plane and the first operation plane of the operation control on the first interface. For example, the position of the second viewing plane can be represented by the coordinates of the four vertices of a rectangular box surrounding the bottom surface of the target operation control on the plane where the bottom surface of the target operation control is located. Similarly, the position of the first viewing plane can be represented by the coordinates of the four vertices of a rectangular box within the plane where the operation part of the target operation part is located.
[0080] Step S302: adjust the viewing angle of the first operation plane to the user's viewing angle, obtain a second operation plane of the target operation control on the second interface, and obtain a second viewing angle plane of the target operation control on the second interface according to the viewing angle of the second operation plane.
[0081] It should be noted that the user's perspective can be interpreted as the perspective from which the user can observe all the selectable states included in the first operation plane on the screen of the terminal device. For example, the user's perspective of a rotary button can be the perspective of looking down at the rotary button, and the user's perspective of an air switch can be the perspective of looking sideways at the air switch. It is understandable that the user's perspective can also be other perspectives that can smoothly observe various states of the target operation control.
[0082] The second interface may be an interface that pops up after the user clicks the operation, and the interface displays a separate, enlarged target operation control that is displayed from the perspective of the second operation plane and the second viewing plane after the electronic device adjusts the second operation plane and the second viewing plane. Optionally, other interactive devices of the first interface may be displayed in a blurred background, or the surrounding interface of the target operation control on the first interface may be used as the background, which is not limited in this application.
[0083] The process of adjusting the first operation plane to the user's perspective and obtaining the second operation plane can be obtained in a prefabricated manner, that is, the display perspective of the second operation plane in the second interface can be pre-stored in the electronic device, and the display perspective can be stored in the electronic device with the same vertex coordinates of the rectangular frame as in the above embodiment. Accordingly, according to the position coordinate correlation relationship between the first operation plane and the second operation plane in the first interface, the position coordinate correlation relationship between the second viewing plane and the second operation plane in the second interface can be calculated. Therefore, the position of the second viewing plane can be determined according to the pre-stored display perspective of the second operation plane, thereby determining the second viewing plane of the target operation control in the second interface.
[0084] Step S303: displaying a second interface, and displaying a target operation control on the second interface in a viewing angle of a second operation plane and a viewing angle of a second viewing plane.
[0085] In response to the user's click operation, the electronic device calculates the second operation plane of the second interface, and after determining the viewing angle plane of the second operation plane accordingly, displays the second interface on the screen of the terminal device for the user to operate the target operation control.
[0086] Step S304, in response to the user's triggering operation on the target operation control on the second interface, the control portion of the target operation control is moved to the first target position on the second interface.
[0087] Optionally, the user's triggering operation may be an operation inputted through an input device of the terminal device, such as inputting a dragging, sliding, or other operation, but of course, it is not limited thereto.
[0088] The user triggers the target operation control displayed on the second interface of the terminal device, drags the control part of the target operation control on the second interface to the position selected by the user, and uses the position as the first target position.
[0089] It should be noted that when the user drags the control portion of the target operation control to the first target position, a text description can be set next to the control portion to enable the user to clearly understand the state of the target operation control corresponding to the current position of the control portion.
[0090] Step S305, determining a second target position of the control part of the target operation control on the first interface according to the first target position of the control part of the target operation control on the second interface, and moving the control part of the target operation control in the first interface to the second target position.
[0091] After the user completes the adjustment, the pop-up second interface can be closed. The electronic device determines the state of the target operation control corresponding to the first target position according to the first target position after the user drags the control part of the target operation control on the second interface, thereby determining the second target position corresponding to the first target position in the first interface. The display of the terminal device displays the new first interface, and the user's operation effect is presented on the target operation control in the new first interface. For example, if the user rotates the selection button to 90 degrees in the second interface, after closing the second interface, the corresponding rotation button in the new first interface is displayed as rotated to 90 degrees.
[0092] In this embodiment, the user can directly move the control part of the target operation control to the first target position in the second interface, so that the user can achieve the goal of switching the states of multiple target operation controls with only one trigger operation. In addition, the operation made by the user on the control part of the target operation control in the second operation plane can directly determine the first target position of the control part adjusted by the user, so that the purpose of changing the state of the interactive device by directly reading the user's operation without the help of a virtual operator is achieved, thereby improving the simulation degree of the interactive device.
[0093] Optionally, in the above step S305, determining the second target position of the control part of the target operation control on the first interface according to the first target position of the control part of the target operation control on the second interface includes:
[0094] The target operation control located at the first target position is orthographically projected toward the second viewing plane, and according to the result of the orthographic projection, the control part of the target operation control is obtained at the second target position of the first interface.
[0095] Orthographic projection is a projection in a forward direction, and the target operation control located at the first target position is orthographically projected toward the second viewing plane. It can be understood that the projection plane is parallel to the second viewing plane, tangent to the farthest end of the operating part of the target operation control away from the bottom surface, and the projection light is perpendicular to the projection plane. For example, when the air switch is turned downward and the control part is at an angle of 60 degrees to the upward plane, its orthographic projection on the second viewing plane is a rectangle with a length of half the control part of the original air switch. Optionally, the projection result can be represented by coordinates in a three-dimensional space coordinate system. For example, the projection result of the air switch can be represented by the coordinates of the top of the projection of the control part on the second viewing plane, and the rotation button can be represented by the projection coordinates of the indicator mark on the second viewing plane.
[0096] According to the orthographic projection result of the target operation control on the second viewing plane, that is, the orthographic projection coordinates of the target operation control at the first target position on the second viewing plane, it is possible to calculate the corresponding state of the target operation control corresponding to the orthographic projection result when it is located at the first target position, and thus the state of the target operation control at the first interface can be further determined, and thus the control part of the target operation control at the second target position of the first interface is correspondingly determined.
[0097] In this embodiment, the first target position of the target operation control in the spatial coordinate system is converted into a plane coordinate system calculation problem in the second viewing plane by orthographically projecting the target operation control toward the second viewing plane, thereby simplifying the calculation process.
[0098] Alternatively, if Figure 6 As shown, in the above embodiment, the target operation control located at the first target position is orthographically projected toward the second viewing plane, and according to the result of the orthographic projection, the control part of the target operation control is obtained at the second target position of the first interface, which can be achieved by steps S401 to S404.
[0099] Step S401: divide the second viewing angle plane into a plurality of mapping areas, each mapping area corresponding to a plurality of states of the target device.
[0100] Optionally, when the second viewing plane is orthographically projected onto the second viewing plane according to the target operation control, the orthographic projection position of different states is taken as the center and the preset distance is taken as the extension range to divide it into different mapping areas. For example, if the rotation button contains 4 states, which are respectively located at 90 degrees, 180 degrees, and 270 degrees of the rotation button, then the range of 45 degrees to 135 degrees of the rotation button can be set as the state corresponding to 90 degrees of the rotation button.
[0101] Step S402: determining a target mapping area on the second interface according to the orthographic projection result.
[0102] It can be seen from the mapping area division method in the above embodiment that when the orthographic projection coordinates corresponding to the orthographic projection of the control part of the target operation control are within the range of a certain mapping area, the mapping area can be used as the target mapping area of the target operation control on the second interface.
[0103] Step S403: determining the state of the target operation control according to the target mapping area.
[0104] It is understandable that a one-to-one correspondence between the target mapping area and the state of the target operation control is pre-stored in the electronic device, so when the target mapping area is determined, the state of the corresponding target operation control can also be determined accordingly.
[0105] Step S404: obtaining a second target position of the control portion of the target operation control on the first interface according to the state of the target operation control.
[0106] After determining the state of the target operation control, the electronic device records this state. When the second interface is closed and the first interface is redisplayed, the electronic device will calculate and display the state of the target operation control at the second target position of the first interface, that is, the position of the target operation control in the first interface when it is in the current state. In this way, the adjusted state of the target operation control will be displayed in the first interface.
[0107] In this embodiment, the second viewing plane is divided into multiple mapping areas, and the state of the target operation control is determined according to the mapping area in which the orthophoto result of the target operation control is located. This calculation method converts the user's operation in three-dimensional space into calculation in a two-dimensional plane, which is more accurate and intuitive. At the same time, the method of dividing the mapping area can also improve the compatibility with user operations.
[0108] Alternatively, if Figure 7 As shown, in the above step S304, in response to the user's triggering operation on the target operation control on the second interface, the control part of the target operation control is moved to the first target position on the second interface, which can be implemented by the following steps S501 to S502.
[0109] Step S501, responding to the user's triggering operation on the target operation control on the second interface, obtaining the actual position after the operation.
[0110] Optionally, the actual position after the operation may be the final position reached by the user dragging the control portion of the target operation control. The user inputs a trigger operation of the target operation control on the second interface through the input device of the terminal device, such as sliding, dragging, etc., and the final position is based on the position of the cursor of the input device at the last moment of a continuous trigger operation of the user.
[0111] Step S502: If the actual position is within the operation area corresponding to the target operation control on the second interface, the actual position is used as the first target position, and the control part of the target operation control is moved to the first target position on the second interface.
[0112] Optionally, a movable area of the control unit of the target operation control in the second interface can be pre-set as the above-mentioned operation area. The operation area can be represented by the vertex coordinates of the operation area on the display screen, and the vertex coordinates can be determined specifically according to the area through which the control unit may pass when the target operation control is actually used. For example, the operation area of the control unit of the air switch can move up and down within the range of 0 to 180 degrees, and the operation area corresponding to the air switch can be determined based on this feature. The operation area of the control unit of the rotary button can move clockwise within the range of 0 to 360 degrees around the rotary button and cannot move left and right. The operation area corresponding to the rotary button can be determined based on this feature.
[0113] If, after the user triggers the operation, the electronic device determines that the actual position of the control part of the target operation control is within the operation area defined in the above manner, then the state of the target operation control corresponding to the actual position is determined according to the orthographic projection method in the above embodiment, and the corresponding function is called according to the state to generate an image of the state, thereby achieving the effect of moving the control part of the target operation control to the actual position, wherein the actual position can be referred to as the first target position.
[0114] Optionally, in the above step S501, after obtaining the actual position after the operation, it also includes: if the actual position is outside the operation area corresponding to the target operation control on the second interface, selecting the first target position from the second interface, and moving the control part of the target operation control to the first target position on the second interface.
[0115] If, after the user triggers the operation, the electronic device determines that the actual position of the control unit of the target operation control is outside the operation area defined in the above manner, the control unit of the target operation control cannot be moved to the corresponding area. For example, the user moves the control unit of the air switch to a position of 200 degrees, which is beyond the range of the air switch.
[0116] At this time, it is necessary to calculate the position closest to the actual position in the operation area of the second interface, use this position as the first target position, and move the control part of the target operation control to this position. Taking the operation in which the user moves the control part of the air switch to the position of 200 degrees as an example, the electronic device calculates that the position closest to the position of 200 degrees is the position of 180 degrees, and moves the control part of the target operation control to the position of 180 degrees for display.
[0117] In this embodiment, an operation area is defined, and the user's operations on the target operation control in the operation area are directly displayed. Operations outside the operation area are mapped to the operation area, so that the user cannot change the original component properties of the target operation control through illegal operations, thereby improving the system's fault tolerance.
[0118] Optionally, in the above step 304, in response to a user clicking operation on a target operation control in a target interactive device on the first interface, obtaining a position of a first viewing plane and a first operation plane of a target operation control in the target interactive device on the first interface includes:
[0119] In response to the operation of the virtual object controlled by the user moving to the target interactive device, the target interactive device is displayed on the first interface, and the target operation control is displayed from the perspective of the first operation plane and the perspective of the first viewing plane.
[0120] It should be noted that the interactive device control method for a simulation scene provided in an embodiment of the present application is applied to a three-dimensional simulation scene. The simulation scene may include a virtual object, which may be a three-dimensional simulation model of a human being. A user can control the movement of the virtual object in the simulation scene through an input device of a terminal device, and the current coordinates of the virtual object are recorded by the electronic device.
[0121] Optionally, a target interactive device, such as the area directly in front of an electrical cabinet, can be defined as a trigger area. When the electronic device detects that the coordinates of the virtual object controlled by the user enter the trigger area, the first interface of the target interactive device, such as the operating table of the electrical cabinet, will be displayed. It is understandable that in order to enable the user to browse all the operating controls, the first interface can be displayed in a manner such that the first viewing plane is facing the virtual object controlled by the user. Since the correspondence between the first operating plane and the first viewing plane is different in different operating controls, once the target operating control and the first viewing plane are determined, the display viewing angle of the corresponding first operating plane can be determined.
[0122] In this embodiment, the first interface can be self-triggered according to the movement of the user's virtual object, which makes the interaction with the customer more friendly, improves the intelligence of the system, and makes the interface switching of the system smoother.
[0123] Optionally, in the above step S303, displaying the second interface includes: responding to the user's operation of adjusting the viewing angle of the second operation plane to obtain a new second operation plane.
[0124] After the second interface from the user's perspective is displayed on the terminal device, if the user believes that the state to be operated cannot be more comprehensively observed under the perspective of the displayed operation plane, the user can adjust the display perspective of the second operation plane of the target operation control through the input device, and the second perspective plane also moves accordingly, so that a new second operation plane and a second perspective plane are obtained.
[0125] Among them, the user can control the movement of the second operation plane of the target operation control by dragging, sliding and other operations of the input device. The electronic device calculates the corresponding rotation angle of the second operation plane of the target operation control by detecting the length of the user's operation on the screen of the terminal device. It can be understood that the direction of the user's operation can be the direction of rotation of the second operation plane, of course, it is not limited to this.
[0126] In this embodiment, the user can freely adjust the display angle of the target operation control in the second interface, and can operate the target operation after the angle is adjusted, so that the system has higher flexibility and interactivity, and improves the user experience.
[0127] Optionally, the embodiment of the present application further provides an interactive device control device 10 for simulating a scene, such as Figure 8 As shown, the device comprises:
[0128] The response module 1001 is used to respond to the user's click operation on the target operation control in the target interactive device on the first interface, and obtain the position of the first viewing plane and the first operation plane of the target operation control in the target interactive device on the first interface, where the first viewing plane is the plane where the bottom surface of the target operation control is located, and the first operation plane is the plane where the control part of the target operation control is located.
[0129] The processing module 1002 is used to adjust the viewing angle of the first operation plane to the user's viewing angle, obtain the second operation plane of the target operation control on the second interface, and obtain the second viewing angle plane of the target operation control on the second interface according to the viewing angle of the second operation plane.
[0130] The processing module 1002 is further configured to display a second interface, and display a target operation control on the second interface in a perspective of a second operation plane and a perspective of a second viewing plane.
[0131] The response module 1001 is further configured to respond to a trigger operation of the target operation control by the user on the second interface, and move the control portion of the target operation control to the first target position on the second interface.
[0132] The processing module 1002 is also used to determine the second target position of the control part of the target operation control on the first interface according to the first target position of the control part of the target operation control on the second interface, and move the control part of the target operation control in the first interface to the second target position.
[0133] Optionally, the processing module 1002 is further used to perform an orthographic projection on the target operation control located at the first target position toward the second viewing plane, and obtain a control unit of the target operation control at a second target position of the first interface according to a result of the orthographic projection.
[0134] Optionally, the processing module 1002 is further used to divide the second viewing angle plane into a plurality of mapping areas, each mapping area corresponding to a plurality of states of the target device. According to the orthographic projection result, a target mapping area on the second interface is determined. According to the target mapping area, a state of a target operation control is determined. According to the state of the target operation control, a second target position of a control unit of the target operation control on the first interface is obtained.
[0135] Optionally, the response module 1001 is further used to respond to the user's triggering operation on the target operation control on the second interface, and obtain the actual position after the operation. If the actual position is within the operation area corresponding to the target operation control on the second interface, the actual position is used as the first target position, and the control part of the target operation control is moved to the first target position on the second interface.
[0136] Optionally, the response module 1001 is also used to select a first target position from the second interface and move the control part of the target operation control to the first target position on the second interface if the actual position is outside the operation area corresponding to the target operation control on the second interface.
[0137] Optionally, the response module 1001 is also used to respond to the operation of the virtual object controlled by the user moving to the target interactive device, display the target interactive device on the first interface, and display the target operation control from the perspective of the first operation plane and the perspective of the first viewing plane.
[0138] Optionally, the response module 1001 is further configured to obtain a new second operation plane in response to an operation of the user adjusting the viewing angle of the second operation plane.
[0139] Optionally, see Fig. 9 This embodiment also provides a computer device, which includes: a processor 2001, a memory 2002 and a bus, the memory 2002 stores machine-readable instructions executable by the processor 2001, when the electronic device is running, the processor 2001 and the memory 2002 communicate through the bus, the processor 2001 executes the above-mentioned machine-readable instructions to execute the steps of the interactive device control method of the simulation scene in the above-mentioned embodiment.
[0140] The memory 2002, the processor 2001 and the bus components are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The data processing device of the interactive device control system of the simulation scene includes at least one software function module that can be stored in the memory 2002 in the form of software or firmware or solidified in the operating system (OS) of the computer device. The processor 2001 is used to execute the executable modules stored in the memory 2002, such as the software function modules and computer programs included in the data processing device of the interactive device control system of the simulation scene.
[0141] Among them, the memory 2002 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0142] Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method embodiment are executed. The specific implementation method and technical effect are similar and will not be repeated here.
[0143] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0144] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the contribution to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0145] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for controlling interactive devices in a simulation scene, It is characterized in that The method comprises: In response to a user clicking operation on a target operation control in a target interactive device on a first interface, obtaining a position of a first viewing plane and a first operation plane of the target operation control in the target interactive device on the first interface, wherein the first viewing plane is a plane where a bottom surface of the target operation control is located, and the first operation plane is a plane where a control portion of the target operation control is located; The viewing angle of the first operation plane is adjusted to the viewing angle of the user, and a second operation plane of the target operation control on the second interface is obtained. According to the viewing angle of the second operation plane, a second viewing angle plane of the target operation control on the second interface is obtained. The viewing angle of the user is used to indicate the viewing angle at which the user can observe all the to-be-selected states included in the first operation plane. The second interface is an interface that pops up after the user clicks the operation. Displaying a second interface, and displaying the target operation control on the second interface from a perspective of the second operation plane and a perspective of the second viewing plane; In response to a triggering operation of the target operation control by a user on the second interface, moving a control portion of the target operation control to a first target position on the second interface; Determine a second target position of the control portion of the target operation control on the first interface according to the first target position of the control portion of the target operation control on the second interface, and move the control portion of the target operation control in the first interface to the second target position; The determining, according to the first target position of the control unit of the target operation control on the second interface, a second target position of the control unit of the target operation control on the first interface comprises: Performing an orthographic projection on the target operation control located at the first target position toward the second viewing plane, and obtaining the second target position of the control part of the target operation control at the first interface according to the result of the orthographic projection; The orthographically projecting the target operation control located at the first target position toward the second viewing plane, and obtaining the second target position of the control part of the target operation control at the first interface according to the result of the orthographic projection, comprises: Dividing the second viewing angle plane into a plurality of mapping areas, each mapping area corresponding to a plurality of states of the target interactive device; Determining a target mapping area on the second interface according to the orthographic projection result; Determining the state of the target operation control according to the target mapping area; The second target position of the control part of the target operation control on the first interface is obtained according to the state of the target operation control.
2. The interactive device control method for the simulation scene according to claim 1, It is characterized in that The step of responding to a triggering operation of the target operation control by the user on the second interface to move the control portion of the target operation control to a first target position on the second interface includes: In response to a trigger operation of the target operation control by the user on the second interface, obtaining an actual position after the operation; If the actual position is within the operation area corresponding to the target operation control on the second interface, the actual position is used as the first target position, and the control part of the target operation control is moved to the first target position on the second interface.
3. The interactive device control method for the simulation scene according to claim 2, It is characterized in that After the actual position after the acquisition operation, the following is further included: If the actual position is outside the operation area corresponding to the target operation control on the second interface, the first target position is selected from the second interface, and the control part of the target operation control is moved to the first target position on the second interface.
4. The interactive device control method for a simulation scene according to any one of claims 1 to 3, It is characterized in that The step of responding to a user's click operation on a target operation control in a target interactive device on a first interface, and acquiring a position of a first viewing plane and a first operation plane of a target operation control in the target interactive device on the first interface includes: In response to the operation of the virtual object controlled by the user moving to the target interactive device, the target interactive device is displayed on the first interface, and the target operation control is displayed from the perspective of the first operation plane and the perspective of the first viewing plane.
5. The interactive device control method for a simulation scene according to any one of claims 1 to 3, It is characterized in that The displaying of the second interface includes: In response to the user's operation of adjusting the viewing angle of the second operation plane, a new second operation plane is obtained.
6. An interactive device control device for a simulation scene, It is characterized in that The device comprises: a response module, configured to respond to a user's click operation on a target operation control in a target interactive device on a first interface, and obtain a position of a first viewing plane and a first operation plane of the target operation control in the target interactive device on the first interface, wherein the first viewing plane is a plane where a bottom surface of the target operation control is located, and the first operation plane is a plane where a control portion of the target operation control is located; a processing module, configured to adjust the viewing angle of the first operation plane to the viewing angle of the user, obtain a second operation plane of the target operation control on the second interface, and obtain a second viewing angle plane of the target operation control on the second interface according to the viewing angle of the second operation plane, wherein the viewing angle of the user is used to indicate a viewing angle at which the user can observe all the to-be-selected states included in the first operation plane, and the second interface is an interface that pops up after the user clicks; The processing module is further used to display a second interface, and display the target operation control on the second interface from the perspective of the second operation plane and the perspective of the second viewing plane; The response module is further configured to, in response to a trigger operation of the target operation control by a user on the second interface, move the control portion of the target operation control to a first target position on the second interface; The processing module is further used to determine the second target position of the control part of the target operation control on the first interface according to the first target position of the control part of the target operation control on the second interface, and move the control part of the target operation control in the first interface to the second target position; The processing module is specifically used for: Performing an orthographic projection on the target operation control located at the first target position toward the second viewing plane, and obtaining the second target position of the control part of the target operation control at the first interface according to the result of the orthographic projection; The processing module is also specifically used for: Dividing the second viewing angle plane into a plurality of mapping areas, each mapping area corresponding to a plurality of states of the target interactive device; Determining a target mapping area on the second interface according to the orthographic projection result; Determining the state of the target operation control according to the target mapping area; The second target position of the control part of the target operation control on the first interface is obtained according to the state of the target operation control.
7. A computer device, It is characterized in that The computer device includes: a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the steps of the interactive device control method for the simulation scene as described in any one of claims 1 to 5.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the interactive device control method for a simulation scene according to any one of claims 1 to 5.
Citation Information
Patent Citations
Viewing angle control method and device, storage medium and electronic equipment
CN110141855A
