Virtual object display processing method and device, program product and electronic equipment
By setting multiple display information and their corresponding reference display directions in the virtual object, dynamically determine the target reference display direction, solving the problems of poor details and dynamic effects and over-drawing in the virtual object display, achieving better display effects and performance.
Patent Information
- Application Number
- CN202411615798.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art has problems such as poor details and dynamic display effects and over-drawing in the display of virtual objects.
By setting a plurality of display information and their corresponding reference display directions in the virtual object, the target reference display direction is dynamically determined based on the shooting direction of the virtual camera and the orientation relationship between the virtual object, so as to display the target virtual object in the virtual scene screen.
Improve the details and dynamic display effect of virtual objects, avoid the problem of excessive patch area, reduce unused areas, thereby improving the problem of overdrawing, reducing overhead and improving performance.
Smart Images

Figure CN119579779A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a virtual object display processing method, a virtual object display processing device, a computer program product, and an electronic device. Background Art
[0002] In the production of games, animations, and films, billboards are often used to display some virtual objects, giving the impression that the virtual objects are always facing the audience. However, related technologies suffer from poor display of details and dynamics, or overdraw. Summary of the Invention
[0003] The present disclosure provides a virtual object display processing method, a virtual object display processing device, a computer program product, and an electronic device to at least to some extent solve the problems of poor detail and dynamic display effects and over-drawing in related technologies.
[0004] According to a first aspect of the present disclosure, a virtual object display processing method is provided, wherein a graphical user interface is provided through a terminal device, the graphical user interface displays a virtual scene screen, and the virtual scene screen is a screen formed by shooting the virtual scene with a virtual camera set in the virtual scene; the virtual scene includes a target virtual object; the method includes: when the target virtual object is located within the shooting range of the virtual camera, according to the azimuth relationship between the shooting direction of the virtual camera and the target virtual object, determining a target reference display direction from multiple reference display directions of the target virtual object; wherein the target virtual object is configured with multiple display information, and the multiple display information respectively corresponds to the multiple reference display directions; according to the display information corresponding to the target reference display direction, the target virtual object is displayed in the virtual scene screen.
[0005] According to a second aspect of the present disclosure, a virtual object display processing device is provided, which provides a graphical user interface through a terminal device, and the graphical user interface displays a virtual scene screen, which is a screen formed by shooting the virtual scene with a virtual camera set in the virtual scene; the virtual scene includes a target virtual object; the device includes: a display direction processing module, which is configured to determine a target reference display direction from multiple reference display directions of the target virtual object according to the azimuth relationship between the shooting direction of the virtual camera and the target virtual object when the target virtual object is located within the shooting range of the virtual camera; wherein the target virtual object is configured with multiple display information, and the multiple display information respectively corresponds to the multiple reference display directions; a display information processing module is configured to display the target virtual object in the virtual scene screen according to the display information corresponding to the target reference display direction.
[0006] According to a third aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method of the first aspect and possible implementations thereof are implemented.
[0007] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method of the above-mentioned first aspect and its possible implementation methods by executing the executable instructions.
[0008] The technical solution disclosed in this disclosure has the following beneficial effects:
[0009] On the one hand, by setting multiple display information and their corresponding multiple reference display directions, different display directions of the target virtual object can present different detailed information, reflecting the differences under different viewing angles, and as the shooting direction changes, the target reference display direction may change, causing the displayed target virtual object to change dynamically. This improves the details and dynamic display effects. On the other hand, under a specific shooting direction, processing according to a corresponding display information can avoid the problem of too large a patch area, and there is no unused area when displaying the target virtual object, thereby improving the problem of over-drawing, reducing overhead, and improving performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 A flowchart showing a virtual object display processing method in this exemplary embodiment is shown;
[0011] Figure 2 A schematic diagram showing a reference display direction in this exemplary embodiment;
[0012] Figure 3A schematic diagram showing a dough sheet according to this exemplary embodiment;
[0013] Figure 4 A flow chart showing a method of determining a target reference display direction in this exemplary embodiment is shown;
[0014] Figure 5 A flowchart of performing a dot product operation in this exemplary embodiment is shown;
[0015] Figure 6 A flow chart showing a switching display mode in this exemplary embodiment is shown;
[0016] Figure 7 A schematic diagram showing a texture map in this exemplary embodiment;
[0017] Figures 8A to 8D Schematic diagrams showing display effects under different shooting directions in this exemplary embodiment;
[0018] Figure 9 A schematic structural diagram of a virtual object display processing device according to this exemplary embodiment is shown;
[0019] Figure 10 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0020] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.
[0021] The accompanying drawings are schematic illustrations of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art will appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or that other methods, components, devices, steps, etc. may be used to replace one or more specific details.
[0022] In the production of games, animations, films, and television, billboards are often used to display some virtual objects. For example, when processing the last level of detail (LOD) for models of trees and vegetation in a virtual scene, billboards are used to display them, giving the impression of always facing the audience. Related technologies include the following two implementation methods:
[0023] Single-view mode: Regardless of the viewing angle, the virtual object is displayed in the same form as at a fixed viewing angle. While this simplifies the display process, it also suffers from poor detail display. This is especially true when the virtual object's details vary from one direction to another. As a result, the virtual object remains unchanged when the user changes the viewing angle, lacking dynamic effects and resulting in a poor visual experience.
[0024] The multi-angle view method pre-sets multiple angles of view and displays them on a single patch. This method may result in patches that are too large, high overhead, and unused areas on the patch, causing overdraw and affecting performance.
[0025] In view of one or more of the above problems, an exemplary embodiment of the present disclosure provides a virtual object display processing method, which can achieve good details and dynamic display effects while ensuring low overhead and improve the problem of over-drawing.
[0026] Application scenarios of this exemplary embodiment include, but are not limited to: in a game, the virtual object display processing method is used to display a virtual scene and a target virtual object in the virtual scene, thereby giving a better visual experience to game users.
[0027] Figure 1 The schematic flow of the virtual object display processing method is shown, which may include the following steps:
[0028] Step S110, when the target virtual object is within the shooting range of the virtual camera, determining a target reference display direction from a plurality of reference display directions of the target virtual object based on an orientation relationship between the shooting direction of the virtual camera and the target virtual object; wherein the target virtual object is configured with a plurality of display information, and the plurality of display information respectively corresponds to the plurality of reference display directions;
[0029] Step S120 : Displaying the target virtual object in the virtual scene according to the display information corresponding to the target reference display direction.
[0030] exist Figure 1In the method shown, on the one hand, by setting multiple display information and corresponding multiple reference display directions, different display directions of the target virtual object can present different detailed information, reflecting the differences under different viewing angles. Moreover, as the shooting direction changes, the target reference display direction may change, causing the displayed target virtual object to change dynamically. This improves the display effect of details and dynamics. On the other hand, under a specific shooting direction, processing according to the corresponding display information can avoid the problem of excessive patch area, and there is no unused area when displaying the target virtual object, thereby improving the problem of overdrawing, reducing overhead, and improving performance.
[0031] Below Figure 1 Provide detailed instructions for each step.
[0032] refer to Figure 1 In step S110, when the target virtual object is within the shooting range of the virtual camera, the target reference display direction is determined from multiple reference display directions of the target virtual object according to the orientation relationship between the shooting direction of the virtual camera and the target virtual object; wherein the target virtual object is configured with multiple display information, and the multiple display information respectively corresponds to the multiple reference display directions.
[0033] In this exemplary embodiment, a graphical user interface is provided by a terminal device, and the graphical user interface displays a virtual scene image. The virtual scene image is an image formed by capturing the virtual scene using a virtual camera set in the virtual scene. The virtual scene can be a virtual two-dimensional or three-dimensional space. The virtual camera is a program tool that simulates a real camera to capture the virtual scene. The virtual scene image displayed in the graphical user interface can be an image of the virtual scene projected onto the imaging plane of the virtual camera. The virtual camera has a capturing range, which can be a conical area formed by the virtual camera's field of view.
[0034] The virtual scene includes a target virtual object, which can be any person or object in the virtual scene, such as a tree. In one embodiment, a virtual object that meets specific requirements can be used as the target virtual object, such as a specific requirement that the virtual object is a preset type and is at a preset LOD level. For example, the preset type can refer to trees or vegetation, and the preset LOD level can be a lower LOD level. When the tree or vegetation exceeds a certain distance from the virtual camera, it is determined that the tree or vegetation is at the preset LOD level, and the LOD level is used. Figure 1 The method shown is used to display trees or vegetation. Of course, the LOD level used at different distances is related to the screen parameters set by the user. This disclosure does not limit this.
[0035] The shooting direction of the virtual camera can be a direction along the optical axis of the virtual camera pointing toward the virtual camera's orientation area. The target virtual object has a certain position in the virtual scene. The relationship between the shooting direction of the virtual camera and the orientation of the target virtual object determines the user's perspective of the target virtual object. For example, the target virtual object has a reference direction, which can be the direction its front faces. The angle between the shooting direction and the reference direction can be used to represent the orientation relationship between the shooting direction and the target virtual object.
[0036] The target virtual object has multiple display information, each display information corresponds to a reference display direction. The display information and the reference display direction can be pre-configured. The reference display direction refers to the display direction in which the target virtual object can just present the display information. It can be understood that when observing the target virtual object along the reference display direction, the target virtual object seen matches the display information corresponding to the reference display direction. Figure 2 Take this as an example to illustrate: Figure 2 The target virtual object is shown to have four reference display directions, each corresponding to a piece of display information. For example, the first reference display direction corresponds to the first display information, which represents the features or form of the target virtual object as viewed from the first reference display direction. It should be understood that the reference display direction is the viewing direction for the target virtual object and can therefore be a direction determined based on the target virtual object's local coordinate system.
[0037] In one embodiment, the reference display direction may be a direction (or angle) range, such as Figure 2 As shown, the first reference display direction can be a direction that forms an angle of -45 degrees with both the X axis and the Y axis, or Figure 2 The 1 / 4 circular range shown indicates that the target virtual objects observed within the range all conform to the display information corresponding to the first reference display direction.
[0038] The display information includes but is not limited to one or more of the following forms: patches, textures, maps, three-dimensional models, display parameters (such as color, size, shape, etc.). For example, the above-mentioned multiple display information may include multiple patches, such as Figure 3 It shows that the target virtual object has 4 facets. Under different reference display directions, the target virtual object is seen as different facets.
[0039] Based on the orientation relationship between the shooting direction of the virtual camera and the target virtual object, a target reference display direction is determined from multiple reference display directions of the target virtual object. For example, based on the orientation relationship between the shooting direction and the target virtual object, the reference display direction to which the shooting direction is closest can be determined. For example, the angle between the shooting direction and each reference display direction can be calculated based on the orientation relationship. The smallest angle indicates that the shooting direction is closest to the corresponding reference display direction. This reference display direction is then used as the target reference display direction.
[0040] In one, reference Figure 4 As shown, the above-mentioned determination of the target reference display direction from the multiple reference display directions of the target virtual object based on the shooting direction of the virtual camera and the orientation relationship of the target virtual object may include the following steps S410 and S420:
[0041] Step S410 : performing a dot product operation on a first vector in the shooting direction and a second vector on the reference axis of the target virtual object.
[0042] The first vector in the shooting direction can be a vector of arbitrary length along the shooting direction, such as a unit vector. The reference axis of the target virtual object can be a reference axis determined based on its local coordinate system, such as the X-axis and Y-axis in its local coordinate system. The second vector is a vector of arbitrary length along the reference axis direction, such as a unit vector.
[0043] In one embodiment, reference Figure 5 As shown, performing a dot product operation on the first vector in the shooting direction and the second vector on the reference axis of the target virtual object may include the following steps S510 and S520:
[0044] Step S510, converting the first vector from the camera coordinate system of the virtual camera to the world coordinate system of the virtual scene, and converting the second vector from the local coordinate system of the target virtual object to the world coordinate system;
[0045] Step S520 , performing a dot product operation on the first vector and the second vector in the world coordinate system.
[0046] For example, the first vector can be multiplied by the transformation matrix from the camera coordinate system to the world coordinate system to obtain the first vector in the world coordinate system, and the second vector can be multiplied by the transformation matrix from the local coordinate system of the target virtual object to the world coordinate system to obtain the second vector in the world coordinate system. After unification to the world coordinate system, the first vector and the second vector can be directly subjected to a dot product operation, which is a relatively simple and convenient operation process. In addition, other operations or processing can also be performed in the world coordinate system, such as controlling the model of the target virtual object, etc. This eliminates the need for repeated transformations between multiple coordinate systems, which helps reduce performance overhead.
[0047] In one embodiment, before performing the dot product operation on the first vector and the second vector in the world coordinate system, the virtual object display processing method may further include the following steps:
[0048] Rotate the reference axis of the target virtual object by a preset angle; the preset angle is the critical angle between two different reference display directions.
[0049] The reference axis can be rotated before or after the second vector is converted to the world coordinate system. The critical angle between two different reference display directions represents the angle at which one reference display direction is switched to another. Figure 2 As shown, the critical angles between the first reference display direction and the second and third reference display directions are all 45 degrees, indicating that when the viewing direction deviates from the first reference display direction by 45 degrees, the display direction switches to the second or third reference display direction. Therefore, the preset angle can be determined to be 45 degrees. Of course, the present disclosure does not specifically limit the value of the preset angle.
[0050] Rotate the reference axis of the target virtual object by a preset angle. This allows the initial or default shooting direction to be at the critical angle between two different reference display directions. The program can then load the display information corresponding to the two reference display directions, such as loading two meshes. This allows for quick switching when the display needs to be switched, as the display information has already been loaded.
[0051] Step S420 : determining a target reference display direction from a plurality of reference display directions of the target virtual object according to the dot product calculation result.
[0052] For example, a dot product operation is performed on the first vector and the second vector. The dot product result can represent the angle between the shooting direction and the reference axis. From this, the relationship between the shooting direction and the reference display direction can be determined, and the target reference display direction can be determined from the multiple reference display directions. For example, the relationship (e.g., the angle) between each reference display direction and the reference axis can be pre-recorded. The relationship (e.g., the angle) between the shooting direction and the reference axis can be determined based on the dot product result. The two relationships can be compared to obtain the relationship between the shooting direction and the reference display direction, thereby determining the target reference display direction.
[0053] pass Figure 4 This method can quickly determine the target reference display direction and simplify the calculation process.
[0054] In one embodiment, the reference axis of the target virtual object includes an X-axis and a Y-axis; the second vector includes an X-axis vector and a Y-axis vector; the dot product operation result includes a first dot product operation result of the first vector and the X-axis vector, and a second dot product operation result of the first vector and the Y-axis vector. The X-axis and the Y-axis divide the XY plane into a first area, a second area, a third area, and a fourth area. The multiple reference display directions include: a first reference display direction, a second reference display direction, a third reference display direction, and a fourth reference display direction corresponding to the first area, the second area, the third area, and the fourth area, respectively. Figure 2 As shown, the negative half axis of the X-axis and the negative half axis of the Y-axis form a first area, which corresponds to the first reference display direction; the negative half axis of the X-axis and the positive half axis of the Y-axis form a second area, which corresponds to the second reference display direction; the positive half axis of the X-axis and the negative half axis of the Y-axis form a third area, which corresponds to the third reference display direction; the positive half axis of the X-axis and the positive half axis of the Y-axis form a fourth area, which corresponds to the fourth reference display direction.
[0055] The above-mentioned determining the target reference display direction from the multiple reference display directions of the target virtual object according to the dot product operation result may include the following steps:
[0056] If the result of the first dot product operation is negative and the result of the second dot product operation is negative, the first reference display direction is used as the target reference display direction;
[0057] If the result of the first dot product operation is negative and the result of the second dot product operation is positive, the second reference display direction is used as the target reference display direction;
[0058] If the result of the first dot product operation is positive and the result of the second dot product operation is negative, the third reference display direction is used as the target reference display direction;
[0059] If the first dot product calculation result is positive and the second dot product calculation result is positive, the fourth reference display direction is used as the target reference display direction.
[0060] For example, if the result of the first dot product operation is negative, it means that the angle between the shooting direction and the X-axis is between 90 and 180 degrees; if the result of the second dot product operation is negative, it means that the angle between the shooting direction and the Y-axis is between 90 and 180 degrees. Therefore, it is determined that the shooting direction is in the first area, and the first reference display direction corresponding to the first area is used as the target reference display direction; if the result of the first dot product operation is negative and the result of the second dot product operation is positive, it can be determined that the shooting direction is in the second area, and the second reference display direction corresponding to the second area is used as the target reference display direction; if the result of the first dot product operation is positive and the result of the second dot product operation is negative, it can be determined that the shooting direction is in the third area, and the third reference display direction corresponding to the third area is used as the target reference display direction; if the result of the first dot product operation is positive and the result of the second dot product operation is positive, it can be determined that the shooting direction is in the fourth area, and the fourth reference display direction corresponding to the fourth area is used as the target reference display direction. In this way, based on the positive and negative results of the first and second dot product operations, the corresponding reference display direction is quickly determined and used as the target reference display direction. There is no need to calculate the specific angle between the shooting direction and the reference axis, which is conducive to simplifying the calculation process and improving efficiency.
[0061] The above describes how to determine the target reference display direction. Figure 1 In step S120, the target virtual object is displayed in the virtual scene according to the display information corresponding to the target reference display direction.
[0062] The target virtual object displayed in the virtual scene may be a specific form of the target virtual object, which may be generated based on currently used display information. For example, the display information may include display parameters, and a model of the target virtual object is drawn based on the display parameters in the display information corresponding to the target reference direction to form the target virtual object displayed in the virtual scene.
[0063] In one embodiment, the plurality of display information includes a plurality of facets, which are arranged in a texture map of the virtual object. For example, four facets may be arranged in a texture map in the order of upper left, upper right, lower left, and lower right. In this way, any number of facets can be accommodated in DCC (Digital Content Creation) software or a game engine. Displaying the target virtual object in the virtual scene according to the display information corresponding to the target reference display direction may include the following steps:
[0064] Sampling from the texture map and painting the model vertices of the target virtual object;
[0065] According to the target patch among the multiple patches, the drawn model vertices corresponding to the target patch are retained, and the drawn model vertices corresponding to the non-target patches among the multiple patches are removed to obtain the target virtual object displayed in the virtual scene screen.
[0066] Among them, when the target reference display direction is determined, the patch corresponding to the target reference display direction is the target patch. Since the texture map includes multiple patches, after sampling and drawing the model vertices of the target virtual object, it can be drawn through a vertex shader in a game engine to obtain the drawn model vertices corresponding to multiple patches, retain the model vertices corresponding to the target patch, and remove the model vertices corresponding to other patches. For example, the model vertices corresponding to the non-target patch can be offset according to a preset offset parameter. The preset offset parameter can be a larger parameter set based on experience, such as (0,0,-100000), which means that the model vertices corresponding to the non-target patch are moved to a very far distance and will not be displayed in the virtual scene. In this way, only the part corresponding to the target patch is displayed, which can be understood as the two-dimensional projection effect of the target virtual object under the target reference display direction.
[0067] In one embodiment, since each patch has a different position in the texture map, each patch can correspond to a set of sampling information. Based on the sampling information corresponding to a target patch among the multiple patches, the target virtual object's model vertices can be sampled from the texture map and drawn to generate the target virtual object displayed in the virtual scene; the target patch is the patch corresponding to the target reference display direction.
[0068] In one embodiment, reference Figure 6 As shown, the virtual object display processing method may further include the following steps S610 and S620:
[0069] Step S610, in response to a change in the virtual camera's posture, determining a target reference display direction from the plurality of reference display directions again based on a relationship between the changed shooting direction and the orientation of the target virtual object;
[0070] Step S620: If the target reference display direction changes, the target virtual object in the virtual scene screen is switched from the first display form to the second display form; the first display form is a display form determined based on the display information corresponding to the target reference display direction before the change, and the second display form is a display form determined based on the display information corresponding to the target reference display direction after the change.
[0071] For example, when the user moves or changes the lens angle of the virtual camera, the shooting direction changes, and the orientation relationship between the shooting direction and the target virtual object also changes. The target reference display direction can be determined again from multiple reference display directions, and the target reference display direction may also change at this time. Figure 2 For example, the original shooting direction is in the first area, and the target reference display direction is the first reference display direction. As the user rotates the virtual camera, the shooting direction changes from the first area to the second area. At this time, the target reference display direction changes from the first reference display direction to the second reference display direction. Correspondingly, the target virtual object displayed in the virtual scene screen also changes, and can be switched from the first display form to the second display form. The first display form is a display form determined according to the display information corresponding to the first reference display direction, such as the display effect of the first surface corresponding to the first reference display direction. The second display form is a display form determined according to the display information corresponding to the second reference display direction, such as the display effect of the second surface corresponding to the second reference display direction. This achieves a dynamic display effect of the target virtual object and allows the user to observe the differences under different perspectives, thereby improving the fineness of the display effect.
[0072] The virtual object display processing method in this exemplary embodiment is further described below through examples.
[0073] The target virtual object can be a virtual tree model. The artist can pre-configure 4 facets (i.e. display information) for the virtual tree model and configure them in a texture map (such as UV1) of the virtual tree model. The texture map can refer to Figure 7 As shown in FIG, it includes patches of trees at different viewing angles. The UV2 of the virtual tree model stores the information of the reference display directions corresponding to the four patches. For example, (0, 0 0, 1 1, 0 1, 1) can be recorded to represent the reference display directions corresponding to the four patches.
[0074] Import the virtual tree model into the game engine and perform texture remapping on the model. You can scale UV1 and combine it with the offset of the value recorded in UV2 to determine the texture sampling range corresponding to each patch. For example, the texture sampling coordinates corresponding to each patch in UV1 can be remapped to: 0.5 (UV1 + UV2).
[0075] The virtual tree model's X and Y axes are rotated 45 degrees and then converted from the local coordinate system to the world coordinate system. The virtual camera's shooting direction is converted from the camera coordinate system to the world coordinate system. Using the game engine's WPO (World Position Offset) node, a dot product is performed on the first vector in the shooting direction with the X and Y axis vectors in the world coordinate system. Depending on the sign of the dot product result, the output is (0,0) (indicating that the first dot product result is negative and the second dot product result is negative), (0,1) (indicating that the first dot product result is negative and the second dot product result is positive), (1,0) (indicating that the first dot product result is positive and the second dot product result is negative), or (1,1) (indicating that the first dot product result is positive and the second dot product result is positive). By comparing this output value with the value recorded in UV2, the target reference display direction and target facets can be determined. The model vertices corresponding to non-target facets are offset according to the preset offset parameters to remove the non-target facets, so that only the drawn model vertices corresponding to the target facets are displayed.
[0076] As the virtual camera's position changes, the target reference display direction and target facets change, enabling the display effect to switch. For example, if the virtual camera is rotated 360 degrees around the Z axis of the world coordinate system, the display effect switches every 90 degrees. Figure 8A The display effect corresponding to the first facet is shown. Figure 8B The display effect corresponding to the second patch is shown. Figure 8C The display effect corresponding to the third patch is shown. Figure 8D The display effect corresponding to the fourth patch is shown.
[0077] The exemplary embodiment of the present disclosure also provides a virtual object display processing device, which provides a graphical user interface through a terminal device, and the graphical user interface displays a virtual scene screen, which is a screen formed by shooting the virtual scene through a virtual camera set in the virtual scene. The virtual scene includes a target virtual object; Figure 9 As shown, the virtual object display processing device 900 includes the following program modules:
[0078] The display direction processing module 910 is configured to, when the target virtual object is within the shooting range of the virtual camera, determine a target reference display direction from a plurality of reference display directions of the target virtual object based on an orientation relationship between the shooting direction of the virtual camera and the target virtual object; wherein the target virtual object is configured with a plurality of display information, and the plurality of display information respectively corresponds to the plurality of reference display directions;
[0079] The display information processing module 920 is configured to display the target virtual object in the virtual scene according to the display information corresponding to the target reference display direction.
[0080] In one embodiment, determining a target reference display direction from a plurality of reference display directions of the target virtual object according to a relationship between a shooting direction of the virtual camera and an orientation of the target virtual object includes:
[0081] Perform a dot product operation on the first vector in the shooting direction and the second vector on the reference axis of the target virtual object;
[0082] A target reference display direction is determined from a plurality of reference display directions of the target virtual object according to a dot product operation result.
[0083] In one embodiment, the reference axis of the target virtual object includes an X-axis and a Y-axis; the second vector includes an X-axis vector and a Y-axis vector; the dot product operation result includes a first dot product operation result of the first vector and the X-axis vector, and a second dot product operation result of the first vector and the Y-axis vector; the X-axis and the Y-axis divide the XY plane into a first area, a second area, a third area, and a fourth area; the multiple reference display directions include: a first reference display direction, a second reference display direction, a third reference display direction, and a fourth reference display direction corresponding to the first area, the second area, the third area, and the fourth area, respectively;
[0084] Determining a target reference display direction from multiple reference display directions of the target virtual object according to a dot product operation result, including:
[0085] If the result of the first dot product operation is negative and the result of the second dot product operation is negative, the first reference display direction is used as the target reference display direction;
[0086] If the result of the first dot product operation is negative and the result of the second dot product operation is positive, the second reference display direction is used as the target reference display direction;
[0087] If the result of the first dot product operation is positive and the result of the second dot product operation is negative, the third reference display direction is used as the target reference display direction;
[0088] If the first dot product calculation result is positive and the second dot product calculation result is positive, the fourth reference display direction is used as the target reference display direction.
[0089] In one embodiment, performing a dot product operation on a first vector in a shooting direction and a second vector on a reference axis of the target virtual object includes:
[0090] Converting the first vector from the camera coordinate system of the virtual camera to the world coordinate system of the virtual scene, and converting the second vector from the local coordinate system of the target virtual object to the world coordinate system;
[0091] Perform the dot product operation on the first vector and the second vector in the world coordinate system.
[0092] In one embodiment, before performing the dot product operation on the first vector and the second vector in the world coordinate system, the virtual object display processing device 900 is further configured to:
[0093] Rotate the reference axis of the target virtual object by a preset angle; the preset angle is the critical angle between two different reference display directions.
[0094] In one embodiment, the plurality of display information includes a plurality of facets, the plurality of facets are arranged in a texture map of the virtual object, and each facet corresponds to a set of sampling information; and displaying the target virtual object in the virtual scene according to the display information corresponding to the target reference display direction includes:
[0095] According to the sampling information corresponding to the target patch among the multiple patches, the model vertices of the target virtual object are sampled from the texture map and drawn to generate the target virtual object displayed in the virtual scene screen; the target patch is the patch corresponding to the target reference display direction.
[0096] In one embodiment, the virtual object display processing device 900 is further configured to:
[0097] In response to a change in the virtual camera's posture, a target reference display direction is again determined from the plurality of reference display directions according to a relationship between the changed shooting direction and the orientation of the target virtual object;
[0098] If the target reference display direction changes, the target virtual object in the virtual scene screen is switched from the first display form to the second display form; the first display form is the display form determined based on the display information corresponding to the target reference display direction before the change, and the second display form is the display form determined based on the display information corresponding to the target reference display direction after the change.
[0099] The specific details of each part of the above-mentioned device have been described in detail in the implementation method part. The undisclosed details can be found in the implementation method part, so they will not be repeated here.
[0100] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0101] The exemplary embodiments of the present disclosure further provide a computer program product, which includes a computer program, and implements the above method when the computer program is executed by a processor.
[0102] In one embodiment, a computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The computer-readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk drive (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing the computer program, such as a read-only memory, NAND flash memory, and the like.
[0103] In one embodiment, the computer program product may be an intangible product containing a computer program. For example, the computer program product may be implemented as a virtual digital product, such as a digital file such as an executable file or installation package storing the computer program.
[0104] The code of the computer program can be written in one or more programming languages. Programming languages include C, Java, C++, etc. The program code can be executed entirely on the user computing device, partially on the user computing device, or as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device via any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., via an Internet connection provided by a carrier).
[0105] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals, and then run the computer programs. When the computer program is running on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the following steps: Step S110, when the target virtual object is within the shooting range of the virtual camera, determine the target reference display direction from multiple reference display directions of the target virtual object according to the azimuth relationship between the shooting direction of the virtual camera and the target virtual object; wherein the target virtual object is configured with multiple display information, and the multiple display information respectively corresponds to the multiple reference display directions; Step S120, display the target virtual object in the virtual scene screen according to the display information corresponding to the target reference display direction.
[0106] The above method steps are implemented through a computer program. On the one hand, by setting multiple display information and corresponding multiple reference display directions, different display directions of the target virtual object can present different detailed information, reflecting the differences under different viewing angles. Moreover, as the shooting direction changes, the target reference display direction may change, causing the displayed target virtual object to change dynamically. This improves the detail and dynamic display effect. On the other hand, under a specific shooting direction, processing according to the corresponding display information can avoid the problem of excessive patch area, and there is no unused area when displaying the target virtual object, thereby improving the problem of overdrawing, reducing overhead, and improving performance.
[0107] The exemplary embodiments of the present disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as a computer program. The processor executes the executable instructions to perform the method steps of various exemplary embodiments of the present disclosure. The electronic device may also include a display for displaying a graphical user interface.
[0108] Reference below Figure 10 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 10 The electronic device 1000 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0109] like Figure 10 As shown, the electronic device 1000 may include a processor 1010 , a memory 1020 , a bus 1030 , an I / O (input / output) interface 1040 , a network adapter 1050 , and a display 1060 .
[0110] Memory 1020 may include volatile memory, such as RAM 1021 and cache unit 1022, and non-volatile memory, such as ROM 1023. Memory 1020 may also include one or more program modules 1024. Such program modules 1024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program modules 1024 may include the modules described above.
[0111] The processor 1010 may include one or more processing units, for example: the processor 1010 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0112] The processor 1010 can be used to execute executable instructions stored in the memory 1020, and the executable instructions include method steps of various exemplary embodiments of the present disclosure, such as the following steps: Step S110, when the target virtual object is located within the shooting range of the virtual camera, determine the target reference display direction from multiple reference display directions of the target virtual object according to the orientation relationship between the shooting direction of the virtual camera and the target virtual object; wherein the target virtual object is configured with multiple display information, and the multiple display information respectively corresponds to multiple reference display directions; Step S120, display the target virtual object in the virtual scene screen according to the display information corresponding to the target reference display direction.
[0113] By executing the above method steps through the processor 1010, on the one hand, by setting multiple display information and their corresponding multiple reference display directions, different display directions of the target virtual object can present different detailed information, reflecting the differences under different viewing angles, and as the shooting direction changes, the target reference display direction may change, causing the displayed target virtual object to change dynamically. This improves the details and dynamic display effects. On the other hand, under a specific shooting direction, processing according to a corresponding display information can avoid the problem of too large a patch area, and there is no unused area when displaying the target virtual object, thereby improving the problem of over-drawing, reducing overhead, and improving performance.
[0114] The bus 1030 is used to realize the connection between different components of the electronic device 1000 and may include a data bus, an address bus, and a control bus.
[0115] The electronic device 1000 can communicate with one or more external devices 1100 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 1040 .
[0116] The electronic device 1000 can communicate with one or more networks via the network adapter 1050. For example, the network adapter 1050 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. The network adapter 1050 can communicate with other modules of the electronic device 1000 via the bus 1030.
[0117] The electronic device 1000 can display a graphical user interface through the display 1060, such as displaying a virtual scene screen.
[0118] although Figure 10 Not shown, other hardware and / or software modules may also be provided in the electronic device 1000, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0119] As can be seen from the above, the technical solutions of the present disclosure can be implemented as methods, devices, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, such as "circuit", "module" or "system".
[0120] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are merely exemplary, and the scope and spirit of the present disclosure are indicated by the claims, which should cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the field of the present technology that are not disclosed in the present disclosure.
Claims
1. A virtual object display processing method, characterized in that: Providing a graphical user interface through a terminal device, wherein the graphical user interface displays a virtual scene image, wherein the virtual scene image is an image formed by photographing the virtual scene through a virtual camera set in the virtual scene; The virtual scene includes a target virtual object; the method includes: In a case where the target virtual object is within the shooting range of the virtual camera, determining a target reference display direction from a plurality of reference display directions of the target virtual object according to a shooting direction of the virtual camera and an orientation relationship between the target virtual object; wherein the target virtual object is configured with a plurality of display information, and the plurality of display information respectively corresponds to the plurality of reference display directions; The target virtual object is displayed in the virtual scene screen according to the display information corresponding to the target reference display direction.
2. The method according to claim 1, characterized in that The determining, according to the relationship between the shooting direction of the virtual camera and the orientation of the target virtual object, a target reference display direction from a plurality of reference display directions of the target virtual object comprises: Performing a dot product operation on a first vector in the shooting direction and a second vector on a reference axis of the target virtual object; A target reference display direction is determined from a plurality of reference display directions of the target virtual object according to a dot product operation result.
3. The method according to claim 2, characterized in that The reference axis of the target virtual object includes an X-axis and a Y-axis; the second vector includes an X-axis vector and a Y-axis vector; the dot product operation result includes a first dot product operation result of the first vector and the X-axis vector, and a second dot product operation result of the first vector and the Y-axis vector; The X-axis and the Y-axis divide the XY plane into a first area, a second area, a third area, and a fourth area; The multiple reference display directions include: a first reference display direction, a second reference display direction, a third reference display direction, and a fourth reference display direction corresponding to the first area, the second area, the third area, and the fourth area respectively; The step of determining a target reference display direction from a plurality of reference display directions of the target virtual object according to a dot product operation result includes: If the first dot product calculation result is negative and the second dot product calculation result is negative, the first reference display direction is used as the target reference display direction; If the first dot product calculation result is negative and the second dot product calculation result is positive, taking the second reference display direction as the target reference display direction; If the first dot product calculation result is positive and the second dot product calculation result is negative, taking the third reference display direction as the target reference display direction; If the first dot product calculation result is positive and the second dot product calculation result is positive, the fourth reference display direction is used as the target reference display direction.
4. The method according to claim 2, characterized in that: The performing a dot product operation on the first vector in the shooting direction and the second vector on the reference axis of the target virtual object includes: Convert the first vector from the camera coordinate system of the virtual camera to the world coordinate system of the virtual scene, and convert the second vector from the local coordinate system of the target virtual object to the world coordinate system; A dot product operation is performed on the first vector and the second vector in the world coordinate system.
5. The method according to claim 4, characterized in that Before performing a dot product operation on the first vector and the second vector in the world coordinate system, the method further includes: The reference axis of the target virtual object is rotated by a preset angle; the preset angle is a critical angle between two different reference display directions.
6. The method according to claim 1, characterized in that The plurality of display information includes a plurality of face patches, and the plurality of face patches are arranged in a texture map of the virtual object; The step of displaying the target virtual object in the virtual scene screen according to the display information corresponding to the target reference display direction includes: Sampling from the texture map and drawing the model vertices of the target virtual object; According to the target face among the multiple facets, the drawn model vertices corresponding to the target facet are retained, and the drawn model vertices corresponding to the non-target facets among the multiple facets are removed to obtain the target virtual object displayed in the virtual scene screen.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to a change in the position of the virtual camera, a target reference display direction is determined again from the multiple reference display directions according to a relationship between the changed shooting direction and the orientation of the target virtual object; If the target reference display direction changes, the target virtual object in the virtual scene screen is switched from a first display form to a second display form; the first display form is a display form determined based on the display information corresponding to the target reference display direction before the change, and the second display form is a display form determined based on the display information corresponding to the target reference display direction after the change.
8. A virtual object display processing device, characterized in that: Providing a graphical user interface through a terminal device, wherein the graphical user interface displays a virtual scene image, wherein the virtual scene image is an image formed by photographing the virtual scene through a virtual camera set in the virtual scene; The virtual scene includes a target virtual object; the device includes: a display direction processing module, configured to determine a target reference display direction from a plurality of reference display directions of the target virtual object according to an orientation relationship between the shooting direction of the virtual camera and the target virtual object when the target virtual object is within the shooting range of the virtual camera; wherein the target virtual object is configured with a plurality of display information, and the plurality of display information respectively corresponds to the plurality of reference display directions; The display information processing module is configured to display the target virtual object in the virtual scene screen according to the display information corresponding to the target reference display direction.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.