Virtual model control method, device, storage medium and electronic device
By utilizing the movement distance and direction of the control medium on a graphical user interface to achieve rotation and scaling of virtual models, the problem of simultaneous rotation and scaling in existing technologies is solved, thus improving the gaming experience.
Patent Information
- Application Number
- CN202111131996.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-09-26
AI Technical Summary
Current technology does not allow for simultaneous rotation and scaling of virtual models, which affects players' ability to freely view virtual models from multiple angles and sizes, thus reducing the gaming experience.
The rotation and scaling of the virtual model are achieved by manipulating the distance and direction of movement of the control medium on the graphical user interface. The initial position of the control medium is determined by using preset control events, a coordinate system is constructed, and the rotation angle and scaling factor are calculated to achieve multi-angle and multi-size control of a single control medium.
It enables simultaneous rotation and scaling of the virtual model, improving the player's gaming experience and allowing players to freely view the virtual model from multiple angles and sizes, thus enhancing the game's interactivity.
Smart Images

Figure CN113941142B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a control method, device, storage medium and electronic equipment for a virtual model. Background Art
[0002] With the development of portable devices such as smart phones and tablet computers, more and more games are being used on mobile terminals. At present, in games, players can rotate virtual characters and / or virtual models in the game by sliding their fingers on the screen of the game terminal, and scale virtual characters and / or virtual models by zooming in or out, zooming in and out, or using a two-finger operation, but cannot rotate and scale virtual characters and / or virtual models at the same time, which affects the player's free viewing of virtual characters and / or virtual models from multiple angles and sizes, and reduces the player's gaming experience.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, storage medium and electronic device for controlling a virtual model, so as to at least solve the technical problem in the prior art that it is impossible to simultaneously rotate and scale the virtual model.
[0005] According to one aspect of an embodiment of the present invention, a method for controlling a virtual model is provided, comprising: providing a graphical user interface through a display screen of a terminal device, the graphical user interface including a virtual model; responding to a preset manipulation event of an operating medium in a preset area of the graphical user interface, determining a moving distance and a moving direction of the operating medium on the graphical user interface based on an initial manipulation position of the preset manipulation event; and performing a rotation operation and a scaling operation on the virtual model according to the moving distance and the moving direction.
[0006] Furthermore, the control method of the virtual model also includes: before determining the moving distance and moving direction of the manipulation medium on the graphical user interface based on the initial manipulation position of the preset manipulation event, storing position information of the initial manipulation position on the graphical user interface.
[0007] Furthermore, the control method of the virtual model also includes: obtaining the target position after the control medium moves according to the moving distance and moving direction; determining a first distance of the target position in the horizontal coordinate direction and a second distance in the vertical coordinate direction in a preset coordinate system; rotating the virtual model according to the first distance; and scaling the virtual model according to the second distance.
[0008] Furthermore, the control method of the virtual model also includes: obtaining the maximum rotation angle of the virtual model and the maximum horizontal movement distance of the manipulation medium in the horizontal coordinate direction; calculating a first ratio between the first distance and the maximum horizontal movement distance; calculating the product between the first ratio and the maximum rotation angle to obtain the target rotation angle of the virtual model; and rotating the virtual model according to the target rotation angle.
[0009] Furthermore, the control method of the virtual model also includes: determining a target direction mapped from the moving direction to the horizontal coordinate direction; and controlling the virtual model to rotate toward the target direction by a target rotation angle.
[0010] Furthermore, the control method of the virtual model also includes: when the moving direction is mapped to the first direction of the vertical coordinate direction, obtaining the maximum magnification of the virtual model and the maximum vertical movement distance of the control medium in the first direction; calculating the second ratio between the second distance and the maximum vertical movement distance; calculating the product between the second ratio and the maximum magnification to obtain the target magnification of the virtual model; and enlarging the virtual model according to the target magnification.
[0011] Furthermore, the control method of the virtual model also includes: when the moving direction is mapped to the second direction of the vertical coordinate direction, obtaining the maximum reduction factor of the virtual model and the maximum vertical movement distance of the control medium in the second direction; calculating a third ratio between the second distance and the maximum vertical movement distance; calculating the product between the third ratio and the maximum reduction factor to obtain a target reduction factor of the virtual model; and performing a reduction operation on the virtual model according to the target reduction factor.
[0012] Furthermore, the control method of the virtual model also includes: when there are multiple control media, obtaining the initial control position of each control medium on the graphical user interface; when at least one initial control position corresponding to the multiple control media is located in a preset area, scaling the virtual model according to the relative moving distance between the multiple control media; rotating the virtual model according to the moving distance and moving direction of the medium set corresponding to the multiple control media on the graphical user interface.
[0013] According to another aspect of an embodiment of the present invention, a control device for a virtual model is also provided, including: a display module, used to provide a graphical user interface through a display screen of a terminal device, the graphical user interface including a virtual model; a determination module, used to respond to a preset manipulation event of an operating medium in a preset area of the graphical user interface, and determine a moving distance and a moving direction of the manipulation medium on the graphical user interface based on an initial manipulation position of the preset manipulation event; and a control module, used to rotate and scale the virtual model according to the moving distance and the moving direction.
[0014] According to another aspect of an embodiment of the present invention, a storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned control method of the virtual model when running.
[0015] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, which includes one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned virtual model control method when running.
[0016] In an embodiment of the present invention, a method of simultaneously rotating and scaling a virtual model according to the moving distance and moving direction of a manipulation medium is adopted, a graphical user interface is provided through a display screen of a terminal device, and in response to a preset manipulation event of the manipulation medium in a preset area of the graphical user interface, the moving distance and moving direction of the manipulation medium on the graphical user interface are determined based on an initial manipulation position of the preset manipulation event, and the virtual model is rotated and scaled according to the moving distance and moving direction, wherein the graphical user interface includes a virtual model.
[0017] In the above process, four operations on the virtual model can be determined according to the moving distance and direction of the control medium on the graphical user interface, namely, a left turn to zoom in operation, a left turn to zoom out operation, a right turn to zoom in operation, and a right turn to zoom out operation. That is, in the present application, the moving distance and direction of the control medium on the graphical user interface are comprehensively considered, and the virtual model is rotated and scaled at the same time according to the moving distance and direction of the control medium, thereby achieving the function of rotating and scaling the virtual model at the same time through a single control medium, thereby enabling players to freely view the virtual model from multiple angles and sizes, thereby improving the player's gaming experience.
[0018] It can be seen that the solution provided in the present application achieves the purpose of simultaneously rotating and scaling the virtual model, thereby achieving the technical effect of improving the player's gaming experience, and further solving the technical problem in the prior art that the virtual model cannot be rotated and scaled at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0020] Figure 1 is a flow chart of a control method of a virtual model according to an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of an optional preset coordinate system according to an embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of controlling an optional virtual model according to an embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of a control device of a virtual model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Example 1
[0027] According to an embodiment of the present invention, an embodiment of a control method for a virtual model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flow chart of a control method of a virtual model according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0029] Step S102: providing a graphical user interface through a display screen of a terminal device, wherein the graphical user interface includes a virtual model.
[0030] In step S102, the terminal device may be a device with a touch screen, on which the game can be run, and the game scene when the game is run can be displayed on the touch screen of the terminal device. Optionally, the terminal device may be a handheld device, such as a smart phone, a smart tablet, etc., or a non-handheld device, such as a computer.
[0031] It should be noted that the above-mentioned terminal device can be used as the execution subject of the method provided in this embodiment.
[0032] In addition, the above-mentioned virtual model may be, but is not limited to, a defense tower, a mountain, a stone, a tree, a house, etc. in a game scene, and the above-mentioned virtual model may also be a model corresponding to a virtual character in the game.
[0033] Step S104 , in response to a preset manipulation event of the operating medium in a preset area of the graphical user interface, determining a moving distance and a moving direction of the operating medium on the graphical user interface based on an initial manipulation position of the preset manipulation event.
[0034] In step S104, the above-mentioned manipulation medium may be a finger, palm, toe, etc. of the player, or a capacitive pen, mouse, etc. The above-mentioned preset area is a specific area on the graphical user interface that can trigger a rotation operation or a zoom operation on the virtual model, which may be an area on the graphical user interface that contains the virtual model, or a specific area near the virtual model. The preset manipulation event may be a sliding operation (e.g., a sliding touch operation on a touch display screen) or other manipulation events in which the manipulation position changes continuously.
[0035] Optionally, taking the manipulation medium as the player's finger as an example, in this scenario, the display screen of the terminal device is a touch screen. The player can perform touch operations on the graphical user interface displayed on the touch screen of the terminal device, and the terminal device can detect the touch position of the player's finger. The touch position where each touch operation first contacts the touch screen is the initial manipulation position.
[0036] It should be noted that the method of obtaining the initial control position by controlling the graphical user interface of the terminal device through control media such as a capacitive pen and a mouse is the same as the method of obtaining the initial control position by controlling the graphical user interface of the terminal device through the player's fingers, and no examples will be given here.
[0037] In addition, the player can also control the terminal device in a non-contact control form, for example, the player places a finger at a preset position in front of the display screen of the terminal device, that is, the player's finger does not touch the display screen of the terminal device. In this scenario, after the terminal device enters the non-contact control mode, the terminal device can detect the control position of the player's finger at the beginning of the non-contact control and map it to the initial control position on the display screen of the terminal device.
[0038] In addition, it should be noted that, in actual applications, when the control medium performs a sliding operation on the graphical user interface, the graphical user interface will display a game scene corresponding to the sliding operation. For example, when the control medium slides upward on the graphical user interface, the graphical user interface displays the game scene above the display area of the display screen of the terminal device. However, the control instructions for the same operation in different scenarios may be different. Therefore, in order to avoid the false triggering of the control instructions for the same operation in different scenarios, in this application, when it is detected that the control medium is located in a preset area, the terminal device can determine that the user needs to perform a zoom operation and / or a rotation operation on the virtual model, thereby avoiding the problem of false triggering of the control instructions for the same operation in different scenarios.
[0039] Step S106: performing rotation and scaling operations on the virtual model according to the moving distance and the moving direction.
[0040] In step S106, the moving distance represents the rotation angle of the virtual model and the scaling factor of the virtual model, and the moving direction represents the rotation direction of the virtual model and the scaling type of the virtual model.
[0041] It is easy to notice that since the above-mentioned moving distance and moving direction can be obtained by moving a single control medium on the graphical user interface, and the virtual model can be rotated and scaled by the moving distance and moving direction, therefore, step S106 can be used to realize the simultaneous rotation and scaling operations of the virtual model by a single control medium, thereby improving the player's gaming experience.
[0042] Based on the scheme defined in the above steps S102 to S106, it can be known that in an embodiment of the present invention, a method of simultaneously rotating and scaling the virtual model according to the moving distance and moving direction of the manipulation medium is adopted, a graphical user interface is provided through the display screen of the terminal device, and in response to a preset manipulation event of the manipulation medium in a preset area of the graphical user interface, the moving distance and moving direction of the manipulation medium on the graphical user interface are determined based on the initial manipulation position of the preset manipulation event, and the virtual model is rotated and scaled according to the moving distance and moving direction, wherein the graphical user interface includes a virtual model.
[0043] It is easy to notice that in the above process, four operations on the virtual model can be determined according to the moving distance and moving direction of the control medium on the graphical user interface, namely, the left turn to zoom in operation, the left turn to zoom out operation, the right turn to zoom in operation, and the right turn to zoom out operation. That is, in the present application, the moving distance and moving direction of the control medium on the graphical user interface are comprehensively considered, and the virtual model is rotated and scaled at the same time according to the moving distance and moving direction of the control medium, so that the virtual model can be rotated and scaled at the same time through a single control medium, thereby allowing the player to freely view the virtual model from multiple angles and sizes, thereby improving the player's gaming experience.
[0044] It can be seen that the solution provided in the present application achieves the purpose of simultaneously rotating and scaling the virtual model, thereby achieving the technical effect of improving the player's gaming experience, and further solving the technical problem in the prior art that the virtual model cannot be rotated and scaled at the same time.
[0045] In an optional embodiment, after detecting the initial manipulation position of the manipulation medium on the graphical user interface, when detecting that the initial manipulation position is within a preset area, the terminal device stores the position information of the initial manipulation position on the graphical user interface. In order to use the initial manipulation position as a reference point for rotation and scaling operations, a coordinate system can be constructed with it as the origin. For example, Figure 2 A schematic diagram of an optional preset coordinate system is shown, wherein o represents the initial control position.
[0046] Furthermore, after constructing the preset coordinate system, the terminal device rotates and scales the virtual model according to the moving distance and moving direction. Specifically, the terminal device obtains the target position after the manipulation medium moves according to the moving distance and moving direction, and determines the first distance of the target position in the horizontal coordinate direction and the second distance in the vertical coordinate direction in the preset coordinate system, and then rotates the virtual model according to the first distance, and scales the virtual model according to the second distance. For example, Figure 2 In the figure, the black dot indicates the target position after the manipulation medium moves according to the moving distance and moving direction. Figure 2 It can be seen that the target position is located in the first quadrant of the preset coordinate system, wherein the first distance of the target position mapped in the horizontal coordinate direction (ie, the x-axis direction) is a, and the second distance of the target position mapped in the vertical coordinate direction (ie, the y-axis direction) is b.
[0047] It should be noted that the first distance represents the rotation angle of the virtual model, and the second distance represents the zoom factor of the virtual model. By changing the target position of the manipulation medium, the user can adjust the first distance and the second distance to control the rotation angle and zoom factor of the virtual model.
[0048] Furthermore, after determining the first distance, the terminal device rotates the virtual model according to the first distance. Specifically, the terminal device first obtains the maximum rotation angle of the virtual model and the maximum horizontal movement distance of the manipulation medium in the horizontal coordinate direction, and then calculates the first ratio between the first distance and the maximum horizontal movement distance, and calculates the product between the first ratio and the maximum rotation angle to obtain the target rotation angle of the virtual model. Finally, the virtual model is rotated according to the target rotation angle. For example, the maximum horizontal movement distance that the manipulation medium can move on the graphical user interface is A, and the maximum rotation angle of the virtual model is α, then the target rotation angle β can be expressed by the following formula:
[0049]
[0050] It should be noted that after determining the target rotation angle of the virtual model, it is also necessary to determine the rotation direction of the virtual model, wherein, in the present application, the rotation direction may include a rightward rotation direction and a leftward rotation direction.
[0051] In an optional embodiment, the rotation direction is determined according to the direction of the moving direction mapped to the horizontal coordinate direction. Specifically, the terminal device determines the target direction mapped to the horizontal coordinate direction of the moving direction, and controls the virtual model to rotate toward the target direction by a target rotation angle. Figure 2 In the embodiment, if the target direction of the target position mapped in the horizontal coordinate direction is the positive direction of the x-axis, the target rotation direction of the virtual model is determined to be the right rotation direction; if the target direction of the target position mapped in the horizontal coordinate direction is the negative direction of the x-axis, the target rotation direction of the virtual model is determined to be the left rotation direction.
[0052] It should be noted that the terminal device can also determine the rotation direction based on the quadrant of the target position in the preset coordinate system. For example, if the target position is in the first quadrant or the fourth quadrant, the rotation direction of the virtual model is determined to be right; if the target position is in the second quadrant or the third quadrant, the rotation direction of the virtual model is determined to be left.
[0053] In an optional embodiment, after obtaining the second distance, the terminal device performs a scaling operation on the virtual model according to the second distance. Specifically, when the moving direction is mapped to the first direction of the vertical coordinate direction, the maximum magnification of the virtual model and the maximum vertical moving distance of the manipulation medium in the first direction are obtained, and then the second ratio between the second distance and the maximum vertical moving distance is calculated, and the product between the second ratio and the maximum magnification is calculated to obtain the target magnification of the virtual model. Finally, the virtual model is zoomed in according to the target magnification. For example, the maximum vertical moving distance that the manipulation medium can move on the graphical user interface is B, and the maximum magnification of the virtual model is γ 1 , then the target magnification factor ψ 1 It can be expressed by the following formula:
[0054]
[0055] In addition, when the moving direction is mapped to the second direction of the vertical coordinate direction, the terminal device obtains the maximum reduction multiple of the virtual model and the maximum vertical moving distance of the manipulation medium in the second direction, and then calculates the third ratio between the second distance and the maximum vertical moving distance, and calculates the product between the third ratio and the maximum reduction multiple to obtain the target reduction multiple of the virtual model, and finally, the virtual model is reduced according to the target reduction multiple. For example, the maximum vertical moving distance that the manipulation medium can move on the graphical user interface is B, and the maximum reduction multiple of the virtual model is γ 2 , then the target is reduced by a factor of ψ 2 It can be expressed by the following formula:
[0056]
[0057] It should be noted that the first direction and the second direction are different directions. Figure 3 In the control diagram of the virtual model shown, the first direction is the positive direction of the y-axis, and the second direction is the negative direction of the y-axis. That is, when the moving direction is mapped in the positive direction of the y-axis, the virtual model is enlarged; when the moving direction is mapped in the negative direction of the y-axis, the virtual model is reduced.
[0058] In addition, it should be noted that, in actual applications, the type of scaling operation performed on the virtual model can also be determined based on the quadrant in which the target position is located. For example, if the target position is in the first quadrant or the second quadrant, the virtual model is zoomed in; if the target position is in the third quadrant or the fourth quadrant, the virtual model is zoomed out.
[0059] In an optional embodiment, when there are multiple manipulation media, the terminal device also obtains the initial manipulation position of each manipulation medium on the graphical user interface, and when at least one initial manipulation position corresponding to the multiple manipulation media is located in the preset area, the virtual model is scaled according to the relative movement distance between the multiple manipulation media, and the virtual model is rotated according to the movement distance and movement direction of the medium set corresponding to the multiple manipulation media on the graphical user interface. For example, the manipulation medium is a finger, and when two fingers are pinched together to control the scaling of the virtual model, if the two fingers move in the horizontal direction at the same time, for example, the two fingers move in the positive direction of the x-axis at the same time, then the terminal device scales the virtual model and also rotates the virtual model in the clockwise direction.
[0060] It should be noted that in a scenario with multiple manipulation media, the method for determining the rotation angle and rotation direction when rotating a virtual model is the same as the method for simultaneously rotating and scaling the virtual model with a single manipulation medium, and will not be repeated here.
[0061] In addition, it should be noted that in the present application, when the manipulation medium moves only in the horizontal coordinate direction or only in the vertical coordinate direction, the virtual model can be rotated or scaled only. The determination of the rotation angle and rotation direction and the determination of the scaling type and scaling multiple are the same as those described above in this embodiment, and will not be repeated here.
[0062] From the above content, it can be seen that the present application records the initial control position of the control medium and the graphical user interface, and uses the initial control position as a reference to determine the moving direction and moving distance of the control medium, and then simultaneously performs scaling and rotation operations on the virtual model according to the moving direction and moving distance, thereby realizing single-point control and simultaneously realizing rotation and scaling operations of the virtual model, satisfying the player's purpose of freely viewing the virtual model from multiple angles and sizes.
[0063] Example 2
[0064] According to an embodiment of the present invention, there is also provided an embodiment of a control device for a virtual model, wherein: Figure 4 is a schematic diagram of a control device of a virtual model according to an embodiment of the present invention, such as Figure 4 As shown, the device includes: a display module 401 , a determination module 403 and a control module 405 .
[0065] Among them, the display module 401 is used to provide a graphical user interface through the display screen of the terminal device, and the graphical user interface includes a virtual model; the determination module 403 is used to respond to a preset manipulation event of the operating medium in a preset area of the graphical user interface, and determine the moving distance and moving direction of the manipulation medium on the graphical user interface based on the initial manipulation position of the preset manipulation event; the control module 405 is used to rotate and scale the virtual model according to the moving distance and moving direction.
[0066] It should be noted that the above-mentioned display module 401, determination module 403 and control module 405 correspond to steps S102 to S106 in the above-mentioned embodiment 1, and the examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0067] Optionally, the control device of the virtual model further includes: a storage module, wherein the storage module is used to store position information of the initial manipulation position on the graphical user interface before determining the moving distance and moving direction of the manipulation medium on the graphical user interface based on the initial manipulation position of the preset manipulation event.
[0068] Optionally, the control module includes: an acquisition module, a second determination module, a first rotation module, and a first scaling module. The acquisition module is used to acquire the target position after the manipulation medium moves according to the moving distance and the moving direction; the second determination module is used to determine the first distance of the target position in the horizontal coordinate direction and the second distance in the vertical coordinate direction in the preset coordinate system; the first rotation module is used to rotate the virtual model according to the first distance; and the first scaling module is used to scale the virtual model according to the second distance.
[0069] Optionally, the first rotation module includes: a second acquisition module, a first calculation module, a second calculation module and a second rotation module. The second acquisition module is used to acquire the maximum rotation angle of the virtual model and the maximum horizontal movement distance of the manipulation medium in the horizontal coordinate direction; the first calculation module is used to calculate the first ratio between the first distance and the maximum horizontal movement distance; the second calculation module is used to calculate the product between the first ratio and the maximum rotation angle to obtain the target rotation angle of the virtual model; and the second rotation module is used to rotate the virtual model according to the target rotation angle.
[0070] Optionally, the second rotation module includes: a third determination module and a first control module, wherein the third determination module is used to determine the target direction mapped from the moving direction to the horizontal coordinate direction; and the first control module is used to control the virtual model to rotate toward the target direction by a target rotation angle.
[0071] Optionally, the first zoom module includes: a third acquisition module, a third calculation module, a fourth calculation module and a second zoom module. The third acquisition module is used to acquire the maximum magnification of the virtual model and the maximum vertical movement distance of the manipulation medium in the first direction when the movement direction is mapped to the first direction of the vertical coordinate direction; the third calculation module is used to calculate the second ratio between the second distance and the maximum vertical movement distance; the fourth calculation module is used to calculate the product between the second ratio and the maximum magnification to obtain the target magnification of the virtual model; the second zoom module is used to enlarge the virtual model according to the target magnification.
[0072] Optionally, the first zoom module includes: a fourth acquisition module, a fifth calculation module, a sixth calculation module and a third zoom module. The fourth acquisition module is used to acquire the maximum reduction factor of the virtual model and the maximum vertical movement distance of the manipulation medium in the second direction when the movement direction is mapped to the second direction of the vertical coordinate direction; the fifth calculation module is used to calculate the third ratio between the second distance and the maximum vertical movement distance; the sixth calculation module is used to calculate the product between the third ratio and the maximum reduction factor to obtain the target reduction factor of the virtual model; the third zoom module is used to perform a reduction operation on the virtual model according to the target reduction factor.
[0073] Optionally, the control device of the virtual model further includes: a fifth acquisition module, a fourth scaling module and a third rotation module. The fifth acquisition module is used to acquire the initial control position of each control medium on the graphical user interface when there are multiple control media; the fourth scaling module is used to scale the virtual model according to the relative movement distance between the multiple control media when at least one initial control position corresponding to the multiple control media is located in a preset area; the third rotation module is used to rotate the virtual model according to the movement distance and movement direction of the medium set corresponding to the multiple control media on the graphical user interface.
[0074] Example 3
[0075] According to another aspect of an embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the control method of the virtual model in the above-mentioned embodiment 1 when running.
[0076] Example 4
[0077] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, which includes one or more processors; a storage device for storing one or more programs, so that when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the control method of the virtual model in the above-mentioned embodiment 1 when running.
[0078] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0079] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0080] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0081] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0082] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0083] If the integrated unit 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, in essence, or the part that contributes to the prior art, or all 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: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0084] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A control method for a virtual model, It is characterized in that include: Providing a graphical user interface through a display screen of a terminal device, wherein the graphical user interface includes a virtual model; In response to a preset manipulation event of a single operating medium in a preset area of the graphical user interface, determining a moving distance and a moving direction of the manipulation medium on the graphical user interface based on an initial manipulation position of the preset manipulation event; Performing a rotation operation and a scaling operation on the virtual model simultaneously according to the moving distance and the moving direction; Before determining the moving distance and the moving direction of the manipulation medium on the graphical user interface based on the initial manipulation position of the preset manipulation event, the method further includes: storing position information of the initial manipulation position on the graphical user interface; Among them, rotating the virtual model according to the moving distance and the moving direction includes: obtaining a target position after the control medium moves according to the moving distance and the moving direction; determining a first distance of the target position in a horizontal coordinate direction and a second distance in a vertical coordinate direction in a preset coordinate system; controlling the rotation angle of the virtual model according to the first distance; controlling the zoom factor of the virtual model according to the second distance; controlling the virtual model to rotate right or left according to the direction mapped from the moving direction to the horizontal coordinate direction; controlling the virtual model to zoom in or out according to the direction mapped from the moving direction to the vertical coordinate direction, wherein the direction includes a first direction and a second direction, the first direction and the second direction are different directions, the first direction is used to control the virtual model to zoom in, and the second direction is used to control the virtual model to zoom out.
2. The method according to claim 1, It is characterized in that Performing the rotation operation on the virtual model according to the first distance includes: Acquire the maximum rotation angle of the virtual model and the maximum horizontal movement distance of the manipulation medium in the horizontal coordinate direction; calculating a first ratio between the first distance and the maximum horizontal movement distance; Calculating the product of the first ratio and the maximum rotation angle to obtain a target rotation angle of the virtual model; The virtual model is rotated according to the target rotation angle.
3. The method according to claim 2, It is characterized in that The step of rotating the virtual model according to the target rotation angle includes: Determine the target direction mapped from the moving direction to the horizontal coordinate direction; The virtual model is controlled to rotate toward the target direction by the target rotation angle.
4. The method according to claim 1, It is characterized in that Performing the scaling operation on the virtual model according to the second distance includes: When the moving direction is mapped to the first direction, obtaining a maximum magnification of the virtual model and a maximum vertical moving distance of the manipulation medium in the first direction; calculating a second ratio between the second distance and the maximum vertical movement distance; Calculating the product of the second ratio and the maximum magnification to obtain a target magnification of the virtual model; The virtual model is enlarged according to the target magnification.
5. The method according to claim 1, It is characterized in that Performing the scaling operation on the virtual model according to the second distance includes: When the moving direction is mapped to the second direction, obtaining a maximum reduction factor of the virtual model and a maximum vertical moving distance of the manipulation medium in the second direction; calculating a third ratio between the second distance and the maximum vertical movement distance; Calculating the product of the third ratio and the maximum reduction factor to obtain a target reduction factor of the virtual model; The virtual model is reduced in size according to the target reduction factor.
6. The method according to claim 1, It is characterized in that The method further comprises: When there are multiple manipulation media, obtaining an initial manipulation position of each manipulation medium on the graphical user interface; When at least one initial manipulation position corresponding to the plurality of manipulation media is located in the preset area, scaling the virtual model according to the relative movement distance between the plurality of manipulation media; The virtual model is rotated according to the moving distance and moving direction of the medium set corresponding to the plurality of manipulation media on the graphical user interface.
7. A control device for a virtual model, It is characterized in that include: A display module, used for providing a graphical user interface through a display screen of a terminal device, wherein the graphical user interface includes a virtual model; a determination module, configured to respond to a preset manipulation event of a single operating medium in a preset area of the graphical user interface and determine a moving distance and a moving direction of the manipulation medium on the graphical user interface based on an initial manipulation position of the preset manipulation event; A control module, used for simultaneously performing a rotation operation and a scaling operation on the virtual model according to the moving distance and the moving direction; A storage module, configured to store position information of the initial manipulation position on the graphical user interface before determining a moving distance and a moving direction of the manipulation medium on the graphical user interface based on the initial manipulation position of the preset manipulation event; The control module is also used to: obtain a target position of the manipulation medium after the manipulation medium moves according to the moving distance and the moving direction; Determine a first distance of the target position in the horizontal coordinate direction and a second distance in the vertical coordinate direction in a preset coordinate system; control the rotation angle of the virtual model according to the first distance; control the zoom factor of the virtual model according to the second distance; control the virtual model to rotate right or left according to the direction mapped from the moving direction to the horizontal coordinate direction; control the virtual model to zoom in or out according to the direction mapped from the moving direction to the vertical coordinate direction, wherein the directions include a first direction and a second direction, the first direction and the second direction are different directions, the first direction is used to control the virtual model to zoom in, and the second direction is used to control the virtual model to zoom out.
8. A storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the control method of the virtual model described in any one of claims 1 to 6 when running.
9. An electronic device, It is characterized in that The electronic device includes one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the program is configured to execute the control method of the virtual model described in any one of claims 1 to 6 when running.
Citation Information
Patent Citations
Virtual scene adjusting method and device in game, electronic device, and storage medium
CN109550247A
Method and device for controlling virtual character in game and terminal equipment
CN112791403A
Game machine and data storage medium having stored therein game program
US20050187015A1
Virtual vehicle control method in virtual scene, computer device, and storage medium
US20210016172A1
Video game system and method with enhanced three-dimensional character and background control due to environmental conditions
US6139433A
