Page operation method and device, equipment, medium and program product
By obtaining the pixel transparency of the operation position and using the calculation shader to read the pixel color value, the mouse position recognition problem during interaction between web pages and three-dimensional scenes in Unity is solved, and efficient interactive operation is achieved.
Patent Information
- Application Number
- CN202411819917.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-11
AI Technical Summary
In Unity project development, when embedding web pages using the 3D WebView plug-in, it is impossible to correctly distinguish whether the current mouse position is the web page content or a three-dimensional object in a three-dimensional scene, resulting in the click event being unable to be triggered or processed correctly.
By obtaining the pixel transparency of the operation position, the calculation shader in the GPU directly reads the pixel color value of the specified texture operation position, obtains the pixel transparency value from it, and determines whether the current operation position is a pure three-dimensional scene or an interactive UI of the operable interface.
It realizes the accurate distinction between the operation position of a two-dimensional operable interface or a three-dimensional scene, and performs corresponding interactions based on the determined scene type, which has high processing efficiency and low consumption of system resources.
Smart Images

Figure CN119806700A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics technology, and in particular to a page operation method, device, equipment, medium and program product. Background Art
[0002] In Unity project development, some web pages with frequent and complex UI updates, or a Unity application that needs to support different project development, usually use the 3D WebView plug-in to directly embed web page content into the Unity application. The UI elements in the web page are usually on the sides of the screen, at the top or bottom, or in the middle of the pop-up window. When users operate the Unity application, they usually hope to operate the 3D scene in addition to the actual content of the web page. Conversely, when operating the web page, they do not want the operation events to be passed to the 3D scene through the web page. However, when using the WebView plug-in to embed a web page, the web page content will be rendered into an image, passed to the Image component of Unity UI, and covered on the Unity scene, so the mouse will be considered to be operating Unity's UI elements at any position on the screen, and it is impossible to correctly distinguish whether the current position of the mouse is the web page content or the 3D object in the 3D scene.
[0003] Therefore, there is an urgent need for a page operation method that can accurately identify whether the operation area of the page is a three-dimensional scene or a two-dimensional operable interface. Summary of the invention
[0004] In view of this, the present application provides a page operation method, device, equipment, medium and program product, which can accurately identify whether the operation area is a three-dimensional scene or a two-dimensional operable interface. The technical solution is as follows.
[0005] In a first aspect, the present invention provides a page operation method, the method comprising:
[0006] In response to a trigger operation on a first position in a target page, a two-dimensional coordinate of the first position is acquired; the target page includes a three-dimensional scene and an operable interface overlaid on the three-dimensional scene.
[0007] Obtain a first transparency corresponding to the two-dimensional coordinates of the first position.
[0008] The scene type of the first position is determined according to the first transparency; the scene type is one of a three-dimensional scene and an operable interface.
[0009] According to the scene type of the first position, a trigger operation of the first position is performed.
[0010] The page operation method provided by the present invention has the following advantages.
[0011] The page operation method of the present invention is applied to a target page, and the target page includes a three-dimensional scene and an operable interface covered on the three-dimensional scene. When there is a trigger operation on the target page, the first position corresponding to the trigger operation on the target page is obtained, and the trigger operation can be a mouse click. If the target page is on a touchable screen, it can be a touch operation of a user's finger. The two-dimensional coordinates of the trigger operation position are obtained, and the pixel color value of the position is obtained based on the two-dimensional coordinates, and then the alpha channel value of the pixel color value is read from the pixel color value as the transparency value of the first position. The acquisition of the transparency value can use the calculation shader in the GPU to directly read the pixel color value of the specified texture operation position, and obtain the pixel transparency value therefrom. Since the operable interface is covered on the three-dimensional scene, the area without UI elements in the target texture of the operable interface is completely transparent, that is, the three-dimensional scene area not blocked by the interface, and the pixel value of the area with UI elements is opaque or translucent, that is, the area where the page UI interaction can be performed, so the transparency of the pixel can be used to determine whether the current operation position is a pure three-dimensional scene or an interactive UI of the operable interface. Based on the transparency value of the first position, the scene type of the first position is determined, and then according to the different scene types, three-dimensional scene interaction or operable interface interaction is realized. By obtaining the pixel transparency of the operation position, it is possible to accurately distinguish whether the operation position is a two-dimensional operable interface or a three-dimensional scene, and then perform corresponding interactive operations based on the determined scene type. This method can accurately identify whether the operation area is a three-dimensional scene or a two-dimensional operable interface, and only needs to calculate the pixel transparency value of the operation position, so the processing efficiency is high and the consumption of system resources is low.
[0012] In an optional implementation, determining the scene type of the first position according to the first transparency includes: when the first transparency value is 0, determining the first position as a three-dimensional scene; when the first transparency value is not 0, determining the first position as an operable interface.
[0013] In an optional embodiment, obtaining the first transparency corresponding to the two-dimensional coordinates of the first position includes: converting the two-dimensional coordinates of the first position into first pixel coordinates; obtaining the first pixel color value of the first position based on the first pixel coordinates and the rendering target texture of the operable interface; and determining the value of the alpha channel in the first pixel color value as the first transparency.
[0014] In an optional embodiment, according to the scene type of the first position, the trigger operation of the first position is performed, including: when the scene type of the first position is a three-dimensional scene, initiating ray detection to interact with the three-dimensional scene according to the trigger operation of the first position; when the scene type of the first position is an operable interface, performing an operable interface interaction based on the first position.
[0015] In an optional embodiment, ray detection is initiated to interact with the three-dimensional scene according to a trigger operation of the first position, including: according to the trigger operation of the first position, determining a three-dimensional model corresponding to the first position in the three-dimensional scene to obtain a first operation object; and initiating ray detection to interact with the first operation object.
[0016] In an optional embodiment, performing an operable interface interaction based on a first position includes: determining an operation control corresponding to the first position on the operable interface according to a trigger operation of the first position to obtain a second operation object; and interacting with the second operation object.
[0017] In a second aspect, the present invention provides a page operation device, the device comprising:
[0018] The coordinate acquisition module is used to acquire the two-dimensional coordinates of the first position in response to a trigger operation on the first position in the target page; the target page includes a three-dimensional scene and an operable interface overlaid on the three-dimensional scene.
[0019] The transparency acquisition module is used to acquire a first transparency corresponding to the two-dimensional coordinates of the first position.
[0020] The scene type confirmation module is used to determine the scene type of the first position according to the first transparency; the scene type is one of a three-dimensional scene and an operable interface.
[0021] The execution module is used to execute the trigger operation of the first position according to the scene type of the first position.
[0022] In an optional implementation, the scene type confirmation module is specifically used to: when the first transparency is 0, determine that the first position is a three-dimensional scene; when the first transparency is not 0, determine that the first position is an operable interface.
[0023] In an optional embodiment, the transparency acquisition module is specifically used to: convert the two-dimensional coordinates of the first position into first pixel coordinates; obtain the first pixel color value of the first position at the first pixel coordinates and the rendering target texture of the operable interface; and determine the value of the alpha channel in the first pixel color value as the first transparency.
[0024] In an optional embodiment, the execution module is specifically used to: when the scene type of the first position is a three-dimensional scene, initiate ray detection to interact with the three-dimensional scene according to the trigger operation of the first position; when the scene type of the first position is an operable interface, perform operable interface interaction based on the first position.
[0025] In an optional embodiment, the execution module is further used to: determine the three-dimensional model corresponding to the first position in the three-dimensional scene according to the trigger operation of the first position to obtain a first operation object; and initiate ray detection to interact with the first operation object.
[0026] In an optional implementation, the execution module is further used to: determine the operation control corresponding to the first position on the operable interface according to the trigger operation of the first position to obtain a second operation object; and interact with the second operation object.
[0027] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the page operation method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0028] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the page operation method of the first aspect or any corresponding embodiment thereof.
[0029] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the page operation method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 It is a flow chart of a page operation method provided by an embodiment of the present invention.
[0032] Figure 2 is a schematic diagram of a target page according to an exemplary embodiment.
[0033] Figure 3 The figure is a flow chart of a page operation method according to an exemplary embodiment.
[0034] Figure 4 The figure is a schematic diagram showing transparency of a three-dimensional scene and an operable interface according to an exemplary embodiment.
[0035] Figure 5 It is a structural schematic diagram of a page operation device provided in an embodiment of the present application.
[0036] Figure 6 It is a structural schematic diagram of a computer device provided by an optional embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0038] It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.
[0039] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.
[0040] In an embodiment of the present application, "predefinition" can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a terminal device and a network device). The present application does not limit its specific implementation method.
[0041] First, the terms involved in this application are introduced.
[0042] Unity: A cross-platform game development engine.
[0043] 3DWebView Plugin: A plugin that allows embedding and rendering web content in Unity.
[0044] UnityImageUI component: UI component provided by Unity, used to render texture images.
[0045] RectTransformUtility.ScreenPointToLocalPointInRectangle: Converts the mouse screen coordinates to the local coordinates of the target rectangular area.
[0046] Ray detection: A technique in Unity that detects collisions with objects in the scene by emitting a virtual ray.
[0047] EventSystem.current.IsPointerOverGameObject() method: API provided by Unity, used to detect whether the mouse is hovering over a system UI element.
[0048] Computeshader: A technology for performing general-purpose computing on a graphics processing unit (GPU). Shader programs running on the GPU are used for parallel computing.
[0049] AsyncGPUReadbackRequest: An asynchronous call method in Unity used to asynchronously read data on the GPU.
[0050] Transparency channel: One of the four channels of pixel color, indicating the transparency of the pixel, usually ranging from 0 to 1, with 0 representing complete transparency and 1 representing complete opacity.
[0051] Application.CaptureScreenshotAsTexture: API provided by Unity to capture screenshots into Texture2D objects.
[0052] Texture2D.ReadPixels(): API provided by Unity for reading pixel data from a Texture2D object.
[0053] In Unity development, it is a common requirement to combine 2D UI elements with 3D scenes. UI elements in web pages are usually on the sides of the screen, at the top or bottom, or in pop-ups in the middle. Problems may occur when UI elements interact with objects in the 3D scene, such as click events not being triggered or processed correctly. When users operate Unity applications, they usually hope to operate the 3D scene in addition to the actual content of the web page. Conversely, when operating the web page, they do not want the operation events to be passed to the 3D scene through the web page. However, when using the WebView plug-in to embed a web page, the web page content will be rendered into an image, passed to the Image component of UnityUI, and covered on the Unity scene, so the mouse will be considered to be operating Unity's UI elements anywhere on the screen.
[0054] The EventSystem.current.IsPointerOverGameObject() method provided by Unity can only effectively distinguish Unity's own UI elements and game scenes. When using the WebView plug-in to embed a web page, IsPointerOverGameObject() will return true no matter where the mouse operates on the web page, indicating that the UI element has been operated. It cannot correctly distinguish whether the current mouse position is the web page content or the 3D object in the game scene.
[0055] Therefore, the embodiment of the present invention provides a page operation method, which can accurately distinguish whether the operation position is a two-dimensional operable interface or a three-dimensional scene by obtaining the pixel transparency of the operation position, and then perform corresponding interactive operations based on the determined scene type, with high processing efficiency and low consumption of system resources. The process of the method is as follows Figure 1 As shown, the following steps are included.
[0056] S101. In response to a trigger operation on a first position in a target page, obtain the two-dimensional coordinates of the first position; the target page includes a three-dimensional scene and an operable interface overlaid on the three-dimensional scene.
[0057] Specifically, in step S101, the target page includes a three-dimensional scene and a two-dimensional operable interface, such as Figure 2 As shown, the yellow box area is a three-dimensional scene, the red box area contains a two-dimensional operable interface and a three-dimensional scene, and the two-dimensional operable interface in the red box area is covered on the three-dimensional scene.
[0058] Optionally, in step S101, the trigger operation can be a mouse click operation, a user's finger touch operation, or a keyboard trigger. Although the keyboard event does not directly correspond to the touch operation of the screen, it can be set to be triggered when the user presses a key on the keyboard, or when the user continues to hold down a key on the keyboard.
[0059] Optionally, in step S101, in Unity or other development environments, there are multiple ways to obtain the two-dimensional coordinates of the touch point on the display screen. In Unity, you can use the Input.GetTouch(int index).position method to obtain the screen coordinates of a specified touch point, where index represents the index of the touch point (usually starting from 0). You can also use Input.mousePosition to obtain the current screen coordinates of the mouse pointer, where the coordinates are two-dimensional coordinates relative to the lower left corner of the screen. For 2D UI elements (such as buttons, text boxes, etc.), you can directly use the UI coordinate system to obtain the position of the touch point or mouse pointer relative to the UI element.
[0060] S102: Obtain a first transparency corresponding to the two-dimensional coordinates of the first position.
[0061] Optionally, in step S102, obtaining the transparency value corresponding to the two-dimensional coordinates of the first position specifically includes: converting the two-dimensional coordinates of the first position into first pixel coordinates; obtaining the first pixel color value of the first position based on the first pixel coordinates and the rendering target texture of the operable interface; and determining the value of the alpha channel in the first pixel color value as the first transparency.
[0062] Optionally, in the above steps, the color transparency value of the operation position is obtained based on its pixel color value. In Unity, obtaining the pixel color value of the touch position or the mouse click position usually involves converting the screen coordinates into texture coordinates, and reading the pixel data of the rendered texture or screenshot to obtain the color transparency value of the operation position. For example, ScreenCapture.CaptureScreenshotAsTexture() is used to take a screenshot of the specified pixel position of the web page image, and the color is stored in the texture; or Texture2D.ReadPixels() is directly used to read the pixel information from the web page image, and the actual content of the texture is the content of the two-dimensional operable interface. However, these methods all need to be processed on the CPU, which is inefficient, especially under high-resolution screens, and the performance bottleneck is obvious. Compared with CPU processing, GPU processing consumes less system resources. Therefore, this embodiment adopts a method based on Computer Shader to directly read the pixel color value of the target texture specifying the operation position. Computer Shader is a program running on the GPU. Using Compute Shader to process pixel data on the GPU, the color value of the specified pixel point of the target texture can be directly read, which can significantly improve the processing efficiency.
[0063] S103: Determine a scene type at the first position according to the first transparency; the scene type is one of a three-dimensional scene and an operable interface.
[0064] Specifically, in step S103, the range of the first transparency is 0 to 1. When the first transparency is 0, it indicates that the operation position is completely transparent, and the first position can be determined to be a three-dimensional scene; when the first transparency is not 0, it indicates that the operation position is semi-transparent or completely semi-transparent, and the first position can be determined to be an operable interface.
[0065] S104. Execute a trigger operation of the first position according to the scene type of the first position.
[0066] Specifically, in step S104, different interactions are selected according to the scene type of the operation position. When it is determined that the scene type of the first position is a three-dimensional scene, ray detection is initiated to interact with the three-dimensional scene according to the trigger operation of the first position; when it is determined that the scene type of the first position is a two-dimensional operable interface, an operable interface interaction based on the first position is performed.
[0067] Optionally, in the above steps, ray detection is initiated to interact with the three-dimensional scene according to the trigger operation of the first position. The interaction includes highlighting the three-dimensional scene or triggering the corresponding scene animation. At this time, the user is allowed to operate the three-dimensional objects in the three-dimensional scene, such as first clicking on a specific three-dimensional model in the three-dimensional scene, and then holding down the mouse to move or rotate the three-dimensional model, or operating the mouse wheel to zoom the three-dimensional model. When interacting with the operable interface, the user is not allowed to operate the three-dimensional scene, and relevant interactions can be performed according to the specific operation controls clicked or touched by the user on the operable interface.
[0068] In order to better illustrate the page operation method described in the embodiment of the present invention, an example will be used for specific description based on the above embodiment.
[0069] The target page of this example is Figure 2 As shown, the two-dimensional UI page covers the entire scene, so ordinary mouse response events will be intercepted by the entire Web page, and interaction with the three-dimensional scene can only be performed by ray detection, because ray detection can penetrate the UI interface. Figure 2 In the figure, the yellow box area is a 3D scene, and the red box area contains a 2D operable interface and a 3D scene. The 2D operable interface in the red box area is overlaid on the 3D scene. Users expect that when operating the red box area, only UI interaction events will be triggered, and the 3D scene will not be operated (for example, when clicking a page button, ray detection will not be initiated, causing the object behind the UI to respond to the click event; when dragging a page component, the 3D scene will not be moved). At the same time, users also hope to be able to directly operate the 3D scene only when operating the yellow box area.
[0070] When using ScreenCapture.CaptureScreenshotAsTexture and Texture2D.ReadPixels to obtain pixel color values, pixel-by-pixel reading is inevitable. The higher the resolution, the more pixels need to be traversed, especially since the operation is performed at the CPU level. At ultra-high resolutions, the CPU's pixel-by-pixel reading speed cannot match the GPU rendering speed, resulting in screen freezes. The Computer Shader used in this example is a program running on the GPU that can directly read the color value of a specified pixel of the target texture, so it can still guarantee good performance at high resolutions.
[0071] The method flow of this example is as follows Figure 3 As shown, taking clicking the target page with a mouse as an example, the specific steps include the following steps.
[0072] Get mouse coordinates: In Unity, get the current screen coordinates of the mouse through mouse events.
[0073] The pixel color value corresponding to the mouse click position coordinates is calculated through the Compute Shader program, which has a two-dimensional texture input parameter, a buffer output, and a kernel function. The input texture is the rendering target texture of the embedded web page content, which is obtained from the Unity Image UI component. The actual content of this texture is the web page content. The output buffer is used to store the color RGBA value of the specified pixel. The kernel function is used to take the converted mouse pixel coordinates as parameters, obtain the color value of the specified pixel from the input texture according to this coordinate, and write it to the output buffer. This conversion is to convert the mouse screen coordinates into pixel coordinates based on the input texture through RectTransformUtility.ScreenPointToLocalPointInRectangle.
[0074] Use AsyncGPUReadbackRequest to asynchronously read the pixel color value calculated by Compute Shader and analyze the Alpha channel value of the pixel color value. If the Alpha value is 0, it means that the pixel is completely transparent, indicating that the mouse is operating a 3D object in the application; if the Alpha value is not 0, it means that the pixel is opaque or semi-transparent, indicating that the mouse is operating embedded web content.
[0075] The judgment result of the mouse operation area is used to perform different interactions, such as whether to move, rotate, and scale the 3D scene, whether to emit rays to interact with the 3D scene, and all other events that require distinguishing the mouse operation area before they can be performed. Ultimately, accurate interaction between the Unity application 3D scene and the UI web page content is achieved.
[0076] This example uses Computer Shader to obtain the pixel color value of the mouse click or touch position, and then asynchronously reads the pixel color value calculated by Compute Shader through AsyncGPUReadbackRequest, and reads the Alpha channel value of the pixel color value from it. The Alpha channel value is the transparency value of the operation position. The transparency value can accurately distinguish the scene type of the operation position, such as Figure 4 As shown, it includes transparent areas and non-transparent areas. The 3D scene area in the yellow box is completely transparent, and the UI interface area in the red box is semi-transparent or opaque because it covers the 3D scene. Computer Shader can accurately identify the operation area and distinguish whether Unity's operation position is a 3D scene or UI web page content. It has high processing efficiency, low latency, and high performance.
[0077] In summary, the page operation method provided by the embodiment of the present invention is applied to a target page, and the target page includes a three-dimensional scene and a course operation interface covered on the three-dimensional scene. When there is a trigger operation on the target page, the first position corresponding to the trigger operation on the target page is obtained, and the trigger operation can be a mouse click. If the target page is on a touchable screen, it can be a touch operation of the user's finger. The two-dimensional coordinates of the trigger operation position are obtained, and the pixel color value of the position is obtained based on the two-dimensional coordinates, and then the alpha channel value of the pixel color value is read from the pixel color value as the transparency value of the first position. The acquisition of the transparency value can use the calculation shader in the GPU to directly read the pixel color value of the operation position, and obtain the pixel transparency value therefrom. Since the pixel value of the area without actual UI elements in the operable interface is completely transparent, the area with UI elements is opaque or translucent, and the entire operable interface is covered on the three-dimensional scene, then it can be considered that the completely transparent area is the area of the pure three-dimensional scene, so the pixel transparency of the target texture of the operable interface can be used to determine whether the current operation position is a three-dimensional scene or an interactive UI of the operable interface. Based on the transparency value of the first position, the scene type of the first position is determined, and then according to the different scene types, three-dimensional scene interaction or operable interface interaction is realized. By obtaining the pixel transparency of the operation position, it is possible to accurately distinguish whether the operation position is a two-dimensional operable interface or a three-dimensional scene, and then perform corresponding interactive operations based on the determined scene type. This method can accurately identify whether the operation area is a three-dimensional scene or a two-dimensional operable interface, and only needs to calculate the pixel transparency value of the operation position, so the processing efficiency is high and the consumption of system resources is low.
[0078] In the embodiments of the present application, a page operation device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0079] The present application embodiment provides a page operation device, Figure 5 : is a schematic diagram of a page operation device provided in an embodiment of the present application, the device comprising:
[0080] The coordinate acquisition module 501 is used to acquire the two-dimensional coordinates of the first position in response to a trigger operation on the first position in the target page; the target page includes a three-dimensional scene and an operable interface overlaid on the three-dimensional scene.
[0081] The transparency acquisition module 502 is used to acquire a first transparency corresponding to the two-dimensional coordinates of the first position.
[0082] The scene type confirmation module 503 is used to determine the scene type of the first position according to the first transparency; the scene type is one of a three-dimensional scene and an operable interface.
[0083] The execution module 504 is used to execute the trigger operation of the first position according to the scene type of the first position.
[0084] In an optional implementation, the scene type confirmation module 503 is specifically used to: when the first transparency value is 0, determine that the first position is a three-dimensional scene; when the first transparency value is not 0, determine that the first position is an operable interface.
[0085] In an optional embodiment, the transparency acquisition module 502 is specifically used to: convert the two-dimensional coordinates of the first position into a first pixel coordinate; obtain the first pixel color value of the first position at the first pixel coordinate and the rendering target texture of the operable interface; and determine the value of the alpha channel in the first pixel color value as the first transparency.
[0086] In an optional embodiment, the execution module 504 is specifically used to: when the scene type of the first position is a three-dimensional scene, initiate ray detection to interact with the three-dimensional scene according to the trigger operation of the first position; when the scene type of the first position is an operable interface, perform operable interface interaction based on the first position.
[0087] In an optional implementation, the execution module 504 is further used to: determine the three-dimensional model corresponding to the first position in the three-dimensional scene according to the trigger operation of the first position to obtain a first operation object; and initiate ray detection to interact with the first operation object.
[0088] In an optional implementation, the execution module 504 is further used to: determine the operation control corresponding to the first position on the operable interface according to the trigger operation of the first position to obtain a second operation object; and interact with the second operation object.
[0089] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0090] The page operation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0091] The embodiment of the present invention also provides a computer device having the above Figure 5 The page operation device shown.
[0092] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphic information in a graphical user interface on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0093] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0094] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0095] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0096] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0097] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0098] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0099] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0100] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A page operation method, characterized in that: include: In response to a trigger operation on a first position in a target page, obtaining the two-dimensional coordinates of the first position; the target page includes a three-dimensional scene and an operable interface overlaid on the three-dimensional scene; Obtaining a first transparency corresponding to the two-dimensional coordinates of the first position; determining a scene type of the first position according to the first transparency; The scene type is one of a three-dimensional scene and an operable interface; According to the scene type of the first position, a trigger operation of the first position is performed.
2. The page operation method according to claim 1, characterized in that: Determining the scene type of the first position according to the first transparency includes: When the first transparency is 0, determining that the first position is a three-dimensional scene; When the first transparency is not 0, the first position is determined to be an operable interface.
3. The page operation method according to claim 1, characterized in that: The obtaining the first transparency corresponding to the two-dimensional coordinates of the first position includes: converting the two-dimensional coordinates of the first position into first pixel coordinates; Based on the first pixel coordinates and a rendering target texture of the operable interface, obtaining a first pixel color value at the first position; A value of an alpha channel in the first pixel color value is determined as the first transparency.
4. The page operation method according to claim 1, characterized in that: The performing a trigger operation of the first position according to the scene type of the first position includes: When the scene type of the first position is a three-dimensional scene, initiating ray detection to interact with the three-dimensional scene according to a triggering operation of the first position; When the scene type of the first position is an operable interface, an operable interface interaction based on the first position is performed.
5. The page operation method according to claim 4, characterized in that: The initiating ray detection to interact with the three-dimensional scene according to the triggering operation of the first position includes: According to the triggering operation of the first position, determining a three-dimensional model corresponding to the first position in the three-dimensional scene to obtain a first operation object; Initiate ray detection to interact with the first operation object.
6. The page operation method according to claim 4, characterized in that: The performing of operable interface interaction based on the first position includes: According to the triggering operation of the first position, determining the operation control corresponding to the first position on the operable interface to obtain a second operation object; Interact with the second operation object.
7. A page operation device, characterized in that: include: A coordinate acquisition module, configured to acquire the two-dimensional coordinates of a first position in a target page in response to a trigger operation on the first position; the target page includes a three-dimensional scene and an operable interface overlaid on the three-dimensional scene; A transparency acquisition module, used to acquire a first transparency corresponding to the two-dimensional coordinates of the first position; A scene type confirmation module, used to determine the scene type of the first position according to the first transparency; the scene type is one of a three-dimensional scene and an operable interface; An execution module is used to execute a trigger operation of the first position according to the scene type of the first position.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the page operation method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the page operation method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the page operation method according to any one of claims 1 to 6.