CN108815848B - Virtual object display method, device, electronic device and storage medium - Google Patents

Virtual object display method, device, electronic device and storage medium Download PDF

Info

Publication number
CN108815848B
CN108815848B CN201810551586.9A CN201810551586A CN108815848B CN 108815848 B CN108815848 B CN 108815848B CN 201810551586 A CN201810551586 A CN 201810551586A CN 108815848 B CN108815848 B CN 108815848B
Authority
CN
China
Prior art keywords
virtual object
display
lens
bone
skeleton
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810551586.9A
Other languages
Chinese (zh)
Other versions
CN108815848A (en
Inventor
邓杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810551586.9A priority Critical patent/CN108815848B/en
Publication of CN108815848A publication Critical patent/CN108815848A/en
Application granted granted Critical
Publication of CN108815848B publication Critical patent/CN108815848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/64Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • A63F2300/6607Methods for processing data by generating or executing the game program for rendering three dimensional images for animating game characters, e.g. skeleton kinematics
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/80Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
    • A63F2300/8076Shooting

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a virtual object display method, a virtual object display device, an electronic device and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: displaying a first modality of a virtual object in a virtual scene in a first shot mode; adjusting bone parameters of a display model of the virtual object when it is detected that a lens mode is switched from the first lens mode to a second lens mode; displaying a second form of the virtual object in the virtual scene according to the adjusted bone parameters. The invention adjusts the skeleton parameters of the display model of the same virtual object aiming at two lens modes, thereby displaying different forms of the virtual object in the virtual scene, effectively saving the storage space, greatly reducing the calculation amount and improving the display efficiency.

Description

Virtual object display method, device, electronic device and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for displaying a virtual object, an electronic apparatus, and a storage medium.
Background
With the development of computer technology and the diversification of terminal functions, more and more games can be played on the terminal. The shooting game is a popular game in which a user can control a virtual object to fight other virtual objects in the virtual scene. There are some shooting games in which there are two lens modes: in these shooting games, the virtual scene and the virtual object in the virtual scene may be displayed in any one of two lens modes, and certainly, the lens mode may also be switched in the game to simulate displaying the virtual scene and the virtual object in the virtual scene through different viewing angles.
Currently, a person skilled in the relevant art usually makes two display models for a virtual object for a first person viewing angle and a third person viewing angle respectively: the system only comprises a model of two arms and a whole body model, and also respectively produces two sets of animation resources: the movement of the two arms and the movement of the whole body. Accordingly, the virtual object display method generally determines how two display models of the virtual object are displayed in the current scene, then determines the currently-used lens mode, displays the display model corresponding to the currently-used lens mode in the virtual scene, and hides the display model corresponding to the other lens mode. When the lens mode switching operation is detected, the currently displayed display model can be hidden, and the display model corresponding to the switched lens mode is displayed.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
technical personnel need to make two display models and two sets of animation resources for a virtual object in advance, when any lens mode is adopted to display a virtual scene, the display conditions of the two display models in the current scene need to be determined, the display conditions of the two display models are respectively determined, and the conditions that the actions of the virtual object are inconsistent may occur when the lens mode is switched.
Disclosure of Invention
The embodiment of the invention provides a virtual object display method, a virtual object display device, an electronic device and a storage medium, and can solve the problems of large calculation amount, low display efficiency and poor virtual object display effect in the related art. The technical scheme is as follows:
in one aspect, a method for displaying a virtual object is provided, where the method includes:
in a first shot mode, displaying a first modality of a virtual object in a virtual scene, the first modality being determined based on a display model of the virtual object;
when a lens mode is detected to be switched from the first lens mode to a second lens mode, adjusting the skeleton parameters of a display model of the virtual object, wherein the second lens mode is different from the first lens mode in lens position;
displaying a second form of the virtual object in the virtual scene according to the adjusted bone parameters.
In one aspect, there is provided a virtual object display apparatus, the apparatus including:
a display module for displaying a first modality of a virtual object in a virtual scene in a first shot mode, the first modality being determined based on a display model of the virtual object;
an adjusting module, configured to adjust a skeleton parameter of a display model of the virtual object when it is detected that a lens mode is switched from the first lens mode to a second lens mode, where a lens position of the second lens mode is different from a lens position of the first lens mode;
the display module is further configured to display a second form of the virtual object in the virtual scene according to the adjusted bone parameter.
In one aspect, an electronic device is provided and includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement an operation performed by any one of the virtual object display methods.
In one aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, the instruction being loaded and executed by a processor to implement an operation performed by any one of the virtual object display methods.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
according to the embodiment of the invention, the skeleton parameters of the display model of the same virtual object are adjusted according to the two lens modes, so that different forms of the virtual object are displayed in a virtual scene, and two display models do not need to be respectively manufactured according to the two lens modes, and when the virtual object needs to be displayed, how the two display models are displayed in the current scene is determined, so that one display model is displayed and the other display model is hidden according to the lens modes, therefore, the storage space is effectively saved, the calculation amount is greatly reduced, the display efficiency is improved, and as the same display model is displayed before and after the lens modes are switched, the virtual object can be ensured to act consistently in the lens mode switching process, and the display effect is good.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a terminal interface according to an embodiment of the present invention;
fig. 2 is a diagram of an actual interface of a terminal according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a terminal interface according to an embodiment of the present invention;
fig. 4 is a diagram of an actual interface of a terminal according to an embodiment of the present invention;
FIG. 5 is a flowchart of a method for displaying a virtual object according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a positional relationship between a camera model and a virtual object according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating a positional relationship between a camera model and a virtual object according to an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a positional relationship between a camera model and a virtual object according to an embodiment of the present invention;
FIG. 9 is a schematic diagram illustrating a positional relationship between a camera model and a virtual object according to an embodiment of the present invention;
FIG. 10 is a diagram illustrating a bone condition in a display model of a virtual object according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating a bone condition in a display model of a virtual object according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating a bone condition in a display model of a virtual object according to an embodiment of the present invention;
fig. 13 is a flowchart of a method for adjusting a viewing angle according to an embodiment of the present invention;
FIG. 14 is a schematic structural diagram of a virtual object display apparatus according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention mainly relates to an electronic game or a simulated training scene, taking the electronic game scene as an example, a user can operate on the terminal in advance, the terminal can download a game configuration file of the electronic game after detecting the operation of the user, and the game configuration file can comprise an application program, interface display data or virtual scene data and the like of the electronic game, so that the user can call the game configuration file when logging in the electronic game on the terminal to render and display an interface of the electronic game. A user may perform a touch operation on a terminal, and after the terminal detects the touch operation, the terminal may determine game data corresponding to the touch operation, and render and display the game data, where the game data may include virtual scene data, behavior data of a virtual object in the virtual scene, and the like.
The virtual scene related to the invention can be used for simulating a three-dimensional virtual space and can also be used for simulating a two-dimensional virtual space, and the three-dimensional virtual space or the two-dimensional virtual space can be an open space. The virtual scene may be used to simulate a real environment in reality, for example, the virtual scene may include sky, land, sea, and the like, the land may include environmental elements such as desert, city, and the like, the user may control a virtual object to move in the virtual scene, the virtual object may be an avatar in the virtual scene for representing the user, the avatar may be any form, such as a human being, an animal, and the like, which is not limited by the present invention. The virtual scene may include a plurality of virtual objects, each virtual object having its own shape and volume in the virtual scene and occupying a portion of the space in the virtual scene.
Taking a shooting game as an example, the user may control the virtual object to freely fall, glide or open a parachute to fall in the sky of the virtual scene, run, jump, crawl, bow to move on the land, or control the virtual object to swim, float or dive in the sea, or the like. The user can also control the virtual object to fight with other virtual objects through weapons, wherein the weapons can be cold weapons or hot weapons, and the invention is not particularly limited to this.
Generally, a shooting game may include two lens modes when displaying a virtual scene and a virtual object or a virtual article in the virtual scene: the system comprises a first lens mode and a second lens mode, wherein the first lens mode is a display mode for displaying the virtual scene and the virtual object through a third person called visual angle, and the second lens mode is a display mode for displaying the virtual scene and the virtual object through the first person called visual angle. In the first lens mode, the camera may be generally located at a position around the virtual object so that the whole body or most of the area of the virtual object may be displayed in the virtual scene, and thus the user may see the motion of the virtual object and the environment in the virtual scene. The second lens mode is for simulating viewing of the virtual scene through the viewing angle of the virtual object, and in the second lens mode the camera may be worn generally on the body of the virtual object, for example, on the chest of the virtual object, so that the user can see both arms of the virtual object in the virtual scene.
For example, in fig. 1, that is, the display situation in the first shot mode, since the camera position may be at the back and above the virtual object, most of the area of the virtual object may be included in the virtual scene displayed in the interface, so that the virtual object, the prop being used by the virtual object, and the like may be observed in the interface, and in the actual interface of the terminal, the situation of displaying the virtual object in the first shot mode is as shown in fig. 2. Fig. 3 is a display situation in the second lens mode, in which two arms of a virtual object and a prop being used by the virtual object are displayed when a virtual scene observed through the lens of the camera is displayed in the interface because the camera is positioned in the vicinity of the eyes of the virtual object, for example, the chest. In the terminal real interface, a case where the virtual object is displayed in the second shot mode is shown in fig. 4.
Of course, the viewing direction of the camera is generally parallel to the viewing direction of the virtual object, in one possible implementation, when the user does not change the posture of the virtual object in the first lens mode but only wants to adjust the viewing direction of the camera to adjust the currently displayed virtual scene, the terminal may further control the camera to rotate around the virtual object with the vertical direction of the virtual object in the three-dimensional coordinate system as the central axis according to the touch operation of the user, and of course, in another possible implementation, the terminal may also change only the viewing direction of the camera without changing the position of the camera, which is not limited by the embodiment of the present invention.
In a possible implementation manner, in the two lens modes, the user may also perform a view angle adjustment operation to adjust a view angle for observing the virtual scene and the virtual object in the virtual scene. The terminal detects the visual angle adjustment operation, and can display the areas corresponding to different angles in the same virtual scene according to different visual angles, so that the situation that the angle of the real scene changes when a person turns around can be simulated.
The user can carry out visual angle adjustment operation on the terminal, and when the terminal detects the visual angle adjustment operation, the terminal can adjust the visual angle according to the visual angle adjustment operation. Specifically, the terminal may adjust the viewing angle by controlling the lens to rotate, and accordingly, the virtual scene that can be shot by the lens may also change due to the rotation of the lens, that is, the display areas of the virtual scene may be different. The operation of adjusting the viewing angle may be a movement operation on a mouse, a key operation, a sliding operation on a terminal screen, or other operations, for example, an operation manner such as a gyroscope and a three-dimensional Touch (3D Touch), which is not limited in the embodiment of the present invention.
Specifically, the rotation direction of the lens may be the same as the direction indicated by the viewing angle adjustment operation, the rotation speed of the lens may be positively correlated with the operation speed of the viewing angle rotation operation, and the greater the operation speed, the greater the rotation speed. The operation mode is different and the determination mode is different for the rotation angle of the lens. For example, if the angle-of-view adjustment operation is a movement operation, a sliding operation, or a gyro operation on a mouse, the rotation angle of the lens may be positively correlated with the operation distance or the operation range of the angle-of-view adjustment operation. I.e. the larger the operating distance or the operating amplitude, the larger the rotation angle. If the angle of view adjustment is a key operation or 3D Touch operation, the angle of rotation of the lens may be positively correlated with the operation duration or operation strength of the angle of view adjustment, i.e., the greater the operation duration or operation strength, the greater the angle of rotation. Of course, the rotation angle of the lens may also be inversely related to the operation strength, that is, the larger the operation strength is, the smaller the rotation angle is, which is not limited in the embodiment of the present invention.
Accordingly, a determination mode for determining a rotation parameter of the lens according to the angle-of-view adjustment operation may be preset in the terminal, where the rotation parameter of the lens refers to a rotation direction, a rotation angle, a rotation speed, and the like of the lens. When detecting the operation of adjusting the view angle, the terminal may determine the rotation direction, rotation angle, rotation speed, and the like of the lens according to a determination manner corresponding to a specific operation manner. It should be noted that the above-mentioned operation manner of adjusting the viewing angle may be preset by a related technician, or may be adjusted by a user according to a use habit of the user, which is not specifically limited in the embodiment of the present invention.
Fig. 5 is a flowchart of a virtual object display method according to an embodiment of the present invention, and referring to fig. 5, the method may include the following steps:
501. the terminal displays a first form of a virtual object in a virtual scene in a first shot mode.
Wherein the first modality is determined based on a display model of the virtual object. The display model of the virtual object may be a three-dimensional model or a two-dimensional model, which is not limited in the embodiments of the present invention. The terminal can display the display model of the virtual object in the virtual scene to realize the display of the virtual object in the virtual scene. Of course, the terminal may also display the change of the display model to realize the action change of the virtual object in the virtual scene, and the like.
In the embodiment of the present invention, the number of the display models corresponding to the virtual object is one, and the display model of the virtual object may be a whole-body model of the virtual object. In one possible implementation, the skeletal parameters of the display model of the virtual object may be different when the lens patterns are different in the same scene. Wherein, the bone parameter may refer to a length of a bone in a display model of the virtual object, an angle between different bones.
It should be noted that, when the user controls the virtual object to move or perform different actions in the virtual scene through touch operation, angles between bones in the display model of the virtual object may also be different, but lengths of bones in the display model of the virtual object do not change.
In step 501, when detecting that the current lens mode is the first lens mode, the terminal may obtain a display model of the virtual object, where each bone length of the display model of the virtual object is a bone length corresponding to the first lens mode, and may also obtain a joint parameter of the display model of the virtual object, where the joint parameter includes an angle between each bone in the display model of the virtual object, so that the terminal performs skinning on the bone in the display model according to the joint parameter, and displays the first form of the virtual object based on the display model of the virtual object obtained after skinning. Of course, the terminal may also determine a display area of the display model displaying the virtual object in the virtual scene according to the current viewing angle, so as to render and display the display model in the display area in the virtual scene.
In a possible implementation manner, when detecting an angle-of-view adjustment operation in the first lens mode, the terminal may further control the lens in the first lens mode to rotate according to the angle-of-view adjustment operation, so that the virtual scene may be displayed to change as the lens rotates along with the rotation of the lens, and the virtual object also makes a corresponding turning or pitching motion as the lens rotates.
502. When a lens mode is detected to switch from a first lens mode to a second lens mode, the terminal adjusts a length of a first skeleton in a display model of the virtual object.
The second lens mode and the first lens mode have different lens positions. In one possible approach, the lens in the first lens mode is located at the upper rear of the virtual object, and the lens in the second lens mode is worn on the body of the virtual object, for example, the lens may be worn on the chest skeleton in the display model of the virtual object, so as to simulate the environment or action of observing the virtual scene and the virtual object at an objective viewing angle and a virtual object viewing angle, respectively.
In one possible implementation manner, the first lens mode and the second lens mode may be implemented by two camera models, for example, a first camera model may be preset at the rear upper part of the virtual object, a second camera model may be preset on the body of the virtual object, and when the lens mode is the first lens mode, the terminal displays the virtual scene and the virtual object through a lens of the first camera model. When the lens mode is detected to be switched from the first lens mode to the second lens mode, the terminal can display the virtual scene and the virtual object through the lens of the second camera model by switching the camera models. For example, as shown in fig. 6, the first camera model is at the upper rear of the virtual object, and the second camera model can be worn on the virtual object, and specifically, referring to fig. 7 to 9, the position relationship between the two camera models and the virtual object is displayed from the viewing angles of the side, the upper and the front of the displayed model of the virtual object, respectively.
In another possible implementation manner, the two lens modes may also be implemented by changing the position of the camera model, for example, when the lens mode is the first lens mode, the terminal sets the position of the camera model at the upper rear of the virtual object, and when it is detected that the lens mode is switched from the first lens mode to the second lens mode, the terminal may change the position of the camera model from the upper rear of the virtual object to the body of the virtual object, for example, on the thoracic bone in the display model of the virtual object, which implementation manner is not limited by the embodiment of the present invention.
The user may perform a lens mode switching operation on the terminal, where the lens mode switching operation may be a touch operation on a lens mode switching button, and a position of the lens mode switching button may be preset by a related technician or may be adjusted by the user according to a use habit of the user, which is not limited in the embodiment of the present invention. When the terminal detects the lens mode switching operation, the bone parameters of the display model of the virtual object can be adjusted, so that the adjusted bone parameters are the bone parameters corresponding to the switched lens mode.
In one possible implementation, the length of the first skeleton in the display model of the virtual object may be different when the lens modes are different. Wherein the first bone may be a bone below the chest in the displayed model of the virtual object, the orientation of the bone being generally vertical when the virtual object is in a standing position. When the terminal detects that the lens mode is switched from the first lens mode to the second lens mode, the length of the first skeleton in the display model of the virtual object can be adjusted.
Specifically, the step 502 may be: the terminal adjusts a length of a first bone in the displayed model of the virtual object from a first length to a second length, the second length being greater than the first length. In one possible implementation, the lens of the second lens mode is worn on a second skeleton in the display model of the virtual object, the second skeleton being connected to the first skeleton. The length of the first skeleton is increased, and the height of the second skeleton is correspondingly increased with the height of the ground, so that although the lens is worn on the chest of the virtual object, the height of the lens of the camera from the ground can be consistent with the height of the eyes of the virtual object from the ground, and the action of observing the virtual scene and the virtual scene through the eyes of the virtual object can be really simulated, and the condition that the observation visual angle is too low when the virtual object looks downwards can not occur.
For example, as shown in fig. 10 and 11, the content displayed in fig. 10 is a bone condition of the display model of the virtual object in the first lens mode, wherein the length of the first bone is a first length, and the content displayed in fig. 11 is a bone condition of the display model of the virtual object in the second lens mode, wherein the length of the first bone is a second length, the second length is greater than the first length, and the height of the second bone from the ground in fig. 11 is higher than the height of the second bone from the ground in fig. 10.
503. And the terminal adjusts the angle between the second skeleton in the display model and the first skeleton after the length adjustment according to the current visual angle direction.
Because the lens in the second lens mode can be worn on the second skeleton in the display model, the terminal can adjust the length of the first skeleton and the angle between the second skeleton and the first skeleton in the display model, so that the direction of the lens is consistent with the visual angle direction, the visual angle direction is consistent before and after the lens mode is switched, and the lens mode switching process is more natural. Specifically, the terminal may acquire a current viewing angle direction, and adjust an angle between the second skeleton in the display model and the first skeleton whose length is adjusted according to the current viewing angle direction.
In one possible implementation manner, the terminal can adjust the angle between the second bone and the first bone by rotating the second bone in the display model. And when the terminal rotates the second skeleton, the lens on the second skeleton can rotate along with the rotation of the second skeleton, so that the visual angle adjustment is realized, and the direction of the lens is consistent with the current visual angle direction.
That is, when the angle-of-view adjustment operation is detected in the second lens mode, the terminal may control the second skeleton of the virtual object to rotate according to the angle-of-view adjustment operation, where the lens in the second lens mode rotates along with the rotation of the second skeleton. It should be noted that, if the angle of view changes in the vertical direction during the angle of view adjustment operation, the angle between the second bone and the first bone will also change when the terminal controls the second bone to rotate.
Certainly, since the length of the first bone and the position of the second bone are changed, the positions of other bones connected with the first bone and the second bone may also be changed correspondingly, and the terminal may obtain the position conditions of other bones based on the position conditions of the first bone and the second bone, which is not described herein again.
The foregoing steps 502 and 503 are processes of adjusting bone parameters of the display model of the virtual object when it is detected that the lens mode is switched from the first lens mode to the second lens mode, and the terminal adjusts the length of the first bone and the angle between the second bone and the first bone in the display model of the virtual object, so as to increase the height of the lens of the camera model from the ground to the height between the eyes of the virtual object and the ground, and the direction of the viewing angle after switching is not changed, so that the switching process is natural, and when the virtual scene and the virtual object are displayed in the second lens mode, discomfort caused by too low lens position of the camera model is not generated, so that the simulation situation is more real, and the display effect of the virtual object is improved.
Similarly, when it is detected that the lens mode is switched from the second lens mode to the first lens mode, the terminal may also adjust a bone parameter of the display model of the virtual object, specifically, may adjust a length of a first bone in the display model of the virtual object from a second length to a first length, and adjust an angle between the first bone and a second bone in the display model according to the current view angle direction, so that the posture of the virtual object is consistent with the current view angle direction. Of course, the terminal can also adjust the direction of the lens of the switched first lens mode according to the current view angle direction, so that the direction of the lens is consistent with the current view angle direction, thereby ensuring that the display conditions before and after the lens mode is switched are consistent, the switching process is natural, and the display effect of the virtual object is improved.
In a possible implementation manner, when the terminal detects the view angle adjustment operation in the first lens mode, the lens in the first lens mode may be controlled to rotate according to the view angle adjustment operation, so as to change the display area of the virtual scene or the display area of the virtual object.
504. And the terminal acquires joint parameters of the display model of the virtual object according to the adjusted bone parameters, wherein the joint parameters comprise angles among all bones in the display model.
The terminal adjusts the bone parameters of the display model of the virtual object in the above steps, and can acquire the joint parameters of the display model of the virtual object according to the adjusted lengths of the first bone and the second bone or the angle between the two bones.
Specifically, the terminal may further determine a joint parameter corresponding to the view angle direction according to the current view angle direction, so that the posture of the virtual object corresponding to the joint parameter is consistent with the current view angle direction. In a possible implementation manner, the joint parameter may also be determined according to the behavior data of the virtual object, the joint parameter of the display model of the virtual object is different when the surrounding environment of the virtual object is different, or when the moving state of the virtual object in the virtual scene is different, of course, the joint parameter may also be related to other factors, the behavior data, the current viewing angle direction, and the like of the virtual object and the joint parameter may be stored in the terminal in advance, and the terminal may obtain the corresponding joint parameter according to any one or more of the factors, which is not limited in the embodiment of the present invention.
505. And the terminal performs skinning on the skeleton in the display model according to the joint parameters to obtain a second form of the virtual object.
The skinning refers to a technology of binding a model to a skeleton, that is, binding an external outline of a display model of a virtual object to the skeleton, so as to achieve an effect that an external display condition of the display model of the virtual object is consistent with the skeleton of the model. The second configuration may be determined based on the adjusted bone parameters and a skinned display model of the virtual object.
Specifically, a bone skinning algorithm may be stored in the terminal in advance, and after the terminal determines the joint parameter of the display model of the virtual object, the terminal may determine the specific display condition of the external contour of the display model of the virtual object according to the joint parameter and the bone skinning algorithm, that is, the specific display form of the virtual object, that is, the second form, is obtained. Wherein the joint parameters of the bone are determined, and the bone in the displayed model of the virtual object is determined, the outer contour (also referred to as "skin") of the displayed model of the virtual object is bound to the bone, such that the outer contour can be attached to the bone. Specifically, when the bone changes, that is, when the joint parameters change, the external contour attached to the bone also changes correspondingly, so that the virtual object can be displayed to make a corresponding action, wherein the process of binding the external contour with the bone is a skinning process.
In a possible implementation manner, the existence form of the external contour may be a vertex mesh, and the skinning process is a process of calculating the position of each vertex in the vertex mesh, and specifically, the coordinate position of each vertex may be calculated, which is not described herein. Of course, all the bone skinning algorithms used in the vertex position calculation process in the skinning process may be preset by a related technician, and the embodiment of the present invention does not limit the specific content of the bone skinning algorithm.
506. The terminal displays the second form of the virtual object in the virtual scene.
Specifically, the terminal may display a display model of the virtual object obtained by adjusting the bone parameters in the virtual scene to display the second form of the virtual object. Of course, when the current viewing angle directions are different and the second form of the virtual object is displayed, the display areas of the display model of the virtual object may also be different, so that different parts of the person who looks at different directions in the real scene may also be simulated. For example, in the second lens mode, when the viewing direction is directly in front of the virtual object, the display area of the display model may be the area where two arms are located in the display model; when the viewing direction is from the right above to the right below of the virtual object, the display area of the display model may be the area where two arms and two legs are located in the display model.
The above steps 504 to 506 are processes of displaying the second form of the virtual object in the virtual scene according to the adjusted bone parameter, and through the above step of adjusting the bone parameter of the display model of a virtual object, the form of the virtual object corresponding to the adjusted display model is displayed based on the adjusted bone parameter, and there is no need to design a display model for each lens mode, and there is no need to set a corresponding animation resource for each display model, thereby saving the storage space. When the virtual object is displayed, the display conditions of the two display models in the current scene do not need to be calculated, so that the memory occupied during operation is saved, the calculated amount of bones in the display models is also saved, and the display efficiency is improved.
Further, when the lens mode is switched, the display models of the virtual objects displayed before and after switching are the same, and the situation that the actions of the virtual objects before and after switching are inconsistent does not occur. And by adjusting the chest bone in the display model of the virtual object, when the virtual object looks downward in the second lens mode, an empty space appears in the chest area of the display model of the virtual object below the lens, as shown in fig. 12, the sole of the virtual object can be seen through the lens, and the situation that the lens penetrates into the chest area of the display model and the inside of the model is seen to cause upper penetration cannot occur due to the rotation of the lens.
In the above description, only the case where the terminal confirms the display of the virtual object at the time of switching the lens mode is described as an example, and as shown in steps 501 and 503, when the operation of adjusting the angle of view is detected, the steps executed by the terminal in the two lens modes are different, in the first lens mode, the terminal can directly control the lens to rotate, and in the second lens mode, the terminal can rotate the lens along with the rotation of the second skeleton by rotating the second skeleton, in one possible implementation manner, in the above-mentioned view angle adjusting process, the terminal may further obtain a target animation of the display model of the virtual object based on the view angle adjusting operation, the target animation is used for embodying that the virtual object changes the orientation along with the visual angle adjusting operation, and the changing orientation comprises turning left and right or changing the pitching angle. After the terminal acquires the target animation, the target animation can be displayed in a scene interface of the virtual scene changing along with the lens rotation operation.
Specifically, the process of the terminal acquiring the target animation may be: in a possible implementation manner, the two key frames may respectively store information such as the position and the orientation of a bone in a display model of the virtual object before and after the visual angle adjustment operation, and then the terminal may calculate key values such as rotation or translation of each bone through an interpolation algorithm according to the current time to obtain a change condition of the bone, and further calculate a position change condition of each vertex of the external contour based on the change condition of the bone, so that an animation sequence, that is, a target animation, is generated based on the change conditions of the bone and the external road contour. Of course, the above description only describes the generation of the target animation based on the key frame as an example, and it is needless to say that the above process may also generate the target animation in a frame-by-frame animation manner or other manners, which is not limited in the embodiment of the present invention.
The following steps executed by the terminal when adjusting the view angle in different lens modes are described in detail by taking the two camera models as an example only in the two lens modes:
fig. 13 is a flowchart of a method for adjusting a viewing angle according to an embodiment of the present invention, and referring to fig. 13, the terminal may determine whether a current lens mode is a first-person viewing angle (a second lens mode), and if so, the terminal may activate a first-person camera (a camera model in the second lens mode), elongate a thoracic skeleton, that is, adjust a length of the first skeleton, adjust the length of the first skeleton from a first length to a second length, and if a viewing angle adjustment operation is detected, the terminal may use the rotating thoracic skeleton to represent a pitch, that is, the terminal may change a viewing angle by rotating the thoracic skeleton (the second skeleton), so as to change a pitch angle of the virtual object. If the current lens mode is not the first-person angle of view, that is, the current lens mode is the third-person angle of view (the first lens mode), the terminal may activate the third-person camera (the camera model of the first lens mode), if the angle of view adjustment operation is detected, the terminal may use Aim Offset (Aim Offset) to represent the pitch, that is, directly control the lens to rotate, determine the orientation change condition of the virtual object in the animation resource based on the pre-saved state, and generate and display the target animation based on the target animation generation process.
According to the embodiment of the invention, the skeleton parameters of the display model of the same virtual object are adjusted according to the two lens modes, so that different forms of the virtual object are displayed in a virtual scene, and two display models do not need to be respectively manufactured according to the two lens modes, and when the virtual object needs to be displayed, how the two display models are displayed in the current scene is determined, so that one display model is displayed and the other display model is hidden according to the lens modes, therefore, the storage space is effectively saved, the calculation amount is greatly reduced, the display efficiency is improved, and as the same display model is displayed before and after the lens modes are switched, the virtual object can be ensured to act consistently in the lens mode switching process, and the display effect is good.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
Fig. 14 is a schematic structural diagram of a virtual object display apparatus according to an embodiment of the present invention, and referring to fig. 14, the apparatus may include:
a display module 1401 for displaying a first modality of a virtual object in a virtual scene in a first shot mode, the first modality being determined based on a display model of the virtual object;
an adjusting module 1402, configured to adjust a skeleton parameter of a display model of the virtual object when it is detected that a lens mode is switched from the first lens mode to a second lens mode, where a lens position of the second lens mode is different from that of the first lens mode;
the display module 1401 is further configured to display the second form of the virtual object in the virtual scene according to the adjusted bone parameter.
In one possible implementation, the adjusting module 1402 is configured to:
adjusting a length of a first bone in a display model of the virtual object;
and adjusting the angle between a second bone and the first bone after the length adjustment in the display model according to the current view angle direction, wherein the second bone is connected with the first bone.
In one possible implementation, the adjusting module 1402 is configured to:
the length of a first bone in the displayed model of the virtual object is adjusted from a first length to a second length, the second length being greater than the first length.
In one possible implementation, the second lens mode is different from the first lens mode in lens position, including:
the lens of the first lens mode is positioned at the rear upper part of the virtual object, and the lens of the second lens mode is worn on the body of the virtual object.
In one possible implementation, the display module 1401 is further configured to:
acquiring joint parameters of a display model of the virtual object according to the adjusted bone parameters, wherein the joint parameters comprise angles among bones in the display model;
covering the skeleton in the display model according to the joint parameters to obtain a second form of the virtual object;
displaying the second modality of the virtual object in the virtual scene.
In one possible implementation, the apparatus further includes:
the control module is used for controlling the lens in the first lens mode to rotate according to the visual angle adjusting operation when the visual angle adjusting operation is detected in the first lens mode; or the like, or, alternatively,
and the control module is used for controlling a second skeleton in the display model of the virtual object to rotate according to the visual angle adjusting operation when the visual angle adjusting operation is detected in a second lens mode, and the lens in the second lens mode rotates along with the rotation of the second skeleton.
The device provided by the embodiment of the invention adjusts the skeleton parameters of the display model of the same virtual object according to the two lens modes, so that different forms of the virtual object are displayed in a virtual scene, and two display models do not need to be respectively manufactured according to the two lens modes, and when the virtual object needs to be displayed, how the two display models are displayed in the current scene is determined, so that one display model is displayed and the other display model is hidden according to the lens modes, therefore, the storage space is effectively saved, the calculation amount is greatly reduced, the display efficiency is improved, and as the display models before and after the lens mode is switched are the same, the virtual object can be ensured to act consistently in the lens mode switching process, and the display effect is good.
It should be noted that: in the virtual object display apparatus provided in the above embodiment, when displaying a virtual object, only the division of the above functional modules is taken as an example, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the above described functions. In addition, the virtual object display apparatus provided in the above embodiments and the virtual object display method embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments, and are not described herein again.
Fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be provided as the terminal. The electronic device 1500 may generate a large difference due to different configurations or performances, and may include one or more processors (CPUs) 1501 and one or more memories 1502, where the memory 1502 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1501 to implement the virtual object display method provided by each of the method embodiments. Of course, the electronic device may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the electronic device may further include other components for implementing functions of the apparatus, which is not described herein again.
In an exemplary embodiment, there is also provided a computer readable storage medium, such as a memory, comprising instructions executable by a processor to perform the virtual object display method of the above embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit and scope of the present invention.

Claims (10)

1. A method for displaying a virtual object, the method comprising:
in a first lens mode, a virtual scene and a virtual object are displayed through a third person-named view angle based on a first camera positioned at the rear upper part of the virtual object, the virtual object is in a first form, the first form is determined based on a display model of the virtual object, and the first lens mode is a display mode for displaying the virtual scene and the virtual object through the third person-named view angle;
adjusting a length of a first skeleton in a display model of the virtual object when a lens mode is detected to switch from the first lens mode to a second lens mode; adjusting an angle between a second skeleton and the first skeleton after the length of the second skeleton is adjusted in the display model according to the current visual angle direction, wherein the second skeleton is connected with the first skeleton, and a second camera is worn on the second skeleton; the second lens mode is a display mode for displaying the virtual scene and the virtual object through the first person-named view angle;
displaying the virtual scene and the environment or the action of the virtual object from the perspective of the virtual object based on the second camera worn on the second skeleton according to the adjusted length of the first skeleton and the adjusted angle between the second skeleton and the first skeleton, wherein the virtual object is in a second form.
2. The method of claim 1, wherein said adjusting the length of the first bone in the displayed model of the virtual object comprises:
adjusting a length of a first bone in a displayed model of the virtual object from a first length to a second length, the second length being greater than the first length.
3. The method of claim 1, wherein the displaying the virtual scene and the environment or the action of the virtual object from the perspective of the virtual object based on the second camera worn on the second bone according to the adjusted length of the first bone and the angle between the second bone and the first bone comprises:
obtaining joint parameters of a display model of the virtual object according to the adjusted length of the first bone and the adjusted angle between the second bone and the first bone, wherein the joint parameters comprise the angle between each bone in the display model;
skinning the skeleton in the display model according to the joint parameters, and displaying a second form of the virtual object in the virtual scene;
displaying the virtual scene and the environment or action of the virtual object from the perspective of the virtual object based on the second camera worn on the second bone.
4. The method of claim 1, further comprising:
when visual angle adjusting operation is detected in a first lens mode, controlling a lens in the first lens mode to rotate according to the visual angle adjusting operation; or the like, or, alternatively,
when the visual angle adjusting operation is detected in a second lens mode, a second skeleton in the display model of the virtual object is controlled to rotate according to the visual angle adjusting operation, and the lens in the second lens mode rotates along with the rotation of the second skeleton.
5. An apparatus for displaying a virtual object, the apparatus comprising:
the display module is used for displaying a virtual scene and a virtual object through a third person-named view angle based on a first camera positioned above and behind the virtual object in a first lens mode, wherein the virtual object is in a first form, the first form is determined based on a display model of the virtual object, and the first lens mode is a display mode for displaying the virtual scene and the virtual object through the third person-named view angle;
an adjustment module to adjust a length of a first skeleton in a display model of the virtual object when a lens mode is detected to switch from the first lens mode to a second lens mode; adjusting an angle between a second skeleton and the first skeleton after the length of the second skeleton is adjusted in the display model according to the current visual angle direction, wherein the second skeleton is connected with the first skeleton, and a second camera is worn on the second skeleton; the second lens mode is a display mode for displaying the virtual scene and the virtual object through the first person-named view angle;
the display module is further configured to display a virtual scene and an environment or an action of the virtual object from a perspective of the virtual object based on the second camera worn on the second bone according to the adjusted length of the first bone and the adjusted angle between the second bone and the first bone, where the virtual object is in a second form.
6. The apparatus of claim 5, wherein the adjustment module is configured to:
adjusting a length of a first bone in a displayed model of the virtual object from a first length to a second length, the second length being greater than the first length.
7. The apparatus of claim 5, wherein the display module is further configured to:
obtaining joint parameters of a display model of the virtual object according to the adjusted length of the first bone and the adjusted angle between the second bone and the first bone, wherein the joint parameters comprise the angle between the bones in the display model;
skinning the skeleton in the display model according to the joint parameters, and displaying a second form of the virtual object in the virtual scene;
displaying the virtual scene and the environment or action of the virtual object from the perspective of the virtual object based on the second camera worn on the second bone.
8. The apparatus of claim 5, further comprising:
the control module is used for controlling the lens in the first lens mode to rotate according to the visual angle adjusting operation when the visual angle adjusting operation is detected in the first lens mode; or the like, or, alternatively,
and the control module is used for controlling a second skeleton in the display model of the virtual object to rotate according to the visual angle adjusting operation when the visual angle adjusting operation is detected in a second lens mode, and the lens in the second lens mode rotates along with the rotation of the second skeleton.
9. An electronic device, comprising a processor and a memory, wherein at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the operation performed by the virtual object display method according to any one of claims 1 to 4.
10. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by the virtual object display method of any one of claims 1 to 4.
CN201810551586.9A 2018-05-31 2018-05-31 Virtual object display method, device, electronic device and storage medium Active CN108815848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810551586.9A CN108815848B (en) 2018-05-31 2018-05-31 Virtual object display method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810551586.9A CN108815848B (en) 2018-05-31 2018-05-31 Virtual object display method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN108815848A CN108815848A (en) 2018-11-16
CN108815848B true CN108815848B (en) 2022-05-17

Family

ID=64146982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810551586.9A Active CN108815848B (en) 2018-05-31 2018-05-31 Virtual object display method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN108815848B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110694273A (en) * 2019-10-18 2020-01-17 腾讯科技(深圳)有限公司 Method, device, terminal and storage medium for controlling virtual object to use prop
CN110992495B (en) * 2019-12-26 2023-09-08 珠海金山数字网络科技有限公司 Method and device for deforming virtual model
CN111408132B (en) * 2020-02-17 2023-04-07 网易(杭州)网络有限公司 Game picture display method, device, equipment and storage medium
CN111714880B (en) * 2020-04-30 2023-10-20 完美世界(北京)软件科技发展有限公司 Picture display method and device, storage medium and electronic device
CN111617472A (en) * 2020-05-27 2020-09-04 腾讯科技(深圳)有限公司 Method and related device for managing model in virtual scene
CN111639612A (en) * 2020-06-04 2020-09-08 浙江商汤科技开发有限公司 Posture correction method and device, electronic equipment and storage medium
CN112752025B (en) * 2020-12-29 2022-08-05 珠海金山网络游戏科技有限公司 Lens switching method and device for virtual scene
CN114011071A (en) * 2021-11-05 2022-02-08 腾讯科技(深圳)有限公司 Control method and device of virtual role, storage medium and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8385596B2 (en) * 2010-12-21 2013-02-26 Microsoft Corporation First person shooter control with virtual skeleton
CN104050708A (en) * 2014-06-09 2014-09-17 无锡梵天信息技术股份有限公司 3D game engine LOD system achievement method
CN106528020B (en) * 2016-10-26 2019-05-31 腾讯科技(深圳)有限公司 A kind of field-of-view mode switching method and terminal

Also Published As

Publication number Publication date
CN108815848A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108815848B (en) Virtual object display method, device, electronic device and storage medium
CN109847336B (en) Virtual scene display method and device, electronic equipment and storage medium
US11325036B2 (en) Interface display method and apparatus, electronic device, and computer-readable storage medium
CN108579083B (en) Virtual scene display method and device, electronic device and storage medium
CN108415639B (en) Visual angle adjusting method and device, electronic device and computer readable storage medium
EP3943173A1 (en) Virtual object controlling method, apparatus and device and medium
KR101610702B1 (en) Sprite strip renderer
US8648864B2 (en) System and method for blended animation enabling an animated character to aim at any arbitrary point in a virtual space
US9208613B2 (en) Action modeling device, method, and program
CN109087369B (en) Virtual object display method, device, electronic device and storage medium
WO2021238870A1 (en) Information display method and apparatus, and device and storage medium
CN113797536B (en) Control method, device, equipment and storage medium for objects in virtual scene
CN112402960B (en) State switching method, device, equipment and storage medium in virtual scene
CN110096214B (en) Method, device, terminal and storage medium for controlling movement of virtual object
KR20230006517A (en) 2D image display method, apparatus, device and storage medium for virtual objects
CN111399639A (en) Method, device and equipment for controlling motion state in virtual environment and readable medium
US11816772B2 (en) System for customizing in-game character animations by players
CN110585695A (en) Method, apparatus, device and medium for using near-war property in virtual environment
CN116440495A (en) Scene picture display method and device, terminal and storage medium
JP2012034779A (en) Control program of game device, storage medium, control method of game device, and game device
CN112870694B (en) Picture display method and device of virtual scene, electronic equipment and storage medium
KR20230150874A (en) Graphic display methods, devices, devices and media based on hypothetical scenarios
CN114130006A (en) Control method, device, equipment, storage medium and program product of virtual prop
WO2024007704A1 (en) Virtual object display methods and apparatus, terminal device, and storage medium
CN117101138A (en) Virtual character control method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant