A method, apparatus, and device for interacting with objects in a scene.
By acquiring the two-dimensional coordinate information of click operations on the display interface and mapping it to the virtual scene position in the virtual engine, ray emission is used to detect objects and highlight them, solving the problem that users cannot easily and quickly select objects in the virtual scene and improving the user's interactive experience with the virtual scene.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, users cannot easily and quickly select objects in the virtual scene of the virtual engine, resulting in a reduced user interaction experience with the virtual scene.
By acquiring the two-dimensional coordinate information of the click operation on the display interface, mapping it to the real-time position in the virtual scene of the virtual engine, emitting a ray to that position to detect whether an object is touched, and highlighting the object as the target object on the display interface when an object is touched.
It enables simple and fast interaction between users and virtual scenes, improving the user experience, especially in terms of accuracy and convenience when selecting and moving objects in virtual scenes.
Smart Images

Figure CN115328318B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and device for interacting with objects in a scene. Background Technology
[0002] With the continuous development of internet technology, users have an increasing demand for interacting with virtual scenes while watching virtual live streams.
[0003] Based on existing methods, users cannot easily and quickly select objects in the virtual scene of the virtual engine on the client side, thus reducing the user's interactive experience with the virtual scene.
[0004] There is currently no effective solution to the aforementioned technical problems. Summary of the Invention
[0005] This specification provides an embodiment of a method, apparatus, and device for interacting with scene objects, which can easily and quickly realize interaction with scene objects according to user needs, thereby improving user experience.
[0006] On the one hand, this application provides a method for interacting with scene objects, including:
[0007] Obtain the two-dimensional coordinate information of the click operation on the display interface;
[0008] The two-dimensional coordinate information is mapped to the real-time position in the virtual scene of the virtual engine;
[0009] A ray is emitted toward the real-time location, and it is detected whether the ray touches an object in the virtual scene;
[0010] If it is determined that an object has been touched, the object matched by the ray is taken as the target object;
[0011] The image of the target object in the virtual scene is pushed to the display interface in real time for display.
[0012] Furthermore, the step of pushing the image of the target object in the virtual scene to the display interface in real time for display includes:
[0013] The matched object is rendered in the virtual engine to obtain a rendered image area;
[0014] Highlight the rendered area;
[0015] The highlighted rendered area is pushed to the display interface in real time for display.
[0016] Furthermore, after pushing the image of the target object in the virtual scene to the display interface in real time for display, the method further includes:
[0017] Obtain the movement operation of the target object in the display interface;
[0018] The movement operation is mapped to the virtual scene of the virtual engine, and the target object in the virtual scene is controlled to move according to the movement in the display interface.
[0019] Furthermore, obtaining the two-dimensional coordinate information of the click operation on the display interface includes:
[0020] Monitor the mouse position in the display interface;
[0021] When a mouse click operation is detected, the two-dimensional coordinate information corresponding to the position of the mouse click on the display interface is used as the two-dimensional coordinate information of the click operation.
[0022] Furthermore, after detecting whether the ray touches an object in the virtual scene, the process further includes:
[0023] Once it is determined that no object has been touched, the ray is removed.
[0024] On the other hand, this application provides an interactive device for scene objects, including:
[0025] The acquisition module is used to acquire the two-dimensional coordinate information of click operations on the display interface;
[0026] The positioning module is used to map the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine;
[0027] The detection module is used to emit rays to the real-time location and detect whether the rays touch objects in the virtual scene;
[0028] The selected module is used to select the object matched by the ray as the target object when it is determined that an object has been touched.
[0029] The display module is used to push the image of the target object in the virtual scene to the display interface for display in real time.
[0030] Furthermore, the device also includes:
[0031] An operation module is used to acquire movement operations on the target object in the display interface;
[0032] A movement module is used to map the movement operation onto the virtual scene of the virtual engine, and control the target object in the virtual scene to move according to the movement in the display interface.
[0033] Furthermore, the device also includes:
[0034] A clearing module is used to clear the ray if it is determined that no object has been touched.
[0035] On the other hand, this application also provides an interactive device for scene objects, including a processor and a memory for storing processor-executable instructions, wherein the processor executes the instructions to implement the steps of any method embodiment in the embodiments of this specification.
[0036] In another aspect, this application also provides a computer-readable storage medium storing computer instructions thereon, wherein the computer-readable storage medium executes the instructions to implement the method of object interaction in the above-mentioned scene.
[0037] This specification provides a method, apparatus, and device for interacting with objects in a scene. By acquiring the two-dimensional coordinate information of a click operation on the display interface and mapping the two-dimensional coordinate information to a real-time position in the virtual scene of the virtual engine, the position of the two-dimensional coordinate information of the click operation on the display interface in the virtual scene can be determined proportionally. This lays the foundation for subsequently emitting a ray to that position to detect the presence of an object. Furthermore, a ray is emitted to the real-time position, and it is detected whether the ray touches an object in the virtual scene. If an object is found to have been touched, the object matched by the ray is taken as the target object, and the image of the target object in the virtual scene is pushed to the display interface in real time for display, enabling user interaction with the virtual scene. This scheme can accurately and quickly detect the presence of objects in the virtual scene, and when an object is present, select and display it in real time, thereby improving the user's interactive experience with the virtual scene. Attached Figure Description
[0038] The accompanying drawings, which are included to provide a further understanding of this specification and form part of it, do not constitute a limitation thereof. In the drawings:
[0039] Figure 1 This is a flowchart illustrating an embodiment of a scene object interaction method provided in this specification;
[0040] Figure 2 This specification provides a display interface and virtual scene diagram as one embodiment.
[0041] Figure 3This is a virtual scene object detection map provided in one embodiment of this specification;
[0042] Figure 4 This is a scene object image transmission diagram provided in one embodiment of this specification;
[0043] Figure 5 This is a schematic diagram of the structural composition of an electronic device provided in one embodiment of this specification;
[0044] Figure 6 This is a schematic diagram of the structural composition of an interactive device for scene objects provided in another embodiment of this specification;
[0045] Figure 7 This is a schematic diagram of the structural composition of an interactive device for scene objects provided in another embodiment of this specification. Detailed Implementation
[0046] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments in this specification, and not all of the embodiments. Based on one or more embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the embodiments in this specification.
[0047] Existing methods for user interaction with a virtual scene typically require obtaining a set of labels or names of the objects to be selected and returning this set to the client. The client then selects the corresponding object based on the returned object labels and names, and the data is transmitted via a data exchange device. When the Unreal Engine receives the command to select an object, it selects and moves the corresponding object in the virtual scene. This method requires pre-receiving a set of all object labels in the virtual scene and determining the object's name to select it, thus enabling user interaction. The method of selecting objects is not simple, convenient, or accurate enough, which reduces the user's interaction experience with the virtual scene.
[0048] To address the aforementioned problems with existing methods, this application proposes an interactive method for scene objects that can replace the traditional method of selecting objects through a set of label names. This method allows for the selection and highlighting of objects in the virtual scene in a simpler and more convenient way, thereby improving the user's interactive experience with the virtual scene.
[0049] Based on the above approach, this specification proposes a method for interacting with scene objects. First, the two-dimensional coordinate information of a click operation on the display interface is obtained, and then the two-dimensional coordinate information is mapped to a real-time position in the virtual scene of the virtual engine. Second, a ray is emitted towards the real-time position, and it is detected whether the ray touches an object in the virtual scene. If an object is found to have been touched, the object matched by the ray is taken as the target object. Finally, the image of the target object in the virtual scene is pushed to the display interface in real time for display. It should be noted that this method for interacting with scene objects can run on a terminal device or a server. The server can be a cloud server deployed in the cloud, and the terminal device can be a desktop computer, tablet computer, laptop computer, smartphone, etc. Alternatively, the terminal device can also be a software application that can run on the aforementioned electronic devices. For example, it can be an app running on a mobile phone.
[0050] See Figure 1 As shown in the embodiments of this specification, an interaction method for scene objects is provided. In specific implementation, this method may include the following:
[0051] S101: Obtain the two-dimensional coordinate information of the click operation on the display interface.
[0052] In some embodiments, obtaining the two-dimensional coordinate information of the click operation on the display interface described above may, in specific implementation, include:
[0053] S1: Monitor the mouse position in the display interface;
[0054] S2: When a mouse click operation is detected, the two-dimensional coordinate information corresponding to the position clicked by the mouse on the display interface is used as the two-dimensional coordinate information of the click operation.
[0055] In some embodiments, the aforementioned display interface can be understood as the interface that the user can see on the display screen. The display screen can be a computer screen, a mobile phone screen, a tablet screen, etc., and this specification does not specifically limit it. It should be noted that the mouse position described above is only illustrative and can be adjusted according to the user's actual device. For example, when using a computer, the user can click the computer display interface with a mouse, so the mouse position needs to be detected; if the user is using a mobile phone, the user can tap and swipe to click the mobile phone display interface, so the tap and swipe position needs to be detected. This specification does not specifically limit it. The user can click on a certain area of the display interface (an area where the presence of an object is uncertain, such as a blank area) according to their needs, and determine the two-dimensional coordinate information of the click operation in that area. This can lay the data foundation for subsequently determining the two-dimensional coordinate information of the corresponding position in the virtual scene.
[0056] S102: Map the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine.
[0057] In some embodiments, the virtual engine can be obtained from the cloud or a preset memory. The virtual scene can be a scene generated based on the virtual engine and related algorithms. The virtual scene can be a scene in a simulated world, a completely virtual scene, or a semi-simulated, semi-virtual scene. The virtual scene can be a two-dimensional scene or a three-dimensional scene; this specification does not specifically limit this. It should be noted that the virtual scene in this specification is displayed in a two-dimensional manner on the display interface.
[0058] In some embodiments, the above mapping process may specifically include:
[0059] S1: Determine the viewport coordinates of the display interface and the viewport coordinates of the virtual scene;
[0060] S2: Determine the real-time position in the virtual scene based on the viewport coordinates of the display interface, the viewport coordinates of the virtual scene, and the two-dimensional coordinate information.
[0061] In some embodiments, see Figure 2As shown, the viewport mentioned above can be a rectangular area associated with a device, and the coordinate unit is a device-associated "pixel". For example, in a monitor, the viewport can represent the viewport of the display interface, which is a rectangular area associated with the display interface. In a virtual scene, the viewport can represent the viewport of the virtual scene, which is a rectangular area associated with the virtual scene. Taking the calculation of a point in the viewport as an example, assuming the coordinates of a point in the display interface viewport are (x1, y1), the coordinates of a point in the virtual scene viewport are (x2, y2), and the coordinates of the click operation in the display interface are (x, y), the real-time position coordinates in the virtual scene can be obtained using the following formula:
[0062]
[0063]
[0064] In the formula, (x, y) are the two-dimensional coordinates of the click operation in the display interface, (x1, y1) are the coordinates of a point in the viewport of the display interface, (x2, y2) are the coordinates of a point in the viewport of the virtual scene, and A is the real-time position coordinates in the virtual scene to be determined.
[0065] In some embodiments, the coordinates of a point in the display interface viewport and the coordinates of a point in the virtual scene viewport, as well as the two-dimensional coordinates of the click operation in the display interface and the real-time position coordinates in the virtual scene, have a one-to-one mapping relationship. By calculating proportionally, the real-time position in the virtual scene can be accurately determined when the display interface viewport and the virtual scene viewport are not the same size, that is, the real-time position coordinate information at that real-time position can be determined.
[0066] S103: Emit a ray to the real-time location and detect whether the ray touches an object in the virtual scene.
[0067] In some embodiments, see Figure 3 As shown, a ray can be generated in the direction of a virtual camera's position and emitted towards the real-time location. The system can detect whether this ray touches an object in the virtual scene to determine if the object has been selected. The virtual camera can be a virtual scene capturing device built on a server-side 3D engine software. The emitted ray can send an imaginary "laser beam" from the origin along its direction until it hits a colliding object in the scene. Detecting object collisions by emitting a ray from a virtual camera provides a more convenient way to quickly and easily select objects later.
[0068] S104: If it is determined that an object has been touched, the object matched by the ray is taken as the target object.
[0069] S105: Push the image of the target object in the virtual scene to the display interface in real time for display.
[0070] In some embodiments, after detecting whether the ray touches an object in the virtual scene, the process may further include:
[0071] Once it is determined that no object has been touched, the ray is removed.
[0072] In some embodiments, by clearing useless rays when no object is selected, the accuracy of subsequent object selection can be guaranteed.
[0073] In some embodiments, the above-described method of pushing the image of the target object in the virtual scene to the display interface in real time for display may, in specific implementation, include:
[0074] S1: Render the image of the matched object in the virtual engine to obtain the rendered image area;
[0075] S2: Highlight the rendered area;
[0076] S3: The highlighted rendered area is pushed to the display interface in real time for display.
[0077] In some real-time examples, see Figure 4 As shown, the selected and highlighted object in the virtual scene can be transmitted to the display interface in real time via a real-time image transmission device for display.
[0078] In some embodiments, the name information of the selected object in the virtual scene can be transmitted to the display interface via a real-time image transmission device for display, according to the user's actual needs. The rendered image, obtained through highlighting, lays the foundation for the user to accurately and efficiently move the selected object on the display interface subsequently.
[0079] In some embodiments, after the above-described method of pushing the image of the target object in the virtual scene to the display interface in real time for display, the method may further include:
[0080] S1: Obtain the movement operation of the target object in the display interface;
[0081] S2: Map the movement operation to the virtual scene of the virtual engine, and control the target object in the virtual scene to move according to the movement in the display interface.
[0082] In some embodiments, by moving a target object (i.e., the selected object) in the display interface, the user can map the movement operation to a virtual scene, causing objects in the virtual scene to perform the same operation, greatly improving the user's interactive experience with the virtual scene. The movement operation can also be set to rotation, jump, etc., according to the user's actual needs; this specification does not specifically limit this.
[0083] The above method will be described below with reference to a specific embodiment. However, it is worth noting that this specific embodiment is only for better illustration of this application and does not constitute an improper limitation of this application.
[0084] In practice, the process begins with the user clicking on the display interface to obtain the two-dimensional coordinates of the click. These coordinates are then mapped to a real-time position within the virtual scene of the virtual engine. A ray is then emitted towards this real-time position, and the system detects whether the ray touches an object in the virtual scene. If an object is touched, the object matched by the ray is selected as the target object, highlighted, and then displayed in real-time on the display interface. Further, the target object on the display interface is moved and rotated, and this movement is mapped back to the virtual scene, causing the objects in the virtual scene to move accordingly. If an object is touched, the emitted ray is cleared to avoid affecting subsequent object detection. This method allows for simple, fast, and accurate selection of objects in the scene, highlighting them on the display interface, and enabling movement of the selected object, thus improving the user's interaction with the virtual scene.
[0085] This application also provides a computer device, including a processor and a memory for storing processor-executable instructions. Specifically, the processor can perform the following steps according to the instructions: acquiring two-dimensional coordinate information of a click operation on a display interface; mapping the two-dimensional coordinate information to a real-time position in a virtual scene of a virtual engine; emitting a ray towards the real-time position and detecting whether the ray touches an object in the virtual scene; if it is determined that an object has been touched, using the object matched by the ray as the target object; and pushing the image of the target object in the virtual scene to the display interface in real time for display.
[0086] To execute the above instructions more accurately, please refer to... Figure 5 As shown, this application also provides another specific computer device, wherein the computer device includes a network communication port 501, a processor 502 and a memory 503, and the above structures are connected by internal cables so that the various structures can perform specific data interaction.
[0087] Specifically, the network communication port 501 can be used to obtain the two-dimensional coordinate information of the click operation on the display interface.
[0088] The processor 502 can be specifically used to map the two-dimensional coordinate information to a real-time position in the virtual scene of the virtual engine; emit a ray to the real-time position and detect whether the ray touches an object in the virtual scene; if it is determined that an object has been touched, take the object matched by the ray as the target object; and push the image of the target object in the virtual scene to the display interface for display in real time.
[0089] The memory 503 can be used to store the corresponding instruction program.
[0090] In this embodiment, the network communication port 501 can be a virtual port bound to different communication protocols, thereby enabling the sending or receiving of different data. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. Furthermore, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM or CDMA; it can also be a Wi-Fi chip; or it can be a Bluetooth chip.
[0091] In this embodiment, the processor 502 can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. This specification is not limiting.
[0092] In this embodiment, the memory 503 may include multiple layers. In a digital system, anything that can store binary data can be a memory. In an integrated circuit, a circuit with storage function but no physical form is also called a memory, such as RAM, FIFO, etc. In a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0093] This application also provides a computer storage medium for interaction based on the above-mentioned scene objects. The computer storage medium stores computer program instructions, which, when executed, perform the following: acquiring two-dimensional coordinate information of a click operation on the display interface; mapping the two-dimensional coordinate information to a real-time position in the virtual scene of the virtual engine; emitting a ray to the real-time position and detecting whether the ray touches an object in the virtual scene; if it is determined that an object has been touched, taking the object matched by the ray as the target object; and pushing the image of the target object in the virtual scene to the display interface in real time for display.
[0094] In this embodiment, the storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), cache, hard disk drive (HDD), or memory card. The memory can be used to store computer program instructions. The network communication unit can be an interface configured according to the standards specified in the communication protocol for network connection communication.
[0095] In this embodiment, the specific functions and effects implemented by the program instructions stored in the computer storage medium can be explained in comparison with other implementation methods, and will not be repeated here.
[0096] Based on the above-described method for interacting with scene objects, this specification also provides an embodiment of a device for interacting with scene objects. (See attached document.) Figure 6 As shown, the device may specifically include the following structural modules:
[0097] The acquisition module 601 is used to acquire the two-dimensional coordinate information of the click operation on the display interface;
[0098] The positioning module 602 is used to map the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine;
[0099] Detection module 603 is used to emit a ray to the real-time location and detect whether the ray touches an object in the virtual scene;
[0100] Select module 604, which is used to select the object matched by the ray as the target object when it is determined that an object has been touched;
[0101] Display module 605 is used to push the image of the target object in the virtual scene to the display interface for display in real time.
[0102] In some embodiments, the acquisition module 601 can be specifically used to monitor the mouse position in the display interface; when a mouse click operation is detected, the two-dimensional coordinate information corresponding to the position clicked by the mouse on the display interface is used as the two-dimensional coordinate information of the click operation.
[0103] The aforementioned display module 605 can be used to render the matched object's image in the virtual engine to obtain a rendered image area; to highlight the rendered image area; and to push the highlighted rendered image area to the display interface for display in real time.
[0104] In some embodiments, the detection module 603 may further include:
[0105] A clearing module is used to clear the ray if it is determined that no object has been touched.
[0106] In some embodiments, see Figure 7 As shown, the device further includes:
[0107] Operation module 701 is used to acquire movement operations on the target object in the display interface;
[0108] The movement module 702 is used to map the movement operation to the virtual scene of the virtual engine and control the target object in the virtual scene to move according to the movement in the display interface.
[0109] It should be noted that the units, devices, or modules described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. For ease of description, the above devices are described by dividing them into various modules according to their functions. Of course, in implementing this specification, the functions of each module can be implemented in one or more software and / or hardware, or the module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection between the devices or units shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0110] As can be seen from the above, the scene object interaction device provided in the embodiments of this specification can, on the one hand, obtain the two-dimensional coordinate information of the click operation on the display interface according to the user's actual usage needs, then map the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine, emit a ray to the real-time position, and detect whether the ray touches an object in the virtual scene, thereby simply and quickly determining whether there is an object at the user's click location; on the other hand, if it is determined that an object has been touched, the object matched by the ray is taken as the target object, and the image of the target object in the virtual scene is pushed to the display interface in real time for display, which can improve the user's interactive experience with the virtual scene.
[0111] Furthermore, by performing a movement operation on the target object in the display interface and then mapping the movement operation to a virtual scene, the object in the virtual scene can be controlled to move according to the movement in the display interface. This allows for simple and quick movement of scene objects, improving the user experience.
[0112] Furthermore, by clearing the rays when it is certain that no object was touched, it can be ensured that the colliding object can be detected accurately in subsequent object detection without being interfered with by the original rays.
[0113] While this specification provides the steps of operation for the methods described in the embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or client product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded. The terms "first," "second," etc., are used to denote names and do not indicate any particular order.
[0114] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.
[0115] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0116] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this specification can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of this specification can essentially be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of this specification.
[0117] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. This specification can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0118] Although this specification has been described by way of examples, those skilled in the art will recognize that many variations and modifications are possible without departing from the spirit of this specification, and it is intended that the appended claims cover such variations and modifications without departing from the spirit of this specification.
Claims
1. A method for interacting with objects in a scene, characterized in that, include: Obtain the two-dimensional coordinate information of the click operation on the display interface; The two-dimensional coordinate information is mapped to the real-time position in the virtual scene of the virtual engine; A ray is emitted toward the real-time location, and it is detected whether the ray touches an object in the virtual scene; If it is determined that an object has been touched, the object matched by the ray is taken as the target object; The image of the target object in the virtual scene is pushed to the display interface in real time for display. The step of mapping the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine includes: Determine the viewport coordinates of the display interface and the viewport coordinates of the virtual scene; The real-time position in the virtual scene is determined based on the viewport coordinates of the display interface, the viewport coordinates of the virtual scene, and the two-dimensional coordinate information. The coordinates of the real-time location in the virtual scene are: Where (x, y) are the two-dimensional coordinates of the click operation in the display interface, (x1, y1) are the coordinates of a point in the viewport of the display interface, (x2, y2) are the coordinates of a point in the viewport of the virtual scene, and A is the real-time position coordinates in the virtual scene to be determined.
2. The method according to claim 1, characterized in that, Pushing the image of the target object in the virtual scene to the display interface in real time for display includes: The matched object is rendered in the virtual engine to obtain a rendered image area; Highlight the rendered area; The highlighted rendered area is pushed to the display interface in real time for display.
3. The method according to claim 1, characterized in that, After pushing the image of the target object in the virtual scene to the display interface in real time for display, the method further includes: Obtain the movement operation of the target object in the display interface; The movement operation is mapped to the virtual scene of the virtual engine, and the target object in the virtual scene is controlled to move according to the movement in the display interface.
4. The method according to claim 1, characterized in that, Obtain the two-dimensional coordinate information of the click operation on the display interface, including: Monitor the mouse position in the display interface; When a mouse click operation is detected, the two-dimensional coordinate information corresponding to the position of the mouse click on the display interface is used as the two-dimensional coordinate information of the click operation.
5. The method according to claim 1, characterized in that, After detecting whether the ray touches an object in the virtual scene, the process further includes: Once it is determined that no object has been touched, the ray is removed.
6. An interactive device for scene objects, characterized in that, It includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of the method according to any one of claims 1-5.
7. An interactive device for scene objects, characterized in that, include: The acquisition module is used to acquire the two-dimensional coordinate information of click operations on the display interface; The positioning module is used to map the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine; The detection module is used to emit rays to the real-time location and detect whether the rays touch objects in the virtual scene; The selected module is used to select the object matched by the ray as the target object when it is determined that an object has been touched. The display module is used to push the image of the target object in the virtual scene to the display interface for display in real time. The step of mapping the two-dimensional coordinate information to the real-time position in the virtual scene of the virtual engine includes: Determine the viewport coordinates of the display interface and the viewport coordinates of the virtual scene; The real-time position in the virtual scene is determined based on the viewport coordinates of the display interface, the viewport coordinates of the virtual scene, and the two-dimensional coordinate information. The coordinates of the real-time location in the virtual scene are: Where (x, y) are the two-dimensional coordinates of the click operation in the display interface, (x1, y1) are the coordinates of a point in the viewport of the display interface, (x2, y2) are the coordinates of a point in the viewport of the virtual scene, and A is the real-time position coordinates in the virtual scene to be determined.
8. The apparatus according to claim 7, characterized in that, The device further includes: An operation module is used to acquire movement operations on the target object in the display interface; A movement module is used to map the movement operation to the virtual scene of the virtual engine and control the target object in the virtual scene to move according to the movement in the display interface.
9. The apparatus according to claim 7, characterized in that, The device further includes: A clearing module is used to clear the ray if it is determined that no object has been touched.
10. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed, implement the steps of the method according to any one of claims 1-5.
Citation Information
Patent Citations
Method for realizing interactive operation of 3D graphical interface
CN101770324A
Method and apparatus for associating actual object information in video monitoring image
CN105096382A