Data processing method and apparatus for virtual scene, electronic device, computer-readable storage medium, and computer program product
The method and apparatus for capturing three-dimensional virtual scene images address the limitations of two-dimensional capture by enabling omnidirectional and multi-viewing-angle snapshots, improving realism and interactivity.
Patent Information
- Application Number
- US19/737491
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Priority Date
- 2024-10-16
- Filing Date
- 2026-07-10
- Publication Date
- 2026-11-26
AI Technical Summary
Existing data processing methods for virtual scenes can only capture two-dimensional static images, lacking omnidirectional and multi-viewing-angle capabilities, which limits realism and interactivity, making it difficult to capture and share detailed three-dimensional information.
A method and apparatus for capturing a three-dimensional image of a virtual scene by displaying a viewfinder interface, clipping a target area between specific distance thresholds, and generating a three-dimensional image of the clipped area, allowing for omnidirectional and multi-viewing-angle snapshots.
Enables the capture and sharing of detailed three-dimensional images, enhancing realism and interactivity by providing users with a richer and more immersive visual experience.
Smart Images

Figure US20260378147A1-D00000_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application is a continuation application of PCT Patent Application No. PCT / CN2025 / 119819, entitled “DATA PROCESSING METHOD AND APPARATUS FOR VIRTUAL SCENE, ELECTRONIC DEVICE, COMPUTER-READABLE STORAGE MEDIUM, AND COMPUTER PROGRAM PRODUCT” filed on Sep. 8, 2025, which claims priority to Chinese Patent Application No. 2024114448322, entitled “DATA PROCESSING METHOD AND APPARATUS FOR VIRTUAL SCENE, ELECTRONIC DEVICE, COMPUTER-READABLE STORAGE MEDIUM, AND COMPUTER PROGRAM PRODUCT” filed on Oct. 16, 2024, both of which are incorporated herein by reference in their entirety.FIELD OF THE TECHNOLOGY
[0002] This application relates to data processing technologies, and in particular, to a data processing method and apparatus for a virtual scene, an electronic device, a computer-readable storage medium, and a computer program product.BACKGROUND OF THE DISCLOSURE
[0003] With the development of science and technology and the popularization of the Internet, capturing an image of a virtual scene has been widely applied in various fields such as gaming, film and television creation, and art design. When the virtual scene is captured, there is an ever-increasing demand of users for realism and interactivity. In the related art, only a two-dimensional static image of the virtual scene can be obtained in a two-dimensional capturing mode. However, the two-dimensional static image cannot capture all information of a three-dimensional scene, does not support omnidirectional observation on the three-dimensional scene, and cannot meet the users' demand for realism and interactivity, resulting in low quality of an output image for the virtual scene.SUMMARY
[0004] Embodiments of this application provide a data processing method and apparatus for a virtual scene, an electronic device, a computer-readable storage medium, and a computer program product, to generate omnidirectional and multi-viewing-angle snapshots of a specific area in a virtual scene, thereby improving quality of an output image for the virtual scene.
[0005] The technical solutions in the embodiments of this application are implemented as follows.
[0006] An embodiment of this application provides a method for capturing a three-dimensional image of a virtual scene performed by an electronic device. The method includes:
[0007] displaying a virtual scene;
[0008] displaying a viewfinder interface, the viewfinder interface comprising a target area including a plurality of virtual objects in the virtual scene;
[0009] in response to a capturing trigger operation for the viewfinder interface, clipping the target area through a virtual camera, the clipped area being an area whose distance to the virtual camera is between a first distance threshold and a second distance threshold in the target area, the first distance threshold being less than the second distance threshold, and the second distance threshold being less than a maximum camera-to-subject distance of the virtual camera; and
[0010] generating a three-dimensional image of the clipped area, wherein the three-dimensional image includes a subset of the plurality of virtual objects in the target area.
[0011] An embodiment of this application provides an electronic device. The electronic device includes:
[0012] a memory, configured to store computer-executable instructions or a computer program; and
[0013] a processor, configured to execute the computer-executable instructions or the computer program stored in the memory, to implement the method for capturing a three-dimensional image of a virtual scene provided in the embodiments of this application.
[0014] An embodiment of this application provides a non-transitory computer-readable storage medium, having a computer program or computer-executable instructions stored therein, the computer program or the computer-executable instructions being configured to implement, when executed by a processor of an electronic device, the method for capturing a three-dimensional image of a virtual scene provided in the embodiments of this application.
[0015] The embodiments of this application have the following beneficial effects.
[0016] In response to the viewfinder interface trigger operation in the virtual scene, the viewfinder interface of the virtual scene is displayed, and before capturing is performed, content (for example, information about a virtual object and another graphic element) of the virtual scene in the target area is intuitively displayed on the viewfinder interface, to adjust the target area. The viewfinder interface is captured to obtain the three-dimensional image including the target area, thereby improving quality of an output image for the virtual scene. In comparison with the related art in which only a two-dimensional image at a current viewing angle can be captured, the three-dimensional image provides a user with omnidirectional and multi-viewing-angle snapshots of the target area, to facilitate viewing of detailed information of the target area in the virtual scene, which can provide a richer and more interactive three-dimensional image capturing capability.BRIEF DESCRIPTION OF THE DRAWINGS
[0017] FIG. 1 is a schematic architectural diagram of a data processing system 100 for a virtual scene according to an embodiment of this application.
[0018] FIG. 2 is a schematic structural diagram of a terminal 400 according to an embodiment of this application.
[0019] FIG. 3A is a schematic flowchart 1 of a data processing method for a virtual scene according to an embodiment of this application.
[0020] FIG. 3B is a schematic flowchart 2 of a data processing method for a virtual scene according to an embodiment of this application.
[0021] FIG. 3C is a schematic flowchart 3 of a data processing method for a virtual scene according to an embodiment of this application.
[0022] FIG. 3D is a schematic flowchart 4 of a data processing method for a virtual scene according to an embodiment of this application.
[0023] FIG. 4A is a schematic diagram 1 of a virtual scene according to an embodiment of this application.
[0024] FIG. 4B is a schematic diagram 2 of a virtual scene according to an embodiment of this application.
[0025] FIG. 4C is a schematic diagram 3 of a virtual scene according to an embodiment of this application.
[0026] FIG. 4D is a schematic diagram 4 of a virtual scene according to an embodiment of this application.
[0027] FIG. 5 is a schematic diagram 5 of a virtual scene according to an embodiment of this application.
[0028] FIG. 6A is a schematic diagram 6 of a virtual scene according to an embodiment of this application.
[0029] FIG. 6B is a schematic diagram 7 of a virtual scene according to an embodiment of this application.
[0030] FIG. 6C is a schematic diagram 8 of a virtual scene according to an embodiment of this application.
[0031] FIG. 6D is a schematic diagram 9 of a virtual scene according to an embodiment of this application.
[0032] FIG. 6E is a schematic diagram 10 of a virtual scene according to an embodiment of this application.
[0033] FIG. 7A is a schematic diagram 11 of a virtual scene according to an embodiment of this application.
[0034] FIG. 7B is a schematic diagram 12 of a virtual scene according to an embodiment of this application.
[0035] FIG. 7C is a schematic diagram 13 of a virtual scene according to an embodiment of this application.
[0036] FIG. 8 is a schematic flowchart 5 of a data processing method for a virtual scene according to an embodiment of this application.
[0037] FIG. 9 is a schematic diagram of a camera-to-subject range according to an embodiment of this application.
[0038] The foregoing “first” and “second” are merely used to distinguish between different solutions, and do not represent quality of the solutions or priorities of the solutions in an implementation process.DESCRIPTION OF EMBODIMENTS
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following describes this application in further detail with reference to the accompanying drawings. The described embodiments are not to be considered as a limitation on this application. All other embodiments obtained by a person of ordinary skill in the art without creative efforts fall within the protection scope of this application.
[0040] In the following descriptions, the related term “some embodiments” describes subsets of all embodiments, but it may be understood that “some embodiments” may be the same subset or different subsets of all the embodiments, and can be combined with each other without conflict.
[0041] In the following descriptions, the related term “first / second / third” is merely intended to distinguish between similar objects rather than represent a specific sequence of the objects. It may be understood that the term “first / second / third” is interchangeable in a specific order or sequence if permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0042] In the embodiments of this application, the term “module” or “unit” refers to a computer program or a part of a computer program having a predetermined function, works together with other related parts to achieve a predetermined objective, and may be implemented entirely or partially by using software, hardware (for example, a processing circuit or a memory), or a combination thereof. Similarly, one processor (or a plurality of processors or memories) may be configured to implement one or more modules or units. In addition, each module or unit may be a part of an overall module or unit including a function of the module or unit.
[0043] Unless otherwise specified, “at least one” described below refers to one or more, and “a plurality of” may refer to two or more.
[0044] Unless otherwise defined, meanings of all technical and scientific terms used in the embodiments of this application are the same as those usually understood by a person skilled in the art. The terms used in the embodiments of this application are merely intended to describe the embodiments of this application, but are not intended to limit this application.
[0045] During application of the related data collection and processing in the embodiments of this application, informed consent or independent consent of the subject of personal information is to be obtained strictly based on requirements of relevant laws and regulations, and subsequent data use and processing behaviors are performed within the laws and regulations and the authorization scope of the subject of personal information.
[0046] Before the embodiments of this application are further described in detail, descriptions are made on terms involved in the embodiments of this application, and the terms involved in the embodiments of this application are applicable to the following explanations.
[0047] (1) In response to: The term “in response to” is configured for representing a condition or status on which one or more to-be-performed operations depend. When the condition or status is met, the one or more operations may be performed in real time or have a set delay. Unless otherwise specified, there is no sequence of execution between the plurality of to-be-performed operations.
[0048] (2) Human-computer interaction interface: The human-computer interaction interface is an interface configured to provide a human-computer interaction function. For example, a graphical user interface (GUI) is presented, which, for example, may be an augmented reality (AR) interface, a virtual reality (VR) interface, a voice user interface (VUI), an interactive projection interface (displaying information on a plane by using a projection technology), an eye movement detection interface (an interface controlled by detecting a line of sight of a user), a holographic interface (a three-dimensional holographic diagram formed by projecting an image using a holographic projection technology, and a three-dimensional image can be seen without wearing special glasses), a multi-modal interface (an interaction interface combining a plurality of interaction modes such as tactile, visual and auditory modes), and a brain-machine interface (BMI).
[0049] (3) Virtual scene: The virtual scene is a scene displayed (or provided) when an application is run on a terminal device. The scene may be a simulated environment of a real world, or may be a semi-simulated and semi-fictional virtual environment, or may be a completely fictional virtual environment. A user may control a virtual object to move in the virtual scene. For example, in a game scene, the virtual scene may be a scene of a game battle.
[0050] (4) Virtual object: The virtual object is an image of various people and objects that perform interaction in a virtual scene, or is a movable object in the virtual scene. The movable object may be a virtual person, a virtual animal, a virtual building, or the like. The virtual scene may include a plurality of virtual objects. Each virtual object has a shape and a volume of the virtual object in the virtual scene, and occupies a part of space in the virtual scene. For example, in a game scene, the virtual object may be a player character (PC) controlled by a user, or a non-player character (NPC) automatically generated by a game system.
[0051] First virtual object: The first virtual object is a virtual object that serves as a sharing party of a three-dimensional image during interaction among a plurality of virtual objects.
[0052] Second virtual object: The second virtual object is a virtual object that serves as a receiving party of a three-dimensional image during interaction among a plurality of virtual objects.
[0053] (5) Target area: The target area is an area within a maximum visual range of a virtual camera in a virtual scene, and a size of the target area depends on parameters such as a camera angle, a focal length, and a maximum camera-to-subject distance of the virtual camera. For example, the target area may include a virtual object, a virtual building, or virtual scenery in which a user is interested.
[0054] (6) Clipped area: The clipped area is an area located between a near clipping plane and a far clipping plane within a visual range of a virtual camera. The near clipping plane is a plane that is in a target area and whose distance to the virtual camera is located at a first distance threshold, and the far clipping plane is a plane that is in the target area and whose distance to the virtual camera is located at a second distance threshold. For example, the first distance threshold is 10 meters, and the second distance threshold is 80 meters.
[0055] (7) Display completeness: The display completeness is a ratio of a part of a virtual object displayed in a clipped area to a whole of the virtual object displayed in a virtual scene. For example, the display completeness may be a ratio of a displayed volume / occupied area of the virtual object in the clipped area to an entire volume / occupied area of the virtual object in the virtual scene.
[0056] (8) Three-dimensional image: The three-dimensional image refers to an image including depth information, and may represent a position, a shape, and a size of an object in a three-dimensional space. In the three-dimensional image, a virtual object has information about three dimensions, namely, a length, a width, and a height, so that the virtual object can be presented in a three-dimensional form, thereby providing more real and immersive visual experience.
[0057] (9) Two-dimensional image: The two-dimensional image refers to a planar image that contains only length and width information, with no depth or thickness. The two-dimensional image usually includes a pixel matrix, and each pixel has a color value and a luminance value thereof. The two-dimensional image lacks depth information, and cannot provide a three-dimensional effect in a three-dimensional space.
[0058] In the related art, only a two-dimensional static image of a virtual scene can be obtained in a two-dimensional capturing mode, and the two-dimensional static image can be shared to others. However, the following technical problems exist in the related art.
[0059] 1. In a capturing mode, only a two-dimensional static image at a current viewing angle can be captured, and a capability of omnidirectional and multi-viewing-angle observation on a virtual scene cannot be provided.
[0060] 2. Limited interactivity: A player cannot control an activity of a player character in the virtual scene of the two-dimensional static image, and therefore, it is difficult to deliver a deeply immersive experience. Moreover, a program sharing mechanism usually shares only the two-dimensional static image with another player, cannot provide further interaction space, and only remains at a visual appreciation level.
[0061] 3. During capturing, the user cannot subjectively select a virtual object in the virtual scene, resulting in poor user experience.
[0062] Based on the foregoing analysis, the applicant finds that a data processing method for a virtual scene in the related art cannot capture all information of a three-dimensional scene, does not support omnidirectional observation on the three-dimensional scene, and cannot meet people's demand for realism and interactivity.
[0063] In view of the foregoing problems, the embodiments of this application provide a data processing method and apparatus for a virtual scene, an electronic device, a computer-readable storage medium, and a computer program product, to generate omnidirectional and multi-viewing-angle snapshots of a specific area in a virtual scene. An exemplary application of the electronic device provided in the embodiments of this application is described below. The electronic device provided in the embodiments of this application may be implemented as a notebook computer, a tablet computer, a desktop computer, a set top box, a smartphone, a smart speaker, a smartwatch, a smart television, an in-vehicle terminal, among various other types of terminals, or may be implemented as a server. An exemplary application of the device being implemented as a terminal is described below.
[0064] FIG. 1 is a schematic architectural diagram of a data processing system 100 for a virtual scene according to an embodiment of this application. To implement a data processing application supporting a virtual scene, a terminal 400 (a terminal 400-1 and a terminal 400-2 are exemplarily shown) is connected to a server 200 through a network 300. The network 300 may be a wide area network, a local area network, or a combination thereof.
[0065] The terminal 400 is configured to: display the virtual scene on a human-computer interaction interface 411-1 of the terminal 400-1, and display a viewfinder interface when a viewfinder interface trigger operation for the virtual scene is received, the viewfinder interface including a target area in the virtual scene; and display, when a capturing trigger operation for the viewfinder interface is received, a three-dimensional image including the target area.
[0066] Using a game scene as an example, the terminal 400 is configured to: display the virtual scene on a human-computer interaction interface 411-1 of a terminal 400-1 controlled by a first player character, and display a viewfinder interface when a viewfinder interface trigger operation performed by the first player character for the virtual scene is received, the viewfinder interface including a target area in the virtual scene; and display, when a capturing trigger operation performed by the first player character for the viewfinder interface is received, a three-dimensional image including the target area. In response to a sharing operation performed by the first player character for the three-dimensional image, the three-dimensional image is shared with a terminal 400-2 controlled by a second player character, to display the three-dimensional image in a virtual scene on a human-computer interaction interface 411-2 of the terminal 400-2. In addition, the second player character controlling the terminal 400-2 may be allowed to perform interaction with the first player character in a three-dimensional scene corresponding to the three-dimensional image.
[0067] FIG. 2 is a schematic structural diagram of a terminal 400 according to an embodiment of this application. The terminal 400 shown in FIG. 2 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The components in the terminal 400 are coupled together through a bus system 440. It may be understood that the bus system 440 is configured to implement connection and communication between the components. In addition to a data bus, the bus system 440 further includes a power bus, a control bus, and a state signal bus. However, for ease of clear description, various types of buses in FIG. 2 are marked as the bus system 440.
[0068] The processor 410 may be an integrated circuit chip having a signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor may be a microprocessor, any conventional processor, or the like.
[0069] The user interface 430 includes one or more output apparatuses 431 that enable the presentation of media content, including at least one of the following: one or more speakers, or one or more visual display screens. The user interface 430 further includes one or more input apparatuses 432, including a user interface part that facilitates user input, for example, a keyboard, a mouse, a microphone, a touchscreen display, a camera, or another input button or control.
[0070] The memory 450 may be a removable memory, an irremovable memory, or a combination thereof. An exemplary hardware device includes a solid memory, a hard disk drive, an optical disk drive, and the like. In some embodiments, the memory 450 includes one or more storage devices physically located away from the processor 410.
[0071] The memory 450 includes a volatile memory or a non-volatile memory, or may include a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in this embodiment of this application aims to include a memory of any suitable type.
[0072] In some embodiments, the memory 450 can store data to support various operations. Examples of the data include a program, a module, a data structure, or a subset or superset thereof, and are exemplarily described below.
[0073] An operating system 451 includes system programs configured for processing various basic system services and performing hardware-related tasks, for example, a framework layer, a kernel library layer, and a driver layer, and is configured to implement various basic services and process hardware-based tasks.
[0074] A network communication module 452 is configured to reach another electronic device through one or more (wired or wireless) network interfaces 420. For example, the network interface 420 includes: Bluetooth, wireless fidelity (Wi-Fi), or a universal serial bus (USB).
[0075] A presentation module 453 is configured to present information through one or more output apparatuses 431 (for example, a display screen or a speaker) associated with the user interface 430 (for example, a user interface for operating a peripheral device and displaying content and information).
[0076] An input processing module 454 is configured to detect one or more user inputs or interactions from one of the one or more input apparatuses 432 and translate the detected inputs or interactions.
[0077] In some embodiments, the apparatus provided in this embodiment of this application may be implemented by using software. FIG. 2 shows a data processing apparatus 455 for a virtual scene that is stored in the memory 450. The apparatus 455 may be software in a form of a program, a plug-in, and the like, and includes the following software modules: a scene display module 4551, an interface display module 4552, and an image display module 4553. These modules are logical, and therefore may be subject to any suitable combination or further split based on implemented functions. The functions of the modules are described below.
[0078] In some embodiments, the terminal or the server may implement the data processing method for a virtual scene provided in the embodiments of this application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions may be a microprogram-level command, a machine instruction, or a software instruction. The computer program may be a native program or a software module in an operating system; may be a native application (APP), namely, a program that needs to be installed in an operating system to run, such as a game APP; or may be a mini program that may be embedded in any APP, namely, a program that only needs to be downloaded into a browser environment to run. To sum up, the foregoing computer-executable instructions may be instructions in any form, and the foregoing computer program may be an application, a module, or a plug-in in any form.
[0079] The following describes the data processing method for a virtual scene provided in the embodiments of this application with reference to an exemplary application and implementation of the terminal provided in this embodiment of this application.
[0080] FIG. 3A is a schematic flowchart 1 of a data processing method for a virtual scene according to an embodiment of this application. An example in which the method is performed by the terminal is used, and descriptions are made with reference to operations shown in FIG. 3A.
[0081] Operation 101: Display a virtual scene.
[0082] In some embodiments, the virtual scene may be displayed on a human-computer interaction interface of the terminal. A first virtual scene may be an environment displayed on the human-computer interaction interface of the terminal, for a first virtual object to perform interaction with another virtual object. For example, the first virtual scene may be a virtual city, a virtual social space, or a virtual scene in any other form. The virtual scene includes a plurality of virtual objects, and the virtual object may be a virtual person, a virtual animal, a virtual building, or the like. The virtual scene may include the plurality of virtual objects. Each virtual object has a shape and a volume of the virtual object in the virtual scene, and occupies a part of space in the virtual scene. For example, in a game scene, the virtual object may be a player character controlled by a user, or a non-player character automatically generated by a game system, or may be a building, a plant, a virtual item, or the like.
[0083] Operation 102: Display a viewfinder interface in response to a viewfinder interface trigger operation for the virtual scene, the viewfinder interface including a target area in the virtual scene.
[0084] The target area is at least a part of areas of the virtual scene, and is used as a capturing preview area. For example, the target area may be all the areas of the virtual scene, or may be a part of the areas of the virtual scene.
[0085] In some embodiments, operation 102 may be implemented by performing the following processing: displaying the viewfinder interface in response to receiving speech information for viewfinding of the virtual scene.
[0086] A speech instruction of the user may be received through a microphone or another audio input device. Then, speech recognition is performed on the received speech instruction, a received speech signal is converted into text information, or an instruction intent of the user is directly recognized, for example, a part of the virtual scene that the user intends to view, and a viewing angle desired by the user are recognized. Finally, display of the viewfinder interface is triggered based on the recognized instruction intent.
[0087] In some other embodiments, operation 102 may be implemented by performing the following processing: displaying the viewfinder interface in response to receiving somatosensory information for viewfinding of the virtual scene.
[0088] An action performed by the user on a corresponding device may be first received in a manner in which the user wears a somatosensory device (such as smart glasses, somatosensory gloves, a virtual reality (VR) headset, or a motion sensor) or the user uses a device with a built-in somatosensory function (such as a smartphone or a tablet computer). Second, body movement and posture information of the user are captured through sensors such as an accelerometer, a gyroscope, and a camera of the device. Then, collected somatosensory data is transmitted to the terminal device (such as a smartphone, a computer, or a game console) through Bluetooth, Wi-Fi, or USB, or in another wireless or wired communication manner. Finally, software or an application on the terminal device is used to receive and parse the somatosensory data, including identifying a specific gesture, posture, or movement trajectory, and identifying an action intent of the user.
[0089] In an example, in response to an upward waving gesture of the user, the viewfinder interface of the current virtual scene is zoomed in; in response to a downward waving gesture of the user, the viewfinder interface of the current virtual scene is zoomed out; in response to a leftward waving gesture of the user, a view of the viewfinder interface of the current virtual scene is rotated clockwise; and in response to a rightward waving gesture of the user, the view of the viewfinder interface of the current virtual scene is rotated anticlockwise.
[0090] In some other embodiments, operation 102 may be implemented by performing the following processing: displaying the viewfinder interface in response to a trigger operation for a capturing entrance in the virtual scene.
[0091] When the virtual scene is displayed, the capturing entrance in the virtual scene is displayed, and the viewfinder interface is displayed in response to the trigger operation for the capturing entrance.
[0092] In an example, FIG. 4A is a schematic diagram 1 of a virtual scene according to an embodiment of this application, and FIG. 4B is a schematic diagram 2 of a virtual scene according to an embodiment of this application. As shown in FIG. 4A, FIG. 4A shows a first virtual object 401, a capturing entrance 402, a direction control 403, and a skill control 404. In response to a trigger operation for the capturing entrance 402, a capturing mode is entered, and a viewfinder interface shown in FIG. 4B is displayed.
[0093] This embodiment of this application provides a plurality of different trigger manners for the viewfinder interface trigger operation. For example, the viewfinder interface is displayed based on the received speech information, the received somatosensory information, or the received trigger operation for the capturing entrance. The plurality of trigger manners provide more interaction options, so that the user can select the most comfortable and most convenient operation manner based on a preference and a use scenario of the user. For example, speech and somatosensory control may provide a more user-friendly operation experience for persons with disabilities or users with mobility impairment. Different trigger manners simplify an interaction process between the user and the device, causing a more intuitive and simple operation. For example, the speech command allows the user to perform an operation without touching the device, and the somatosensory control allows the user to trigger the viewfinder interface through a natural action. Different trigger manners may be adjusted based on different use scenarios. For example, speech control may be more preferred in a noisy environment, and a touch operation may be more preferred in a quiet environment. A technical combination of the plurality of trigger manners can support broader technical inclusion, so that users with different technical proficiencies and capability levels can use the product. Different trigger manners may be optimized based on personal habits and work processes of the user, thereby improving operation efficiency. For example, for a user accustomed to speech interaction, speech triggering can significantly save time. In conclusion, providing a plurality of viewfinder interface trigger operation manners can comprehensively improve user experience, drive technological innovation, and expand the influence of the product.
[0094] In some embodiments, when the “displaying a viewfinder interface” in operation 102 is performed, a graphic element unrelated to capturing in the virtual scene is hidden. The graphic element includes at least one of the following: an operation control, a quest bar control, and a message bar.
[0095] A manner of hiding the graphic element unrelated to capturing in the virtual scene may be any one of the following: Manner 1: When the viewfinder interface is displayed, the graphic element unrelated to capturing in the virtual scene is automatically hidden. Manner 2: In response to a trigger operation for a unified hiding control, all the graphic elements unrelated to capturing in the virtual scene are hidden. Manner 3: The graphic elements unrelated to capturing in the virtual scene are classified, each category of graphic element is provided with a category hiding control, and a corresponding graphic element is hidden in response to a trigger operation for a category hiding control.
[0096] In an example of Manner 1, in response to the trigger operation for the capturing entrance 402, the capturing mode is entered, and when the viewfinder interface shown in FIG. 4B is displayed, operation controls, that is, the direction control 403 and the skill control 404, in FIG. 4A are automatically hidden in the viewfinder interface shown in FIG. 4B, and are not displayed.
[0097] In an example of Manner 2, FIG. 4C is a schematic diagram 3 of a virtual scene according to an embodiment of this application. As shown in FIG. 4C, a first virtual object 501, a capturing entrance 502, a direction control 503, a skill control 504, a quest bar control 511, a message bar 512, and a hiding control 513 are shown in an upper portion of FIG. 4C. The direction control 503 and the skill control 504 are operation controls. In response to a selection operation for the hiding control 513, and in response to a trigger operation for the capturing entrance 502, a capturing mode is entered, and a viewfinder interface shown in a lower portion of FIG. 4C is displayed. The quest bar control 511, the message bar 512, the direction control 503, and the skill control 504 displayed in the upper portion of FIG. 4C are hidden in the lower portion of FIG. 4C.
[0098] In an example of Manner 3, FIG. 4D is a schematic diagram 4 of a virtual scene according to an embodiment of this application. As shown in FIG. 4D, a first virtual object 501, a capturing entrance 502, a direction control 503, a skill control 504, a quest bar control 511, a message bar 512, and a category hiding component 514 are shown in an upper portion of FIG. 4D. The direction control 503 and the skill control 504 are operation controls, and the category hiding component 514 includes a hiding operation control, a hiding quest bar control, and a hiding message bar. In response to a selection operation for the hiding quest bar control and the hiding message bar in the category hiding component 514, and in response to a trigger operation for the capturing entrance 502, a capturing mode is entered, and a viewfinder interface shown in a lower portion of FIG. 4D is displayed. The quest bar control 511 and the message bar 512 displayed in the upper portion of FIG. 4D are hidden in the lower portion of FIG. 4D.
[0099] In some embodiments, when the “displaying a viewfinder interface” in operation 102 is performed, all the graphic elements in the virtual scene may alternatively be reserved. For example, in the foregoing example, the capturing mode is entered in response to the trigger operation for the capturing entrance, and the operation control, the quest bar control, and the message bar are simultaneously displayed on the displayed viewfinder interface.
[0100] In this embodiment of this application, when the viewfinder interface is displayed, the graphic element unrelated to capturing in the virtual scene can be hidden in different manners, or all the graphic elements in the virtual scene can be reserved, so that the viewfinder interface can be differently displayed based on different requirements of users, and the graphic element can be flexibly hidden or displayed on the viewfinder interface, to adapt to different capturing and presentation requirements.
[0101] In some embodiments, the viewfinder interface is in a three-dimensional capturing mode by default. When the viewfinder interface is in the three-dimensional capturing mode, the following processing may be performed: switching the three-dimensional capturing mode to a two-dimensional capturing mode in response to a switching operation for a capturing mode control, the two-dimensional capturing mode being configured for capturing a two-dimensional image including the target area.
[0102] FIG. 4B shows a capturing mode control 405 according to some embodiments. The capturing mode control 405 supports mode switching of the two-dimensional capturing mode and the three-dimensional capturing mode. An image captured in the two-dimensional capturing mode is a two-dimensional static image, and an image captured in the three-dimensional capturing mode is a three-dimensional image. When the three-dimensional capturing mode is a default mode, the three-dimensional capturing mode may be switched to the two-dimensional capturing mode in response to a trigger operation for the two-dimensional capturing mode in the capturing mode control 405.
[0103] When the viewfinder interface is in the three-dimensional capturing mode, the three-dimensional capturing mode may alternatively be switched to the two-dimensional capturing mode in a manner of speech control. For example, a speech instruction of the user may be received through a microphone or another audio input device. Then, speech recognition is performed on the received speech instruction, a received speech signal is converted into text information for a switching mode, and the three-dimensional capturing mode is switched to the two-dimensional capturing mode.
[0104] In this embodiment of this application, switching between the two-dimensional capturing mode and the three-dimensional capturing mode is supported. The two-dimensional capturing mode is applicable to simple plane capturing, and the three-dimensional capturing mode is applicable to a scene that requires depth information and a three-dimensional effect, thereby enhancing adaptability of the device, and allowing the user to select a suitable capturing mode based on a requirement, for example, performing two-dimensional capturing of a plane or three-dimensional capturing with depth information, which meets different capturing requirements.
[0105] In some embodiments, the viewfinder interface includes a viewfinder box and a focusing box, where the viewfinder box includes the target area in the virtual scene, and the focusing box is configured for representing a focusing area when capturing is performed on the target area.
[0106] The viewfinder box is a defined “visual range boundary” in the virtual scene, and a core function is to clearly define a target area covered by a current capturing operation for the user. In different virtual scene applications, settings of a form and a range of the viewfinder box can be flexibly adjusted based on a functional requirement. For example, in a virtual photography application, the viewfinder box may simulate an aspect ratio (for example, 4:3 or 16:9) of a real camera, and clearly select virtual scene content to be included in a final image, to prevent the captured content from deviating from user expectations due to an ambiguous visual range; and in a virtual interactive game, the viewfinder box may be bound to a quest target. The user can trigger a subsequent capturing, collection, or interaction instruction only when a virtual character, an item, or a specific scene element is located in the target area of the viewfinder box, to ensure pertinence and effectiveness of an operation. In addition, the viewfinder box may further be visually differentiated (for example, by highlighted frames and translucent masks) to draw a clear boundary from other areas of the virtual scene, to cause the user to be intuitively aware of a valid range of a current operation, and reduce operational errors.
[0107] As a key element for assisting the viewfinder box in achieving precise operation, a core value of the focusing box lies in positioning the focusing area within the target area, to resolve a problem of “which specific point is to be subjected to precise capturing in a large target area”. In capturing logic of the virtual scene, even though the target area is determined through the viewfinder box, if guidance of the focusing box is lacked, problems such as overall image blurring and unclear presentation of key details may occur. For example, in a virtual cultural relic capturing scenario, the viewfinder box selects the entire cultural relic (the target area), but the user needs to prominently present textures or inscriptions on a surface of the cultural relic. In this case, the focusing box acts on a local area in which the textures or inscriptions are located, to ensure that key information is highlighted in a captured result. In addition, the focusing box has interactivity, so that the user can adjust a position of the focusing box in the target area through an operation such as clicking / tapping or dragging, to flexibly adapt to different capturing requirements, thereby further improving flexibility and precision of an operation.
[0108] In this embodiment of this application, the viewfinder box and the focusing box jointly form a dual positioning system for photographing a virtual scene. The viewfinder box is responsible for “macroscopically defining”, to clearly define an entire boundary of a capturing operation, to avoid interference of irrelevant scene elements. The focusing box is responsible for “microscopically precise positioning”, and locks a key area in a macroscopic range, to ensure detailed quality of a captured result. Such design logic of “defining a range and then defining a focus” conforms to an intuitive operation habit of the user, and can effectively balance a requirement of “range coverage” and “precise details” in virtual scene capturing, which can provide clear and efficient operation guidance for the user, thereby improving overall use experience.
[0109] In an example, a viewfinder box 407 and a focusing box 408 are displayed on the viewfinder interface in FIG. 4B. The viewfinder box 407 includes the target area in the virtual scene, and the focusing box 408 is configured for representing the focusing area when capturing is performed in the target area.
[0110] In some embodiments, after the viewfinder interface is displayed, at least one of the following processing may be performed: rotating, in response to a rotation operation in the viewfinder box in a first direction, a viewing angle of the virtual camera in the viewfinder box in the first direction; moving, in response to a translation operation in the viewfinder box in a second direction, a target area of the virtual camera in the viewfinder box in the second direction; adjusting a capturing focal length of the virtual camera in response to a focal length adjustment operation for the viewfinder box; or adjusting a capturing focal length of the virtual camera in response to an adjustment operation for a focal length adjustment control in the viewfinder box.
[0111] The rotation operation in the viewfinder box in the first direction may be a rotation operation in any direction, and a manner of the rotation operation may be a single-finger drag operation. For example, a rotation operation of 10 degrees may be performed in a clockwise direction, that is, the viewing angle of the current virtual camera is rotated by 10 degrees in the clockwise direction. Alternatively, a rotation operation of 20 degrees may be performed in an anticlockwise direction, that is, the viewing angle of the current virtual camera is rotated by 20 degrees in the anticlockwise direction.
[0112] The translation operation in the viewfinder box in the second direction may be a translation operation in any direction, and a manner of the translation operation may be a two-finger slide operation. For example, the target area of the current virtual camera may be translated leftward in response to a leftward slide operation of the two fingers in the viewfinder box.
[0113] The focal length adjustment operation for the viewfinder box may be increasing a capturing focal length of the virtual camera through a gesture spreading operation, or may be reducing a capturing focal length of the virtual camera through a gesture pinching operation. Alternatively, in response to a slide operation for a slide bar of the focal length adjustment control in the viewfinder box, the capturing focal length of the virtual camera is increased or reduced based on a direction of the slide operation. For example, in response to a downward slide operation for the slide bar of the focal length adjustment control, the capturing focal length of the virtual camera is reduced; and in response to an upward slide operation for the slide bar of the focal length adjustment control, the capturing focal length of the virtual camera is increased.
[0114] FIG. 4B shows a focal length adjustment control 409 according to some embodiments. In response to an upward slide operation for a slide bar of the focal length adjustment control 409, the capturing focal length of the virtual camera may be increased, and in response to a downward slide operation for the slide bar of the focal length adjustment control 409, the capturing focal length of the virtual camera may be reduced.
[0115] In some embodiments, the virtual camera may further be controlled in response to a setting operation for an adjustment menu on the viewfinder interface.
[0116] In an example, FIG. 5 is a schematic diagram 5 of a virtual scene according to an embodiment of this application. As shown in FIG. 5, a field of view, a rotation viewing angle, whether to hide a player, face painting, a facial expression, a body action, and the like may be set.
[0117] The field of view refers to a scene range that can be seen by a virtual object in the virtual scene. A higher value of the field of view indicates more scene elements that can be simultaneously presented in an image; and a lower value of the field of view indicates that the field of view is more focused on a front area, and the image is closer to the realism of “first-person close-range observation”, but obtaining of surrounding environment information may be reduced. A unit of the field of view may be a meter, for example, may be 60 meters, which indicates that the virtual object can see a scene with a radius of 60 meters, centered on the virtual object.
[0118] The rotation viewing angle refers to a change angle of a line of sight of the virtual object in the virtual scene, is an operation setting that controls an observation direction of the virtual object, and determines a specific location in a virtual world that can be seen by the virtual object. A unit of the rotation viewing angle may be a degree. If the player hiding is in an on state, the virtual object in the virtual scene is visually in an invisible state; or if the player hiding is in an off state, the virtual object in the virtual scene is visually in a visible state.
[0119] The face painting is a setting of adding a visual effect such as a pattern, a texture, and a color to a face of the virtual object. The face painting may be in various forms, which, for example, may be a preset fixed pattern (such as a tribal totem, a skull texture, or a cartoon sticker).
[0120] The facial expression is a facial expression of the virtual object in the virtual scene, and is an interaction function for presenting emotional states such as joy, anger, sadness, and pleasure, which, for example, may be happiness, anger, and surprise. The body action is a body posture action of the virtual object in the virtual scene, which, for example, may be an action performance covering scenarios such as standing, walking, and interaction.
[0121] In this embodiment of this application, before capturing, the viewing angle, the capturing area, and the focal length of the virtual camera are adjusted through a plurality of adjustment operations, so that the user can directly control the viewing angle, the target area, and the capturing focal length of the virtual camera through intuitive operations, thereby enhancing interactivity between the user and the virtual scene. Through the rotation and translation operations, the user can easily observe the virtual scene from different angles and positions, to obtain a more flexible viewing angle. A focal length adjustment solution is provided, so that the user can adjust the depth of field and the field of view based on a requirement, to obtain an optimal capturing effect. In conclusion, controlling a function of the virtual camera in response to an operation in the viewfinder box can provide a powerful interaction tool for the user, thereby enhancing user experience.
[0122] Operation 103: Display, in response to a capturing trigger operation for the viewfinder interface, a three-dimensional image including the target area.
[0123] In some embodiments, in response to the capturing trigger operation for the viewfinder interface, the target area is captured, and the three-dimensional image including the target area is displayed.
[0124] In some embodiments, operation 103 may be implemented in the following manner: when the target area includes a plurality of virtual objects, capturing, in response to the capturing trigger operation for the viewfinder interface, a clipped area in the target area through the virtual camera, and displaying a captured three-dimensional image, the clipped area being an area in the target area whose distance to the virtual camera is located between a first distance threshold (forming a first clipping plane) and a second distance threshold (forming a second clipping plane), the first distance threshold being less than the second distance threshold, and the second distance threshold being less than a maximum camera-to-subject distance of the virtual camera. For example, the maximum camera-to-subject distance of the virtual camera is 100 meters, the first distance threshold is 10 meters, and the second distance threshold is 80 meters.
[0125] The first distance threshold and the second distance threshold may be determined in any one of the following manners:
[0126] Manner 1: Determine the first distance threshold and the second distance threshold based on hardware performance and a performance optimization requirement. Because a device having strong hardware performance can process a more complex scene and more rendered content, the second distance threshold may be properly increased to present a broader scene. However, for a device having limited hardware performance, to avoid problems such as lag and frame drop, the second distance threshold needs to be reduced, and a quantity of rendered objects needs to be reduced. In addition, a smaller first distance threshold may reduce unnecessary rendering of details nearby, and further optimize performance. For example, if the electronic device is a mobile phone, because hardware performance of the mobile phone is weaker, the first distance threshold may be set to 5 meters, and the second distance threshold may be set to 50 meters.
[0127] Manner 2: Determine the first distance threshold and the second distance threshold based on a game type and a gameplay feature. Different types of games have different requirements on a field of view and a clipped area. For example, when a surrounding virtual environment needs to be quickly observed, the first distance threshold may be set to be smaller, for example, 5 meters, to see objects nearby more clearly; and the second distance threshold may be set to be larger, for example, 100 meters, to ensure that enemies far away can be found in time. However, in a simulated management game, a player pays more attention to overall layout and building details. The first distance threshold may be set to 10 meters, and the second distance threshold may be set to 150 meters, so that it is convenient for the player to view a situation of an entire base.
[0128] Manner 3: Determine the first distance threshold and the second distance threshold based on an operation habit and visual experience of a player. Different players have different operation habits and visual preferences. Some players prefer a broader field of view, to learn a surrounding environment in advance. For this type of players, the second distance threshold may be properly increased. However, some players pay more attention to details, and like to observe an object at a short distance. In this case, the first distance threshold may be set to be smaller.
[0129] Manner 4: Determine the first distance threshold and the second distance threshold based on a scale and complexity of a virtual scene. If a game scene is large-scale and complex, and includes a large quantity of elements such as a building, vegetation, and landform, to ensure that the entire virtual scene can be completely presented in the field of view of the player, a larger second distance threshold needs to be set. In addition, to highlight a key area and avoid unnecessary rendering, the first distance threshold also needs to be adjusted based on a specific situation of the virtual scene. For example, in a large-scale open-world game, there are vast mountains, forests, and cities in a scene. The second distance threshold may be set to 500 meters, and the first distance threshold may be set to 20 meters.
[0130] In an example, FIG. 9 is a schematic diagram of a camera-to-subject range according to an embodiment of this application. FIG. 9 shows a maximum camera-to-subject distance, a near clipping plane, and a far clipping plane of a virtual camera 901. An area between the near clipping plane and the far clipping plane is a clipped area 902.
[0131] In some embodiments, the “capturing a clipped area in the target area through the virtual camera” may be implemented by performing the following processing: capturing all the virtual objects displayed in the clipped area through the virtual camera; or capturing, in the clipped area, a virtual object having a display completeness greater than a completeness threshold, the display completeness being a ratio of a part of the virtual object displayed in the clipped area to a part of the virtual object displayed in the virtual scene.
[0132] In an example, a virtual object 903, a virtual object 904, and a virtual object 905 are shown within a range of the clipped area 902. Because the virtual object 903 is not in a field of view of the virtual camera 901, the virtual object 903 cannot be captured. Because a volume of the virtual object 904 displayed in the field of view of the virtual camera 901 exceeds a half of a volume of the virtual object 904, the virtual object 904 is used as a target virtual object. Because a volume of the virtual object 905 displayed in the field of view of the virtual camera 901 does not exceed a half of a volume of the virtual object 905, the virtual object 905 cannot be captured.
[0133] In this embodiment of this application, the clipped area in the target area is determined based on the maximum camera-to-subject distance, the near clipping plane, and the far clipping plane of the virtual camera. A virtual object not in a maximum visible range may be clipped, which reduces a rendering calculation amount, thereby improving rendering performance and reducing a delay. A to-be-captured target virtual object is determined based on the display completeness of the virtual object in the clipped area, and priority processing may be performed on the virtual object in the clipped area based on the display completeness, causing a smoother and more realistic rendering effect. In addition, calculation resources, storage space, and power consumption can be saved, and overall resource utilization of the device can be improved.
[0134] In some embodiments, the target area is captured by the virtual camera. FIG. 3B is a schematic flowchart 2 of a data processing method for a virtual scene according to an embodiment of this application. Operation 103 in FIG. 3A may be implemented through operation 1031 to operation 1033 in FIG. 3B, which are described below in detail.
[0135] Operation 1031: Display, in the target area, a plurality of virtual objects whose distances to the virtual camera are less than the maximum camera-to-subject distance of the virtual camera.
[0136] In an example, FIG. 6A is a schematic diagram 6 of a virtual scene according to an embodiment of this application. A plurality of virtual objects whose distances to a virtual camera 601 are less than a maximum camera-to-subject distance of the virtual camera are displayed in a target area shown in FIG. 6A, which are a first virtual object 602, a second virtual object 603, a third virtual object 604, and a fourth virtual object 605.
[0137] Operation 1032: Use a selected virtual object as a target virtual object in response to a selection operation for the plurality of virtual objects.
[0138] In some embodiments, operation 1032 may be implemented in any one of the following manners:
[0139] Manner 1: All the virtual objects are in an unselected state by default, a selection box is displayed within each virtual object, and a selected virtual object is used as the target virtual object in response to a trigger operation for a selection box of the virtual object.
[0140] In an example, FIG. 6B is a schematic diagram 7 of a virtual scene according to an embodiment of this application. Four virtual objects whose distances to the virtual camera 601 are less than the maximum camera-to-subject distance of the virtual camera are displayed in a target area shown on a left side of FIG. 6B, which are the first virtual object 602, the second virtual object 603, the third virtual object 604, and the fourth virtual object 605. The four virtual objects are in an unselected state, and a corresponding selection box is displayed at a top-right corner of each virtual object. In response to a selection operation for the selection boxes of the second virtual object 603 and the third virtual object 604 on the left side of FIG. 6B, contour lines of the second virtual object 603 and the third virtual object 604 are displayed in bold, that is, the second virtual object 603 and the third virtual object 604 are used as the target virtual objects.
[0141] Manner 2: All the virtual objects are in a selected state by default, a deletion control is displayed within each virtual object, and a selected virtual object is used as the target virtual object in response to a trigger operation for a deletion control of the virtual object.
[0142] In an example, FIG. 6C is a schematic diagram 8 of a virtual scene according to an embodiment of this application. Four virtual objects whose distances to the virtual camera 601 are less than the maximum camera-to-subject distance of the virtual camera are displayed in a target area shown on a left side of FIG. 6C, which are the first virtual object 602, the second virtual object 603, the third virtual object 604, and the fourth virtual object 605. The four virtual objects are in a selected state, that is, contour lines of the four virtual objects are displayed in bold. In addition, a corresponding deletion control is displayed at a top-right corner of each virtual object. In response to a clicking / tapping operation for the deletion controls of the first virtual object 602 and the third virtual object 604 on the left side of FIG. 6C, contour lines of the first virtual object 602 and the third virtual object 604 are displayed without bolding, that is, the second virtual object 603 and the fourth virtual object 605 are used as the target virtual objects.
[0143] Manner 3: All the virtual objects are in a selected state by default, and in response to an interaction operation in a specific direction, it indicates that a state of a corresponding virtual object is switched to an unselected state, and a virtual object still in the selected state is used as the target virtual object.
[0144] In an example, FIG. 6D is a schematic diagram 9 of a virtual scene according to an embodiment of this application. Four virtual objects whose distances to the virtual camera 601 are less than the maximum camera-to-subject distance of the virtual camera are displayed in a target area shown on a left side of FIG. 6D, which are the first virtual object 602, the second virtual object 603, the third virtual object 604, and the fourth virtual object 605. The four virtual objects are in a selected state, that is, contour lines of the four virtual objects are displayed in bold. In response to a slide operation in an upward direction at a dividing line L in the target area on the left side of FIG. 6C, a state of a virtual object located above the dividing line L upward is switched to an unselected state, that is, the states of the second virtual object 603, the third virtual object 604, and the fourth virtual object 605 are switched to the unselected state. In other words, contour lines of the second virtual object 603, the third virtual object 604, and the fourth virtual object 605 are displayed without bolding, and the first virtual object 602 is used as the target virtual object.
[0145] In some other embodiments, the viewfinder interface includes a plurality of type controls, and each of the type controls is configured to be associated with a type of the virtual objects. Operation 1032 may further be implemented in the following manner: setting, in response to a trigger operation for any type control, a virtual object associated with the any type control to be in a selected state, and using the virtual object associated with the any type control as the target virtual object.
[0146] The type of the virtual object may be a player character or a non-player character, a building, or an item. The trigger operation for any type control may be a trigger operation for one type control, or may be a trigger operation for a plurality of type controls. The setting a virtual object associated with the any type control to be in a selected state may be applying different display parameters to the virtual object in the selected state and the virtual object in the unselected state. For example, colors of surrounding boxes of the virtual object in the selected state and the virtual object in the unselected state are different, thicknesses of lines are different, or levels of transparency of the virtual objects are different.
[0147] In an example, the types of the virtual objects in the target area include a player character, a non-player character, and a building. Virtual objects of the player character and the non-player character are set to be in a selected state in response to trigger operations for type controls associated with the player character and the non-player character.
[0148] In this embodiment of this application, a trigger design of the type control is set, so that the user can directly select virtual objects of a target type in batches by clicking / tapping the type control once or a plurality of times, and does not need to position the virtual objects one by one in a complex virtual scene. For example, in a multi-person battle scene, the user may quickly select all virtual buildings by clicking / tapping a type control of the virtual building, thereby avoiding repeated searching under interference of a virtual person or item, significantly shortening an operation path, and improving selection efficiency.
[0149] In some other embodiments, the viewfinder interface includes a distance control, where the distance control is configured to set a camera-to-subject distance range of the virtual camera. Operation 1032 may further be implemented in the following manner: displaying, in response to a setting operation for the distance control, a distance range set through the setting operation, a minimum distance of the distance range being a minimum camera-to-subject distance of the virtual camera, and a maximum distance of the distance range being a maximum camera-to-subject distance of the virtual camera; and using a virtual object within the distance range as the target virtual object.
[0150] In an example, FIG. 6E is a schematic diagram 10 of a virtual scene according to an embodiment of this application. Four virtual objects whose distances to the virtual camera 601 are less than the maximum camera-to-subject distance (for example, 100 meters) of the virtual camera are displayed in a target area shown on a left side of FIG. 6E, which are the first virtual object 602, the second virtual object 603, the third virtual object 604, and the fourth virtual object 605. The four virtual objects are in an unselected state. In response to the distance control 606 on the left side of FIG. 6E being set to 50 meters, the state of the first virtual object 602 is switched to a selected state on an interface on a right side of FIG. 6E, that is, the first virtual object 602 is used as the target virtual object.
[0151] In some other embodiments, FIG. 3C is a schematic flowchart 3 of a data processing method for a virtual scene according to an embodiment of this application. Operation 1032 in FIG. 3B may further be implemented through operation 10321 and operation 10322 in FIG. 3C, which are described below in detail.
[0152] Operation 10321: Invoke a pre-trained machine learning model to separately predict capturing intents for the plurality of virtual objects, to obtain a probability that each of the virtual objects conforms to the capturing intent, the machine learning model being obtained by training based on a virtual scene sample, the virtual scene sample including a plurality of virtual object samples and labels, and the label representing a probability that each of the virtual object samples conforms to the capturing intent in the virtual scene sample.
[0153] In some embodiments, the virtual scene sample includes attributes and labels of the plurality of virtual object samples. Attributes of the virtual object sample include geometrical attributes (such as a position, a size, and a shape), material attributes (such as a color, a texture, transparency, and gloss), interaction attributes (time, a place, and a frequency of interaction between the virtual object sample and the user), and the like. When the probability is that the virtual object sample conforms to the capturing intent in the virtual scene sample, the label is 1; or when the probability is that the virtual object sample does not conform to the capturing intent in the virtual scene sample, the label is 0.
[0154] In some embodiments, the machine learning model is obtained by performing the following processing: using the virtual object samples as inputs, and invoking an initialized machine learning model to predict the probability that each virtual object sample conforms to the capturing intent, to obtain a predicted capturing probability of each virtual object sample; and determining a loss value based on a difference between the predicted capturing probability and the label, and updating parameters of the initialized machine learning model based on a back propagation algorithm and the loss value, to obtain a trained machine learning model. The machine learning model can be trained on the terminal by using an artificial intelligence (AI) chip, or can be trained by the server, where the trained machine learning model is delivered to the terminal.
[0155] A structure of the machine learning model may include an input layer, a hidden layer, and an output layer. In a forward propagation process, the virtual object samples are used as inputs, linear processing is performed on features of the virtual object samples through the hidden layer, to obtain linear features; the linear features are activated by using an activation function, to obtain an output feature of the hidden layer; and finally, the output feature of the hidden layer is normalized through the output layer, to obtain the predicted capturing probability of the virtual object sample.
[0156] In an example, the features of the virtual object samples are [feature 1, feature 2, . . . , feature n], and the label is y (a real interaction probability). First, the features of the virtual object samples are embedded to obtain an input vector X. Then, linear processing is performed on the input vector through the hidden layer. For example, a weight matrix W1 (4×8) of the hidden layer is randomly initialized as:W1=[0.10.20.30.40.50.60.70.80.20.30.40.50.60.70.80.90.30.40.50.60.70.80.90.10.40.50.60.70.80.90.10.2],wherea bias b1 of the hidden layer is initialized as b1=[0.1, 0.2, 0.3, 0.4], and then a linear feature Z1=W1×X+b1=[1.86, 2.14, 2.04, 1.96]. The linear feature Z1 is activated, to obtain an output feature A1=[1.86, 2.14, 2.04, 1.96] of the hidden layer.If the weight of the output layer is W2=[0.5, 0.3, 0.2, 0.1], and b2=0.1, linear calculation is performed on the output feature A1 of the hidden layer, to obtain a linear feature Z2=W2×A1+b2=2.234 of the output layer. Finally, the linear feature Z2 of the output layer is normalized by using a sigmoid function, to obtain a predicted capturing probability p=0.9 of the virtual object sample.
[0159] In a back propagation process, the loss value may be transferred from the output layer to the input layer based on the back propagation algorithm, so that the machine learning model can learn of a difference between the predicted capturing probability and the label y, and calculate a gradient of each parameter in the machine learning model based on the loss value. The parameters of the initial machine learning model are updated based on the gradients of the parameters, a preset learning rate, and an optimization algorithm, to reduce the loss value. A plurality of rounds of iterative training are performed on the machine learning model, until the loss value of the machine learning model converges or reaches a preset quantity of training rounds.
[0160] Operation 10322: Use a virtual object corresponding to a probability greater than a probability threshold as the target virtual object.
[0161] The probability threshold may be determined based on complexity of the virtual scene. If the virtual scene has a small quantity of virtual objects (for example, the quantity of virtual objects is less than a quantity threshold) and has a clear category (for example, a fixed plot scene), the probability threshold may be properly increased, to reduce interference items. If the virtual objects in the virtual scene are dense (for example, the quantity of virtual objects is greater than the quantity threshold) and the categories are mixed (for example, in a large open world), the probability threshold may be properly reduced, to avoid that most appropriate objects are excluded due to strict selection.
[0162] The probability threshold may further be determined based on a requirement of the user. For example, a threshold adjustment function (for example, a probability threshold setting control) is provided on the human-computer interaction interface, to allow the user to manually set the probability threshold based on a capturing requirement of the user.
[0163] Alternatively, the probability threshold may be dynamically optimized based on a real-time virtual scene. For example, when it is detected that there are few virtual objects in the current virtual scene (for example, the quantity of the virtual objects is less than the quantity threshold), the probability threshold may be automatically reduced. When the virtual objects in the virtual scene are dense (for example, the quantity of the virtual objects is greater than the quantity threshold), the threshold may be automatically increased, to balance a selection effect and operation experience.
[0164] In an example, if the probability threshold is 0.7, the pre-trained machine learning model is invoked to separately predict capturing intents for a virtual object A, a virtual object B, and a virtual object C, to obtain that a probability of the capturing intent for the virtual object A is 0.75, a probability of the capturing intent for the virtual object B is 0.55, and a probability of the capturing intent for the virtual object C is 0.8. In this case, the virtual object A and the virtual object C are used as the target virtual objects.
[0165] In the embodiments of this application, a plurality of selection solutions for selecting the virtual object in the target area are provided, to provide more interaction manners for the user, so that the user can select the most suitable selection method based on personal preferences or situations, thereby improving convenience and satisfaction of user interaction. Different selection solutions are applicable to different scenes and requirements. For example, a single object is precisely selected, a group of objects are selected, or all objects in an entire area are selected, thereby improving flexibility during capturing of a virtual object. In response to a selection operation performed by the user for a specific object in the target area, resources can be managed more effectively, for example, a rendering calculation amount or storage space can be reduced. In conclusion, the foregoing solutions may bring higher user satisfaction, operation efficiency, and application adaptability to the user, and provide more personalized and flexible use experience for the user.
[0166] Operation 1032 is continued for description.
[0167] Operation 1033: Capture, in response to the capturing trigger operation for the viewfinder interface, the target virtual object in the target area, and display a captured three-dimensional image.
[0168] In some embodiments, the capturing trigger operation performed by the user may be in any one of the following forms: a capture button, where, for example, the “capture” button or a “shutter” button is displayed on the viewfinder interface, and capturing is started in response to a trigger operation performed by the user for the “capture” button or the “shutter” button; a slide operation, where capturing is started in response to the user performing a specific slide action on the viewfinder interface, for example, sliding up or sliding down; a long-press operation, where a long-press operation performed by the user for a specified area or a button of the viewfinder interface is responded to, until a capturing operation is completed; speech control, where capturing is triggered in response to a speech instruction for capturing being received, such as “take a photo” or “Jiazi”; gesture recognition, where a user-specific gesture is recognized by using a front-facing camera or a gesture sensor, to start capturing; facial recognition, where capturing is triggered by recognizing a specific facial expression or action, such as blinking or smiling, of the user; a timer, where capturing is automatically performed after a delay of a preset time period expires in response to a setting operation performed by the user for the timer; a hardware button, where capturing is triggered in response to a press operation for the hardware button for capturing on the terminal device; and dynamic recognition, where capturing is triggered by recognizing a movement trajectory of the user, such as waving an arm or jumping.
[0169] In some embodiments, when the three-dimensional image is displayed, the following processing may be performed: displaying a thumbnail of the three-dimensional image at a specific viewing angle, the specific viewing angle being a viewing angle used when the target area is displayed on the viewfinder interface; and saving the three-dimensional image and the thumbnail to an electronic album, the thumbnail being used as preview information of the three-dimensional image in the electronic album.
[0170] When the thumbnail of the three-dimensional image at the specific viewing angle is displayed, the three-dimensional image and the thumbnail may be automatically saved to the electronic album. Alternatively, the three-dimensional image and the thumbnail may be saved to the electronic album in response to a save operation for the three-dimensional image. For example, when the thumbnails of the three-dimensional images at the specific viewing angle are displayed, a save control corresponding to each thumbnail is displayed, and in response to a selection operation for the save control, the three-dimensional image and the thumbnail that correspond to the selected save control are saved to the electronic album.
[0171] In some embodiments, the virtual scene includes an electronic album entrance; a thumbnail list is displayed in response to a trigger operation for the electronic album entrance, the thumbnail list including the thumbnail of the three-dimensional image; and the three-dimensional image is displayed in response to a viewing operation for the thumbnail.
[0172] In an example, FIG. 7A is a schematic diagram 11 of a virtual scene according to an embodiment of this application. In an electronic album shown in FIG. 7A, six preview thumbnails of three-dimensional images are shown. For example, a thumbnail 701 is shown in FIG. 7A.
[0173] In some embodiments, the following processing may be performed on the three-dimensional image: rotating, in response to a rotation operation in the three-dimensional image in a third direction, a display viewing angle of the three-dimensional image in the third direction.
[0174] The rotation operation in the three-dimensional image in the third direction may be a rotation operation in any direction, and a manner of the rotation operation may be a single-finger drag operation. For example, a rotation operation of 10 degrees may be performed in a clockwise direction, that is, the display viewing angle of the current three-dimensional image is rotated by 10 degrees in the clockwise direction. Alternatively, a rotation operation of 20 degrees may be performed in an anticlockwise direction, that is, the display viewing angle of the current three-dimensional image is rotated by 20 degrees in the anticlockwise direction.
[0175] In some other embodiments, the following processing may be performed on the three-dimensional image: updating, in response to a translation operation in the three-dimensional image in a fourth direction, a display area of the three-dimensional image in the fourth direction.
[0176] The translation operation in the three-dimensional image in the fourth direction may be a translation operation in any direction, and a manner of the translation operation may be a two-finger slide operation. For example, the display area of the current three-dimensional image may be translated leftward in response to a leftward slide operation of the two fingers in the three-dimensional image.
[0177] In some other embodiments, the following processing may be performed on the three-dimensional image: adjusting, in response to a size adjustment operation for the three-dimensional image, a display size of the three-dimensional image; or adjusting, in response to an adjustment operation for a size adjustment control in the three-dimensional image, a display size of the three-dimensional image.
[0178] The display size of the three-dimensional image refers to a length and a width of the three-dimensional image. In response to a slide operation for a slide bar of the size adjustment control, the display size of the three-dimensional image may be increased or reduced based on a direction of the slide operation. In response to a downward slide operation for the slide bar of the size adjustment control, the display size of the three-dimensional image is reduced. In response to an upward slide operation for the slide bar of the size adjustment control, the display size of the three-dimensional image is increased.
[0179] In some embodiments, the operation of adjusting the size of the three-dimensional image may be increasing the display size of the three-dimensional image through a gesture spreading operation, or reducing the display size of the three-dimensional image through a gesture pinching operation. A change in the display size of the three-dimensional image is directly proportional to an operation parameter of the gesture spreading or pinching operation. For example, if a distance of the gesture spreading operation is 2 centimeters, the display size of the three-dimensional image is switched to 1.5 times an original size, and if the distance of the gesture spreading operation is 3 centimeters, the display size of the three-dimensional image is switched to 2 times the original size.
[0180] In some embodiments, the three-dimensional image is displayed on a human-computer interaction interface of a first terminal device. When the three-dimensional image is displayed, the following processing may be performed: sending the three-dimensional image to a second terminal device in response to a sharing operation for the three-dimensional image, the three-dimensional image being configured for the second terminal device to display the target area in the virtual scene based on an original size.
[0181] After the three-dimensional image is sent to the second terminal device, when the target area in the virtual scene is displayed on a human-computer interaction interface of the second terminal device based on the original size, a second player character may further be displayed in the target area, where the second player character is controlled by the second terminal device.
[0182] In an example, the three-dimensional image may be sent to the second terminal device in response to a trigger operation for a sharing control in the three-dimensional image. FIG. 7B is a schematic diagram 12 of a virtual scene according to an embodiment of this application. In response to a trigger operation for the thumbnail 701 in FIG. 7A, photo details of a three-dimensional image shown in FIG. 7B are displayed. In addition, a deletion control 702, a sharing control 703, and a scene entrance 704 are shown in FIG. 7B. In response to a trigger operation for the sharing control 703, a player may share a three-dimensional scene with another player.
[0183] In some embodiments, when the three-dimensional image is displayed, the deletion control may be simultaneously displayed. In response to a trigger operation for the deletion control, the three-dimensional image is deleted, and the thumbnail of the three-dimensional image is simultaneously deleted from the electronic album.
[0184] In an example, in response to the trigger operation for the deletion control 702, the player may perform a deletion operation on the three-dimensional scene.
[0185] In some embodiments, the virtual scene is displayed on a human-computer interaction interface of a first terminal device. When the three-dimensional image is displayed, the following processing may be performed: displaying a scene entrance; displaying, in response to a trigger operation for the scene entrance, the target area in the virtual scene based on the three-dimensional image and an original size, and displaying a first player character in the target area, the first player character being controlled by the first terminal device; and controlling, in response to a control operation for the first player character, the first player character to perform interaction in the target area.
[0186] For example, FIG. 7B shows the scene entrance 704. In response to the trigger operation for the scene entrance 704, the virtual scene corresponding to the three-dimensional image may be loaded and zoomed into a three-dimensional model of an original size, so that the player can control the virtual character of the player to play in the virtual scene of the three-dimensional model.
[0187] In some embodiments, when the “displaying the target area in the virtual scene based on the original size” is performed, the following processing may be performed: sending an interaction request to a second terminal device in response to an interaction request operation, the interaction request being configured for indicating a second player character to enter the target area to perform interaction with the first player character, and the second player character being controlled by the second terminal device.
[0188] An invitation control may be displayed when the target area in the virtual scene is displayed based on the original size, and the interaction request is sent to at least one second terminal device in response to a trigger operation for the invitation control.
[0189] In an example, FIG. 7C is a schematic diagram 13 of a virtual scene according to an embodiment of this application. In response to the trigger operation performed by the player for the scene entrance 704, the virtual scene shown in FIG. 7C is displayed. FIG. 7C shows an invitation entrance 705 and an operation control 706. The operation control 706 includes controls of a skill A, a skill B, a skill C, and a skill D. In response to a trigger operation performed by the player for any skill control of the operation control 706, the virtual character controlled by the player may perform a corresponding action. In response to a trigger operation for the invitation entrance 705, a link of the current gameplay scene in FIG. 7C may be sent to another player, so that the another player directly enters the player's current virtual scene by clicking / tapping the link, and plays with the player together in the current virtual scene.
[0190] In this embodiment of this application, for, the user may be enabled to perform a viewing operation, a deletion operation, or a sharing operation on the captured three-dimensional image, thereby improving efficiency of managing the three-dimensional image by the user. In addition, the user is enabled to enter the three-dimensional scene of the three-dimensional image to play, or perform interaction with another player who enters the same three-dimensional scene, thereby improving propagation and social interaction of the three-dimensional image. This provides richer and more diverse user experience, drives the development of three-dimensional image and virtual reality technologies, and brings significant technical effects to both users and developers.
[0191] In some embodiments, FIG. 3D is a schematic flowchart 4 of a data processing method for a virtual scene according to an embodiment of this application. Operation 103 in FIG. 3A may be implemented through operation 1034 to operation 1036, which are described below in detail.
[0192] Operation 1034: Obtain three-dimensional data of the viewfinder interface in response to the capturing trigger operation for the viewfinder interface, the three-dimensional data including a position, an appearance, a material, and light source information of the virtual object in the virtual scene.
[0193] In some embodiments, operation 1034 may be implemented by performing the following processing. First, a software platform having a three-dimensional modeling function is prepared, where the platform can capture and process three-dimensional scene data in real time. Second, a user interface is configured, where the interface includes a viewfinder, so that the user can observe a virtual scene through the viewfinder and perform a capturing operation. Then, three-dimensional data of the viewfinder interface is obtained in response to a capturing trigger operation performed by the user.
[0194] The three-dimensional data of the viewfinder interface includes the following information: the position of the virtual object, where a spatial position of each virtual object is recorded by using a three-dimensional coordinate system; the appearance of the virtual object, that is, recording an appearance attribute such as a texture and a color of each virtual object; the material of the virtual object, such as reflectivity, transparency, or coarseness; and the light source information, that is, recording types, intensities, colors, and positions of all light sources in the virtual scene.
[0195] In an example, the software platform having a three-dimensional modeling function may be Unreal Engine, Unity three-dimensional game development engine (Unity 3D), SketchUp three-dimensional modeling software, Rhino three-dimensional modeling software, Blender open-source three-dimensional modeling and rendering software, or the like.
[0196] Operation 1035: Perform modeling based on the three-dimensional data, to obtain a three-dimensional model.
[0197] In some embodiments, the captured three-dimensional data may be compiled into a structured file format, such as OBJ, FBX, or GLTF, to facilitate subsequent storage, transmission, and sharing. Operation 1035 may be implemented by performing the following processing. First, the three-dimensional data is preprocessed to remove noise, abnormal points, and other unnecessary data that are generated in a collection process. Filtering is performed, and smoothing is performed on point cloud data, to reduce errors in the data. Then, data alignment is performed, and point cloud data captured from different viewing angles or different times is aligned, to ensure that the point cloud data can be correctly concatenated in space. In addition, a relative position of the point cloud data is optimized by using an alignment algorithm (for example, an iterative closest point (ICP) algorithm). Next, texture information is extracted from the original three-dimensional data, a texture is mapped to a surface of the three-dimensional model, and a material attribute such as a color, gloss, or transparency is specified for the model. Finally, refining is performed on the three-dimensional model, for example, adding details, optimizing edges, or repairing holes.
[0198] Operation 1036: Render the three-dimensional model, to obtain the three-dimensional image including the target area.
[0199] In some embodiments, operation 1036 may be implemented by performing the following processing. First, a three-dimensional model file (for example, in an OBJ, FBX, or GLTF format) is imported into rendering software. Then, parameters of the rendering software are set, for example, a suitable rendering engine is selected, such as real-time rendering or offline rendering; an anti-aliasing level is set, to reduce a jagged edge of an image; and a resolution and an output format of a rendered image are set. Finally, a rendering process is started, and illumination, shadow, and texture mapping of a scene are calculated based on the set parameters. After the rendering is completed, the software outputs the three-dimensional image including the target area.
[0200] In this embodiment of this application, in response to the capturing trigger operation for the viewfinder interface, the three-dimensional data of the viewfinder interface is obtained; modeling is performed based on the three-dimensional data, to obtain the three-dimensional model; and the three-dimensional model is rendered, to obtain the three-dimensional image including the target area, and the obtained three-dimensional image can enable the user to observe from different angles and viewpoints, thereby increasing interactivity of user experience. By integrating three-dimensional data capturing, modeling, and rendering technologies, an efficient, interactive, and high-quality three-dimensional content creation and presentation platform can be provided for the user.
[0201] In conclusion, according to this embodiment of this application, in response to the viewfinder interface trigger operation in the virtual scene, the viewfinder interface of the virtual scene is displayed, and before the capturing is performed, content (for example, information about a virtual object and another graphic element) of the virtual scene in the target area is intuitively displayed on the viewfinder interface, to select a capturing area; and the viewfinder interface is captured to obtain the three-dimensional image including the target area. In comparison with the related art in which only a two-dimensional image at a current viewing angle can be captured, the three-dimensional image provides the user with omnidirectional and multi-viewing-angle snapshots of the capturing area, to enable the user to view detailed information of the capturing area in the virtual scene.
[0202] The following describes exemplary application of this embodiment of this application in a game scene.
[0203] In the game scene, a large quantity of games provide a function for capturing by a player, so that the player may pause the game and take a screenshot or capture of a current game picture after freely adjusting an angle of a virtual camera and setting a filter and a capturing effect. In the related art, the player is enabled to take a screenshot or capture in a two-dimensional mode, and save or share an obtained two-dimensional static image to another player.
[0204] For example, in the related art, the two-dimensional static image may be obtained in the following manner: (1) enabling a capturing mode, and activating the capturing mode in response to a trigger operation performed by the player for a pause menu or a shortcut key (such as a capturing entrance); (2) controlling the virtual camera, where after the capturing mode is entered, in response to an adjustment operation performed by the player for an angle, a position, and a focal length of the virtual camera, a capturing viewing angle, a capturing position, and a capturing area of the virtual camera are adjusted; (3) setting parameters, where capturing parameters such as a depth of field (DOF) effect, a filter, and a frame can be changed, and moreover, postures and expressions of a player character and a non-player character can further be adjusted to obtain an optimal effect; and (4) saving an image, where after the adjusting is completed, in response to a trigger operation performed by the player for a screenshot button, the current image is stored as the two-dimensional static image, and image information is saved to a local storage device.
[0205] In the related art, only a two-dimensional static image can be obtained by taking a screenshot or capture, and reconstruction and interaction of a three-dimensional scene are not supported. Specifically, there are the following technical problems. (1) Restricted to the two-dimensional static image, the screenshot mode or the capturing mode can capture only one two-dimensional static image at a current viewing angle, and cannot provide a capability of omnidirectional and multi-viewing-angle observation on the scene. (2) A lack of immersion exists because the two-dimensional static image can only provide a planar presentation of a picture at a moment, and the player cannot truly re-experience the context. Therefore, it is difficult to bring deeply immersive experience. (3) Interactivity is limited, and a sharing mechanism in the related art usually only shares the two-dimensional static image to a social platform, cannot provide space for further interaction, and only remains at a visual appreciation level. (4) A fixed viewing angle limits creative freedom. The two-dimensional static image is limited by the position and the direction of the virtual camera during capturing. if an optimal angle is missed, the position and the direction of the virtual camera need to be adjusted to capture the image again. The operation is irreversible, and capturing experience of the player is affected.
[0206] In view of the foregoing problems, according to the data processing method for a virtual scene provided in this embodiment of this application, the player can take a photo in a three-dimensional mode, to obtain a three-dimensional image. An instant static picture can be recorded, and an entire three-dimensional scene can be stored. In addition, the player is enabled to observe a three-dimensional model of a three-dimensional scene from different angles in a manner of rotating, zooming in, or zooming out a display interface. In this way, the player can enter a virtual environment of the three-dimensional model to obtain a more immersive experience. In addition, it further supports sharing of these three-dimensional images with other players, or inviting friends to jointly enter the three-dimensional scene for interactive gameplay, to achieve richer and more interesting social experience, and provide the user with an innovative, deep, and highly interactive game experience manner.
[0207] The data processing method for a virtual scene provided in an embodiment of this application is described below with reference to figures.
[0208] First, the capturing mode is entered in response to the trigger operation performed by the user for the capturing entrance in the virtual scene. FIG. 4A is a schematic diagram 1 of a virtual scene according to an embodiment of this application, and FIG. 4B is a schematic diagram 2 of a virtual scene according to an embodiment of this application. As shown in FIG. 4A, FIG. 4A shows a first virtual object 401, a capturing entrance 402, a direction control 403, and a skill control 404. In response to a trigger operation for the capturing entrance 402, a capturing mode is entered, and a viewfinder interface shown in FIG. 4B is displayed. FIG. 4B shows a capturing mode control 405, a capturing control 406, a viewfinder box 407, a focusing box 408, and a focal length adjustment control 409. The capturing mode control 405 supports mode switching of a two-dimensional capturing mode and a three-dimensional capturing mode. An image captured in the two-dimensional capturing mode is a two-dimensional static image, and an image captured in the three-dimensional capturing mode is a three-dimensional image. The capturing mode is the three-dimensional capturing mode by default.
[0209] In the capturing mode, visual graphic elements (such as an operation control, a quest bar control, and a message bar) unrelated to the virtual scene may be automatically hidden. The operation controls shown in FIG. 4A, namely, the direction control 403 and the skill control 404, are not displayed on the viewfinder interface shown in FIG. 4B.
[0210] When the viewfinder interface is displayed, a capturing angle, a capturing position, and a focal length of a virtual camera performing a capturing operation may be randomly adjusted. The foregoing adjustment for the virtual camera may be implemented by performing the following processing: (1) rotating a viewing angle, to be specific, rotating the viewing angle of the virtual camera in response to a drag operation (for example, a single-finger drag operation) in the viewfinder interface, to implement omnidirectional observation; (2) moving a position, where translation is implemented in response to a slide operation (for example, a two-finger slide operation) in the viewfinder interface; and (3) zooming in / out the viewfinder interface, where lens zooming of the virtual camera is implemented in response to a gesture spreading operation or a gesture pinching operation in the viewfinder interface; and the focal length of the virtual camera may further be adjusted in response to an adjustment operation for a slide bar of the focal length adjustment control.
[0211] After the foregoing adjustment operation for the virtual camera is completed, in response to a trigger operation performed by a player for a capturing control (for example, the capturing control 406 in FIG. 4B) in the viewfinder interface, the current viewfinder interface may be captured, to generate a three-dimensional image. All three-dimensional information that can be recorded in the viewfinder box is recorded while capturing, including a position, a texture, a light and shadow effect, and the like of the virtual object in the virtual scene. In addition, a preview thumbnail of the three-dimensional image is generated, and it is prompted that the capturing succeeds. The thumbnail is automatically saved to an electronic album of the player. In the electronic album, all the three-dimensional images captured by the player are presented in a form of a thumbnail list, so that the player can manage the thumbnails of the three-dimensional images in the album through the electronic album.
[0212] In an electronic album shown in FIG. 7A, six preview thumbnails, such as a thumbnail 701, of three-dimensional images are shown.
[0213] In response to a trigger operation (such as a double-click / tap operation) performed by a player for the thumbnail of the three-dimensional image in the electronic album, a three-dimensional model of the three-dimensional image corresponding to the thumbnail can be loaded, so that the player can perform operations such as viewing, sharing, deleting, and entering a scene for play on the three-dimensional image. The viewing operation available for execution by the player includes at least one of the following: (1) rotating a viewing angle, to be specific, rotating the viewing angle in response to a drag operation (for example, a single-finger drag operation) in the three-dimensional image, to implement omnidirectional observation; (2) moving a position, where translation of a display interface is implemented in response to a slide operation (for example, a two-finger slide operation) in the three-dimensional image; and (3) zooming in / out the viewfinder interface, where zooming in or zooming out of a size of the three-dimensional image is implemented in response to a gesture spreading operation or a gesture pinching operation in the three-dimensional image; and the size of the three-dimensional image may further be adjusted in response to an adjustment operation for a slide bar of the size adjustment control.
[0214] In an example, FIG. 7B is a schematic diagram 12 of a virtual scene according to an embodiment of this application. In response to a trigger operation for the thumbnail 701 in FIG. 7A, photo details of a three-dimensional image shown in FIG. 7B are displayed. In addition, a deletion control 702, a sharing control 703, and a scene entrance 704 are shown in FIG. 7B. In response to a trigger operation for the deletion control 702, the player may perform a deletion operation on a three-dimensional scene. In response to a trigger operation for the sharing control 703, the player may share the three-dimensional scene with another player. In response to a trigger operation performed by the player for the scene entrance 704, the virtual scene corresponding to the three-dimensional image may be loaded and zoomed into a three-dimensional model of an original size, so that the player can control the virtual character of the player to play in the virtual scene of the three-dimensional model. When the player plays in the virtual scene, a link of the current gameplay scene may be sent to another player, so that the another player directly enters the player's current virtual scene by clicking / tapping the link, and plays with the player in the current virtual scene together.
[0215] In an example, FIG. 7C is a schematic diagram 13 of a virtual scene according to an embodiment of this application. In response to the trigger operation performed by the player for the scene entrance 704, the virtual scene shown in FIG. 7C is displayed. FIG. 7C shows an invitation entrance 705 and an operation control 706. The operation control 706 includes controls of a skill A, a skill B, a skill C, and a skill D. In response to a trigger operation performed by the player for any skill control of the operation control 706, the virtual character controlled by the player may perform a corresponding action. In response to a trigger operation for the invitation entrance 705, a link of the current gameplay scene in FIG. 7C may be sent to another player, so that the another player directly enters the player's current virtual scene by clicking / tapping the link, and plays with the player together in the current virtual scene.
[0216] The following describes an overall implementation process of the data processing method for a virtual scene provided in the embodiments of this application. FIG. 8 is a schematic flowchart 5 of a data processing method for a virtual scene according to an embodiment of this application. Specific descriptions are provided below with reference to operation 801 to operation 809 shown in FIG. 8.
[0217] Operation 801: Activate a capturing mode.
[0218] In some embodiments, the capturing mode may be entered in response to a trigger operation for a capturing entrance. When the capturing mode is entered, a visual graphic element (such as an operation control, a quest bar control, and a message bar) unrelated to the virtual scene may be automatically hidden by adjusting a visibility attribute of the visual graphic element, to ensure that a player has a clearer and more concentrated field of view.
[0219] After the capturing mode is entered, a three-dimensional capturing mode is selected by default, and a capturing mode control is displayed on a viewfinder interface, for the player to manually switch to a two-dimensional capturing mode. The capturing mode control may be implemented in a form of a simple radio button or a toggle switch. If the two-dimensional capturing mode is selected, when the capturing control is triggered to perform capturing, only one static picture at a current viewing angle is captured, and is saved in a common format (such as PNG or JPEG); or if the three-dimensional capturing mode is selected, when the capturing control is triggered to perform capturing, three-dimensional data in the virtual scene is captured, and an obtained image is a three-dimensional image.
[0220] Operation 802: Adjust a capturing viewing angle, a position, and a focal length of a virtual camera.
[0221] In some embodiments, the foregoing adjustment for the virtual camera may be implemented by performing the following processing: (1) rotating a viewing angle, to be specific, rotating the viewing angle of the virtual camera in response to a drag operation (for example, a single-finger drag operation) in the viewfinder interface, to implement omnidirectional observation; (2) moving a position, where translation is implemented in response to a slide operation (for example, a two-finger slide operation) in the viewfinder interface; and (3) zooming in / out the viewfinder interface, where lens zooming of the virtual camera is implemented in response to a gesture spreading operation or a gesture pinching operation in the viewfinder interface; and the focal length of the virtual camera may further be adjusted in response to an adjustment operation for a slide bar of the focal length adjustment control.
[0222] Operation 803: Capture data of the virtual scene in response to a trigger operation for the capturing control.
[0223] In some embodiments, in response to the trigger operation for the capturing control, data such as a position, a shape, a texture, and a light and shadow effect of a virtual object in the virtual scene may be captured. A position, a shape, and material details of each virtual object in a camera-to-subject range are obtained and recorded in the process, and light source information is recorded to ensure a consistent light and shadow effect.
[0224] When three-dimensional data is captured, scenes that can be observed by the virtual camera need to be considered, and objects that are far away from the player and that are unnecessary to the current capturing need to be excluded. In addition, a virtual object that is partially in the field of view also needs to be selected. For example, a virtual object whose display volume exceeds a half of a volume of the virtual object is used as a target virtual object. Specific descriptions are provided below with reference to figures.
[0225] First, a valid field of view of the virtual camera is determined.
[0226] In some embodiments, a camera-to-subject range of the virtual camera may be determined based on a maximum camera-to-subject distance and a clipped area (an area between a near clipping plane and a far clipping plane) of the virtual camera. For example, if the maximum camera-to-subject distance of the virtual camera is 100 meters, only a virtual object within 100 meters away from the virtual camera is recorded, and a virtual object beyond 100 meters away from the virtual object is not recorded even if the virtual object is in the view of field. The near clipping plane is a plane whose distance to the virtual camera is located at a minimum distance threshold (which is equivalent to the first distance threshold above). The far clipping plane is a plane whose distance to the virtual camera is located at a maximum distance threshold (which is equivalent to the second distance threshold above). For example, the first distance threshold is 0.3 meters, and the second distance threshold is 100 meters.
[0227] In an example, FIG. 9 is a schematic diagram of a camera-to-subject range according to an embodiment of this application. FIG. 9 shows a maximum camera-to-subject distance, a near clipping plane, and a far clipping plane of a virtual camera 901. An area between the near clipping plane and the far clipping plane is a clipped area 902.
[0228] Then, a virtual object in the clipped area that is fully visible is saved. Boundary detection is performed on a virtual object that partially enters a lens but is not completely presented, to determine whether the corresponding virtual object needs to be included in a current storage sequence. If display completeness of the virtual object is greater than a completeness threshold, the virtual object is determined as the target virtual object. For example, if a volume of the virtual object that enters the lens exceeds a half of a volume of the virtual object, the virtual object is displayed; otherwise, the virtual object is not displayed.
[0229] In an example, a virtual object 903, a virtual object 904, and a virtual object 905 are shown within a range of the clipped area 902. Because the virtual object 903 is not in a field of view of the virtual camera 901, the virtual object 903 cannot be captured. Because a volume of the virtual object 904 displayed in the field of view of the virtual camera 901 exceeds a half of a volume of the virtual object 904, the virtual object 904 is used as a target virtual object. Because a volume of the virtual object 905 displayed in the field of view of the virtual camera 901 does not exceed a half of a volume of the virtual object 905, the virtual object 905 cannot be captured.
[0230] Operation 804: Determine whether data capturing is successfully completed. If the data capturing is not successfully completed, operation 805 is performed, and operation 802 continues to be performed; or if the data capturing is successfully completed, operation 806 is performed.
[0231] Operation 805: Prompt failure information.
[0232] In some embodiments, if the data capturing of the virtual scene is not completed, prompt information of “the data capturing fails” is displayed on the viewfinder interface. In addition, an adjustment operation for the virtual camera continues to be performed.
[0233] Operation 806: Save the data locally.
[0234] In some embodiments, the captured three-dimensional data of the virtual scene may be saved to a local file system. For example, the collected three-dimensional information may be packaged into an FBX format file supported by an unreal engine 4 (UE4) by default, and stored in a built-in file system of a local game. In addition, each file needs to be managed independently, and has a universally unique identifier (UUID), to facilitate future indexing and searching.
[0235] Operation 807: Upload the data to a server.
[0236] In some embodiments, an upload interface may be provided on a local terminal device, and the data of the three-dimensional scene saved to the local file system is synchronously uploaded to the server. For example, the data of the three-dimensional scene may be uploaded to a cloud server. When a sharing instruction of the player is received, data of the cloud server may be further transmitted to a remote server, for example, to a server of a terminal device controlled by another player, so that players controlling different terminal devices can share the data to view a shared three-dimensional image, and can perform interaction in the same virtual scene through a social interaction module (for example, a link sharing module).
[0237] Operation 808: Determine whether the saving succeeds. if the saving does not succeed, operation 805 is performed, and operation 802 continues to be performed; or if the saving succeeds, operation 809 is performed.
[0238] In some embodiments, if the data saving fails, prompt information of “the data saving fails” is displayed on the viewfinder interface. In addition, the adjustment operation for the virtual camera continues to be performed.
[0239] Operation 809: Generate a thumbnail and prompt that the thumbnail is successfully saved.
[0240] In some embodiments, if the data of the three-dimensional scene is successfully saved, a thumbnail of the three-dimensional image at the current viewing angle is generated, and it is prompted that the thumbnail is successfully saved.
[0241] After the three-dimensional data of the three-dimensional image is saved to the cloud server, the terminal device automatically generates a unique link or invitation code, so that another player can access the three-dimensional scene of the three-dimensional image via the link. To enable a plurality of players to simultaneously enter the same three-dimensional scene, a first player who clicks the link and enters the scene becomes the host, and the host is responsible for initializing and broadcasting the current state information. Subsequently, when the server receives a room-joining request from another player who clicks the same link and requests to enter the scene, the player obtains the initial data from the server and synchronizes the data into the shared three-dimensional environment. After the link is successfully established, each time a join request of a player is received, a three-dimensional model is downloaded and loaded, and a performance parameter is adjusted based on performance of a terminal device, to optimize a display effect of the three-dimensional scene and reduce waiting time. For example, the following processing may be performed: (1) adapting to graphics quality, where during startup, a specification of hardware (such as a central processing unit (CPU), a graphics processing unit (GPU), and a random access memory (RAM)) of the terminal device is detected, and initial graphics quality is set (a plurality of graphics quality options such as low, medium, and high are provided); (2) controlling a resolution and a frame rate, where a rendering resolution is adjusted in real time based on the current frame rate, to ensure smoothness of three-dimensional image display; and (3) adjusting a special effect and physical simulation, to reduce complexity of a particle special effect, and dynamically enabling / disabling some display effects based on the performance of the terminal device.
[0242] In this embodiment of this application, the three-dimensional scene is captured in the three-dimensional capturing mode, the three-dimensional data of the three-dimensional scene is captured, and the sharing function is provided, to bring good game experience to the player, which is specifically embodied in the following several aspects. (1) Enhanced immersion: The three-dimensional recording can completely save a scene. The player can capture a static image, and can obtain an object position, light source information, and the like, to really reproduce all details seen by the player at a specific time point, thereby providing a deeper immersion. (2) Free-viewing-angle browsing: The user can observe captured content from any angle through operations such as rotation, zooming, and translation, and even enter a virtual scene to roam, which is more vivid and realistic than a two-dimensional static image in the related art. (3) Enriched social interaction: A plurality of users may simultaneously join the same three-dimensional scene space for exploration and communication, which provides a brand-new and highly interactive and social gameplay manner for players. (4) Enhanced propagation and sharing: Compared with a two-dimensional static image, a three-dimensional image has stronger visual impact, and is more likely to attract attention on a social platform. A user may enter, via a link, a three-dimensional scene shared by another person for exploration. This novel interaction manner is easy to attract discussion in a social network.
[0243] An exemplary structure of the data processing apparatus 455 for a virtual scene implemented as software modules provided in the embodiments of this application continues to be described below. In some embodiments, as shown in FIG. 2, the software modules in the data processing apparatus 455 for a virtual scene that is stored in the memory 450 may include:
[0244] the scene display module 4551, configured to display a virtual scene;
[0245] the interface display module 4552, configured to display a viewfinder interface in response to a viewfinder interface trigger operation for the virtual scene, the viewfinder interface including a target area in the virtual scene; and
[0246] the image display module 4553, configured to display, in response to a capturing trigger operation for the viewfinder interface, a three-dimensional image including the target area.
[0247] In some embodiments, when the viewfinder interface is displayed, the interface display module 4552 is further configured to hide a graphic element unrelated to capturing in the virtual scene, the graphic element including at least one of the following: an operation control, a quest bar control, and a message bar.
[0248] In some embodiments, the image display module 4553 is further configured to: when the target area includes a plurality of virtual objects, capture, in response to the capturing trigger operation for the viewfinder interface, a clipped area in the target area through a virtual camera, and display a captured three-dimensional image, the clipped area being an area whose distance to the virtual camera is between a first distance threshold and a second distance threshold in the target area, the first distance threshold being less than the second distance threshold, and the second distance threshold being less than a maximum camera-to-subject distance of the virtual camera.
[0249] In some embodiments, the image display module 4553 is further configured to capture all the virtual objects displayed in the clipped area through the virtual camera; or capture, in the clipped area, a virtual object having a display completeness greater than a completeness threshold, the display completeness being a ratio of a part of the virtual object displayed in the clipped area to a part of the virtual object displayed in the virtual scene.
[0250] In some embodiments, the target area is captured by the virtual camera. The image display module 4553 is further configured to: display, in the target area, a plurality of virtual objects whose distances to the virtual camera are less than a maximum camera-to-subject distance of the virtual camera; use a selected virtual object as a target virtual object in response to a selection operation for the plurality of virtual objects; and capture, in response to the capturing trigger operation for the viewfinder interface, the target virtual object in the target area, and display a captured three-dimensional image.
[0251] In some embodiments, the viewfinder interface includes a plurality of type controls, and each of type controls is configured to be associated with a type of the virtual objects. The image display module 4553 is further configured to: set, in response to a trigger operation for any type control, a virtual object associated with the any type control to be in a selected state, and use the virtual object associated with the any type control as the target virtual object.
[0252] In some embodiments, the viewfinder interface includes a distance control. The image display module 4553 is further configured to: display, in response to a setting operation for the distance control, a distance range set through the setting operation, a minimum distance of the distance range being a minimum camera-to-subject distance of the virtual camera, and a maximum distance of the distance range being a maximum camera-to-subject distance of the virtual camera; and use a virtual object within the distance range as the target virtual object.
[0253] In some embodiments, the image display module 4553 is further configured to: invoke a pre-trained machine learning model to separately predict capturing intents for the plurality of virtual objects, to obtain a probability that each of the virtual objects conforms to the capturing intent, the machine learning model being obtained by training based on a virtual scene sample, the virtual scene sample including a plurality of virtual object samples and labels, and the label representing a probability that each of the virtual object samples conforms to the capturing intent in the virtual scene sample; and use a virtual object corresponding to a probability greater than a probability threshold as the target virtual object.
[0254] In some embodiments, when the three-dimensional image including the target area is displayed, the image display module 4553 is further configured to display a thumbnail of the three-dimensional image at a specific viewing angle, the specific viewing angle being a viewing angle used when the target area is displayed on the viewfinder interface; and the three-dimensional image and the thumbnail are saved to an electronic album, the thumbnail being used as preview information of the three-dimensional image in the electronic album.
[0255] In some embodiments, the virtual scene includes an electronic album entrance; the image display module 4553 is further configured to: display a thumbnail list in response to a trigger operation for the electronic album entrance, the thumbnail list including the thumbnail of the three-dimensional image; display the three-dimensional image in response to a viewing operation for the thumbnail; and perform at least one of the following processing on the three-dimensional image: rotating, in response to a rotation operation in the three-dimensional image in a third direction, a display viewing angle of the three-dimensional image in the third direction; updating, in response to a translation operation in the three-dimensional image in a fourth direction, a display area of the three-dimensional image in the fourth direction; adjusting, in response to a size adjustment operation for the three-dimensional image, a display size of the three-dimensional image; or adjusting, in response to an adjustment operation for a size adjustment control in the three-dimensional image, a display size of the three-dimensional image.
[0256] In some embodiments, the three-dimensional image is displayed on a human-computer interaction interface of a first terminal device. When the three-dimensional image is displayed, the image display module 4553 is further configured to send the three-dimensional image to a second terminal device in response to a sharing operation for the three-dimensional image, the three-dimensional image being configured for the second terminal device to display the target area in the virtual scene based on an original size.
[0257] In some embodiments, the virtual scene is displayed on a human-computer interaction interface of a first terminal device. When the three-dimensional image is displayed, the image display module 4553 is further configured to: display a scene entrance; display, in response to a trigger operation for the scene entrance, the target area in the virtual scene based on the three-dimensional image and an original size, and display a first player character in the target area, the first player character being controlled by the first terminal device; and control, in response to a control operation for the first player character, the first player character to perform interaction in the target area.
[0258] In some embodiments, when the target area in the virtual scene is displayed based on the original size, the image display module 4553 is further configured to send an interaction request to the second terminal device in response to an interaction request operation, the interaction request being configured for indicating a second player character to enter the target area to perform interaction with the first player character, and the second player character being controlled by the second terminal device.
[0259] In some embodiments, the viewfinder interface is in a three-dimensional capturing mode; and when the viewfinder interface is in the three-dimensional capturing mode, the interface display module 4552 is further configured to switch the three-dimensional capturing mode to a two-dimensional capturing mode in response to a switching operation for the capturing mode control, the two-dimensional capturing mode being configured for capturing a two-dimensional image including the target area.
[0260] In some embodiments, the interface display module 4552 is further configured to perform at least one of the following processing: displaying the viewfinder interface in response to receiving speech information for viewfinding of the virtual scene; displaying the viewfinder interface in response to receiving somatosensory information for viewfinding of the virtual scene; or displaying the viewfinder interface in response to a trigger operation for a viewfinder control in the virtual scene.
[0261] In some embodiments, the viewfinder interface includes a viewfinder box and a focusing box, where the viewfinder box includes the target area in the virtual scene, and the focusing box is configured for representing a focusing area when capturing is performed on the target area.
[0262] In some embodiments, the interface display module 4552 is further configured to perform at least one of the following processing: rotating, in response to a rotation operation in the viewfinder box in a first direction, a viewing angle of the virtual camera in the viewfinder box in the first direction; moving, in response to a translation operation in the viewfinder box in a second direction, a target area of the virtual camera in the viewfinder box in the second direction; adjusting a capturing focal length of the virtual camera in response to a focal length adjustment operation for the viewfinder box; or adjusting a capturing focal length of the virtual camera in response to an adjustment operation for a focal length adjustment control in the viewfinder box.
[0263] In some embodiments, the image display module 4553 is further configured to: obtain three-dimensional data of the viewfinder interface in response to a capturing trigger operation for the viewfinder interface, the three-dimensional data including a position, an appearance, a material, and light source information of the virtual object in the virtual scene; perform modeling based on the three-dimensional data, to obtain a three-dimensional model; and render the three-dimensional model, to obtain the three-dimensional image including the target area.
[0264] An embodiment of this application provides a computer program product. The computer program product includes a computer program or computer-executable instructions. The computer program or the computer-executable instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, to cause the electronic device to perform the data processing method for a virtual scene provided in the embodiments of this application.
[0265] An embodiment of this application provides a computer-readable storage medium, having computer-executable instructions or a computer program stored therein. When the computer-executable instructions or the computer program is executed by a processor, the processor is caused to perform the data processing method for a virtual scene provided in the embodiments of this application, for example, the data processing method for a virtual scene shown in FIG. 3A.
[0266] In some embodiments, the computer-readable storage medium may be a memory such as a random-access memory (RAM), a read-only memory (ROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); or may be any device including one or any combination of the foregoing memories.
[0267] In some embodiments, the computer-executable instructions may be in a form of a program, software, a software module, a script, or code, written in a programming language of any form (including a compiled or interpreted language, or a declarative or procedural language), and may be deployed in any form, including being deployed as a stand-alone program or as a module, a component, a subroutine, or another unit suitable for use in a computing environment.
[0268] In an example, the computer-executable instructions may, but do not necessarily correspond to, a file in a file system, and may be stored as a part of a file having another program or data stored therein. For example, the computer-executable instructions are stored in one or more scripts in a hypertext markup language (HTML) text, stored in a single file dedicated to a discussed program, or stored in a plurality of collaborative files (for example, files having one or more modules, subprograms, or code parts).
[0269] In an example, the computer-executable instructions may be deployed to be executed on one electronic device, on a plurality of electronic devices located at one location, or on a plurality of electronic devices distributed at a plurality of locations and interconnected through a communication network.
[0270] In conclusion, according to this embodiment of this application, in response to the viewfinder interface trigger operation in the virtual scene, the viewfinder interface of the virtual scene is displayed, and before the capturing is performed, content (for example, information about a virtual object and another graphic element) of the virtual scene in the target area is intuitively displayed on the viewfinder interface, to select a capturing area; and the viewfinder interface is captured to obtain the three-dimensional image including the target area. In comparison with the related art in which only a two-dimensional image at a current viewing angle can be captured, the three-dimensional image provides the user with omnidirectional and multi-viewing-angle snapshots of the capturing area, to enable the user to view detailed information of the capturing area in the virtual scene.
[0271] In this application, the term “module” refers to a computer program with a preset function or a part of the computer program and works, together with other related parts, to implement a preset target, and may be completely or partially implemented by using software, hardware (for example, a processing circuit or a memory) or a combination thereof. Similarly, one processor (or a plurality of processors or memories) may be configured to implement one or more modules. In addition, each module may be a part of an overall module including a function of the module. The foregoing descriptions are merely embodiments of this application and are not intended to limit the protection scope of this application. Any modification, equivalent replacement, or improvement made without departing from the spirit and range of this application falls within the protection scope of this application.
Claims
1. A method for capturing a three-dimensional image of a virtual scene performed by an electronic device, the method comprising:displaying a virtual scene;displaying a viewfinder interface, the viewfinder interface comprising a target area including a plurality of virtual objects in the virtual scene;in response to a capturing trigger operation for the viewfinder interface, clipping the target area through a virtual camera, the clipped area being an area whose distance to the virtual camera is between a first distance threshold and a second distance threshold in the target area, the first distance threshold being less than the second distance threshold, and the second distance threshold being less than a maximum camera-to-subject distance of the virtual camera; andgenerating a three-dimensional image of the clipped area, wherein the three-dimensional image includes a subset of the plurality of virtual objects in the target area.
2. The method according to claim 1, wherein the method further comprises:hiding a graphic element unrelated to the target area in the virtual scene, the graphic element comprising at least one of the following: an operation control, a quest bar control, and a message bar.
3. The method according to claim 1, wherein the clipping the target area through the virtual camera comprises:capturing, in the clipped area, a virtual object having a display completeness greater than a completeness threshold, the display completeness being a ratio of a part of the virtual object displayed in the clipped area to a part of the virtual object displayed in the virtual scene.
4. The method according to claim 1, wherein the generating the three-dimensional image of the clipped area comprises:selecting, in the target area, a subset of the plurality of virtual objects whose distances to the virtual camera are less than a maximum camera-to-subject distance of the virtual camera;using the selected subset of virtual object as target virtual objects; andgenerating the three-dimensional image of the target virtual objects.
5. The method according to claim 4, wherein the using the selected subset of virtual object as the target virtual objects comprises:performing any one of the following processing:when the plurality of virtual objects are in an unselected state, using, in response to a trigger operation for any selection box, virtual objects in the selected selection box as the target virtual objects;when the plurality of virtual objects are in a selected state, using, in response to a trigger operation for any deletion control, virtual objects corresponding to the selected deletion control as the target virtual objects; orwhen the plurality of virtual objects are in a selected state, switching, in response to an interaction operation in a specific direction, a state of virtual objects corresponding to the specific direction to an unselected state, and using the virtual objects in the selected state as the target virtual objects.
6. The method according to claim 1, wherein the method further comprises:displaying a thumbnail of the three-dimensional image at a specific viewing angle, the specific viewing angle being a viewing angle used when the target area is displayed on the viewfinder interface; andsaving the three-dimensional image and the thumbnail to an electronic album, the thumbnail being used as preview information of the three-dimensional image in the electronic album.
7. The method according to claim 1, wherein the virtual scene comprises an electronic album entrance; and the method further comprises:displaying a thumbnail list in response to a trigger operation for the electronic album entrance, the thumbnail list comprising the thumbnail of the three-dimensional image;displaying the three-dimensional image in response to a viewing operation for the thumbnail; andperforming at least one of the following processing on the three-dimensional image:rotating, in response to a rotation operation in the three-dimensional image in a third direction, a display viewing angle of the three-dimensional image in the third direction;updating, in response to a translation operation in the three-dimensional image in a fourth direction, a display area of the three-dimensional image in the fourth direction;adjusting, in response to a size adjustment operation for the three-dimensional image, a display size of the three-dimensional image; oradjusting, in response to an adjustment operation for a size adjustment control in the three-dimensional image, a display size of the three-dimensional image.
8. The method according to claim 1, wherein the method further comprises:sending the three-dimensional image to a second electronic device in response to a sharing operation for the three-dimensional image, the three-dimensional image being configured for the second terminal device to display the target area in the virtual scene based on an original size.
9. The method according to claim 1, wherein the method further comprises:displaying a scene entrance;displaying, in response to a trigger operation for the scene entrance, the target area in the virtual scene based on the three-dimensional image and an original size, and displaying a first player character in the target area, the first player character being controlled by the first terminal device; andcontrolling, in response to a control operation for the first player character, the first player character to perform interaction in the target area.
10. The method according to claim 1, wherein the viewfinder interface is in a three-dimensional capturing mode; and the method further comprises:switching the three-dimensional capturing mode to a two-dimensional capturing mode in response to a switching operation for a capturing mode control, the two-dimensional capturing mode being configured for capturing a two-dimensional image comprising the target area.
11. The method according to claim 1, wherein the displaying a viewfinder interface in response to a viewfinder interface trigger operation for the virtual scene comprises:performing at least one of the following processing:displaying the viewfinder interface in response to receiving speech information for viewfinding of the virtual scene;displaying the viewfinder interface in response to receiving somatosensory information for viewfinding of the virtual scene; ordisplaying the viewfinder interface in response to a trigger operation for a capturing entrance in the virtual scene.
12. The method according to claim 1, wherein the viewfinder interface comprises a viewfinder box and a focusing box, the viewfinder box comprises the target area in the virtual scene, and the focusing box is configured for representing a focusing area when capturing is performed on the target area.
13. The method according to claim 1, wherein the generating the three-dimensional image of the clipped area comprises:obtaining three-dimensional data of the viewfinder interface in response to the capturing trigger operation for the viewfinder interface, the three-dimensional data comprising position, appearance, material, and light source information of the subset of the plurality of virtual objects in the virtual scene;performing modeling based on the three-dimensional data, to obtain a three-dimensional model; andrendering the three-dimensional model, to obtain the three-dimensional image comprising the target area.
14. An electronic device, comprising:a memory, configured to store computer-executable instructions or a computer program; anda processor, configured to execute the computer-executable instructions or the computer program stored in the memory, to implement a method for capturing a three-dimensional image of a virtual scene including:displaying a virtual scene;displaying a viewfinder interface, the viewfinder interface comprising a target area including a plurality of virtual objects in the virtual scene;in response to a capturing trigger operation for the viewfinder interface, clipping the target area through a virtual camera, the clipped area being an area whose distance to the virtual camera is between a first distance threshold and a second distance threshold in the target area, the first distance threshold being less than the second distance threshold, and the second distance threshold being less than a maximum camera-to-subject distance of the virtual camera; andgenerating a three-dimensional image of the clipped area, wherein the three-dimensional image includes a subset of the plurality of virtual objects in the target area.
15. The electronic device according to claim 14, wherein the method further comprises:hiding a graphic element unrelated to the target area in the virtual scene, the graphic element comprising at least one of the following: an operation control, a quest bar control, and a message bar.
16. The electronic device according to claim 14, wherein the clipping the target area through the virtual camera comprises:capturing, in the clipped area, a virtual object having a display completeness greater than a completeness threshold, the display completeness being a ratio of a part of the virtual object displayed in the clipped area to a part of the virtual object displayed in the virtual scene.
17. The electronic device according to claim 14, wherein the generating the three-dimensional image of the clipped area comprises:selecting, in the target area, a subset of the plurality of virtual objects whose distances to the virtual camera are less than a maximum camera-to-subject distance of the virtual camera;using the selected subset of virtual object as target virtual objects; andgenerating the three-dimensional image of the target virtual objects.
18. The electronic device according to claim 14, wherein the method further comprises:displaying a thumbnail of the three-dimensional image at a specific viewing angle, the specific viewing angle being a viewing angle used when the target area is displayed on the viewfinder interface; andsaving the three-dimensional image and the thumbnail to an electronic album, the thumbnail being used as preview information of the three-dimensional image in the electronic album.
19. The electronic device according to claim 14, wherein the generating the three-dimensional image of the clipped area comprises:obtaining three-dimensional data of the viewfinder interface in response to the capturing trigger operation for the viewfinder interface, the three-dimensional data comprising position, appearance, material, and light source information of the subset of the plurality of virtual objects in the virtual scene;performing modeling based on the three-dimensional data, to obtain a three-dimensional model; andrendering the three-dimensional model, to obtain the three-dimensional image comprising the target area.
20. A non-transitory computer-readable storage medium, having computer-executable instructions or a computer program stored therein, the computer-executable instructions or the computer program, when executed by a processor of an electronic device, causing the electronic device to implement a method for capturing a three-dimensional image of a virtual scene including:displaying a virtual scene;displaying a viewfinder interface, the viewfinder interface comprising a target area including a plurality of virtual objects in the virtual scene;in response to a capturing trigger operation for the viewfinder interface, clipping the target area through a virtual camera, the clipped area being an area whose distance to the virtual camera is between a first distance threshold and a second distance threshold in the target area, the first distance threshold being less than the second distance threshold, and the second distance threshold being less than a maximum camera-to-subject distance of the virtual camera; andgenerating a three-dimensional image of the clipped area, wherein the three-dimensional image includes a subset of the plurality of virtual objects in the target area.
