3D interface content providing method, electronic equipment, storage medium and program product
By converting 2D components into 2D rendering maps and configuring them to geometry in the 3D scene, 3D components are generated, and the problem of difficulty in associating 2D UI in the prior art is solved, and the effective provision and intuitive display of 3D interface content is achieved.
Patent Information
- Application Number
- CN202411865687.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, the user interface (UI) is 2D and it is difficult to associate with a 3D scene, resulting in the UI components being unable to accurately identify the target position after the perspective of the 3D scene is adjusted.
By converting 2D components into 2D rendering maps and configuring them to geometry in the 3D scene, 3D components are generated, and 3D interface content is provided. The method includes determining a mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen, and updating the mapping relationship in response to viewing angle adjustment and scaling operations.
The effective provision of 3D interface content is realized, allowing 3D components to be adjusted synchronously with 3D scenes, ensuring that UI components always accurately identify the target position in 3D scenes, and providing intuitive 3D interface display.
Smart Images

Figure CN119648920A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to technical fields such as 3D interface generation, and more particularly to a 3D interface content providing method, electronic device, storage medium and program product. Background Art
[0002] In the prior art, the user interface (UI) is 2D. The UI and UI components on the UI (such as buttons, text boxes, drop-down lists, dialog boxes, pop-up windows, cards, etc.) are independent of the 3D scene (such as the three-dimensional floor plan scene) and are difficult to associate with the 3D scene. Summary of the invention
[0003] The present disclosure provides a 3D interface content providing method, electronic device, storage medium and program product.
[0004] According to one aspect of the present disclosure, a method for providing 3D interface content is provided, comprising: Convert 2D components into 2D rendering textures; Assigning a 2D rendering texture to a geometric body in a 3D scene to generate a 3D component located in the 3D scene; The 3D scene and the 3D components in the 3D scene are provided as 3D interface contents to a screen of an electronic device, so that the screen displays a 3D interface.
[0005] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the geometric body has a configured target position in the 3D scene.
[0006] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the geometric body is a three-dimensional surface having a geometric shape.
[0007] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the three-dimensional surface has a surface for configuring UI elements.
[0008] According to the 3D interface content providing method of at least one embodiment of the present disclosure, after generating the 3D component located in the 3D scene, the providing method further includes: Determining a mapping relationship between a spatial position of the 3D component in the 3D scene and a two-dimensional position on a screen of the electronic device; The step of providing the 3D scene and the 3D components in the 3D scene as 3D interface content to a screen of an electronic device includes: The 3D scene and the 3D components in the 3D scene are provided as 3D interface contents to a screen of an electronic device based on the mapping relationship.
[0009] According to at least one embodiment of the present disclosure, the 3D interface content providing method further includes: In response to receiving a viewing angle adjustment operation and / or a zoom operation on the 3D interface via the screen, the mapping relationship is updated.
[0010] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the determining of the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device includes: Determining the three-dimensional coordinates of the boundary of the 3D component in the 3D scene; Projecting the three-dimensional coordinates of the boundary to the screen coordinate system to obtain the two-dimensional coordinates of the boundary of the 3D component on the screen; The corresponding relationship between the three-dimensional coordinates of the boundary and the two-dimensional coordinates of the boundary is determined as the mapping relationship.
[0011] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the determining of the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device includes: Traversing the 3D component to obtain the three-dimensional coordinates of the boundary of each subcomponent of the 3D component in the 3D scene; Projecting the three-dimensional coordinates of the boundary to the screen coordinate system to obtain the two-dimensional coordinates of the boundary of each subcomponent on the screen; The corresponding relationship between the three-dimensional coordinates of the boundary and the two-dimensional coordinates of the boundary is determined as the mapping relationship.
[0012] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the determining of the three-dimensional coordinates of the boundary of the 3D component in the 3D scene includes: Determine a relative positional relationship between a boundary of the 3D component and a world coordinate position of a reference point of the 3D component in the 3D scene; The world coordinate position of the boundary of the 3D component in the 3D scene is determined based on the relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene.
[0013] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the traversing the 3D component to obtain the three-dimensional coordinates of the boundary of each subcomponent of the 3D component in the 3D scene includes: Determining the relative positional relationship between the boundary of each subcomponent and the world coordinate position of the reference point of the 3D component in the 3D scene; The world coordinate position of the boundary of each subcomponent in the 3D scene is determined based on the relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene.
[0014] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the step of converting the 2D component into a 2D rendering map includes: Determine the UI elements included in the 2D component; The 2D rendering map is generated based on the display parameters of the UI element.
[0015] According to the 3D interface content providing method of at least one embodiment of the present disclosure, the UI element includes a subcomponent of the 2D component.
[0016] According to at least one embodiment of the present disclosure, the method for providing 3D interface content, configuring a 2D rendering map to a geometric body in a 3D scene to generate a 3D component located in the 3D scene, includes: Provide the display parameters to the geometric body as material attributes of the geometric body; The 3D component is generated based on the material attributes and the 2D rendering map.
[0017] According to another aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the 3D interface content providing method of any embodiment of the present disclosure.
[0018] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and when the execution instructions are executed by a processor, the 3D interface content providing method of any embodiment of the present disclosure is used to implement.
[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method for providing 3D interface content according to any one of the embodiments of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0021] Figure 1 It is a schematic diagram of a UI interface in the prior art.
[0022] Figure 2 Yes Figure 1 The view after adjusting the perspective of the 3D scene (three-dimensional floor plan scene).
[0023] Figure 3 It is a flowchart of a method for providing 3D interface content according to an embodiment of the present disclosure.
[0024] Figure 4 It is a flowchart of a method for converting a 2D component into a 2D rendering map according to an embodiment of the present disclosure.
[0025] Figure 5 It is a schematic diagram of a 3D interface generated based on the 3D interface content provided by the 3D interface content providing method of the present disclosure.
[0026] Figure 6 It is a flowchart of a method for providing 3D interface content according to another embodiment of the present invention.
[0027] Figure 7 It is a flowchart of a method for providing 3D interface content according to another embodiment of the present disclosure.
[0028] Figure 8 It is a flowchart of a method for determining a mapping relationship between a spatial position of a 3D component in a 3D scene and a two-dimensional position on a screen of an electronic device according to an embodiment of the present disclosure.
[0029] Fig. 9 It is a flowchart of a method for determining a mapping relationship between a spatial position of a 3D component in a 3D scene and a two-dimensional position on a screen of an electronic device according to another embodiment of the present disclosure.
[0030] Fig.10 It is a flowchart of a method for determining three-dimensional coordinates of a boundary of a 3D component in a 3D scene according to an embodiment of the present disclosure.
[0031] Fig.11 It is a flowchart of a method for determining three-dimensional coordinates of a boundary of a 3D component in a 3D scene according to another embodiment of the present disclosure.
[0032] Fig.12 It is a schematic block diagram of the structure of a 3D interface content providing device according to an embodiment of the present disclosure.
[0033] Fig.13 It is a schematic block diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0035] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0036] Figure 1 It is a schematic diagram of the UI interface in the prior art, refer to Figure 1 , which shows the UI interface and UI components on the UI interface (for example Figure 1 UI components such as "Living Room", "Bedroom A", "Bedroom B", "Bedroom C", and "Kitchen" in the .
[0037] Figure 2 Yes Figure 1 , it can be seen that the UI components such as "living room", "bedroom A", "bedroom B", "bedroom C", and "kitchen" are all 2D components. These 2D components are simply associated with the target position (or target area) of the 3D scene. When the viewing angle of the 3D scene is adjusted, some UI components cannot accurately identify the target position (or target area) of the 3D scene because these UI components are all 2D components. For example, the UI component "bedroom D" cannot be accurately identified in the Figure 1 The associated target location (or target area) can be clearly seen in Figure 2 In the image, it is not clear or obvious what target location (or target area) it is associated with.
[0038] To this end, the present disclosure provides a new method for providing 3D interface content.
[0039] Figure 3 FIG. 1 is a flow chart of a method for providing 3D interface content according to an embodiment of the present disclosure. Figure 3 The 3D interface content providing method M100 of this embodiment includes steps S12 to S16.
[0040] Step S12: converting the 2D component (2D user interface component, 2D UI component) into a 2D rendering texture.
[0041] In the present disclosure, a 2D component may be, for example, a card component (i.e., a container component), or may be, for example, Figure 1 or Figure 22D UI components such as "living room", "bedroom A", "bedroom B", "bedroom C", and "kitchen" are shown in FIG. The present disclosure does not specifically limit the specific types of 2D components.
[0042] Among them, the rendering map is a two-dimensional texture image with geometric dimensions, such as width and height, and can contain color information, transparency information, and other display parameter information.
[0043] In this step, the created 2D component can be converted to obtain a 2D rendering map, or the 2D component can be created first and then converted to obtain a 2D rendering map.
[0044] In some embodiments of the present disclosure, it is possible to Figure 4 The 2D component conversion steps shown in FIG. 2 are used to obtain a 2D rendering map.
[0045] Figure 4 The transformation method shown in comprises the following steps: S122, determining UI elements included in the 2D component; S124. Generate a 2D rendering map based on the display parameters of the UI element.
[0046] Figure 4 The method shown in can generate a 2D rendering map based on display parameters of one or more UI elements included in a 2D component for use in the subsequent step of generating a 3D component.
[0047] Among them, UI elements can be plain text, text-type controls, image-type controls, etc. Figure 1 Take the 2D component "Bedroom A" in the example, its UI element is plain text (cannot be clicked) or a text-type control (clicking the control will switch the viewing angle to the corresponding space in the 3D floor plan, i.e., Bedroom A).
[0048] Exemplarily, a 2D component may be configured as a UserWidget in a 3D scene generation software (eg, Unreal Engine 4) and set to a WidgetComponent in the 3D scene generation software, and the WidgetComponent may convert the UserWidget into a rendering map.
[0049] In light of the technical solution disclosed herein, those skilled in the art may adjust or change the method for generating 2D rendering textures, which shall fall within the protection scope of the present disclosure.
[0050] The UI element described above may be a subcomponent of the above-mentioned 2D component, and the subcomponent may be a control.
[0051] Continue to refer Figure 3After obtaining the 2D rendering map, execute step S14.
[0052] S14. Assign the 2D rendering texture to the geometry (rectangular patch) in the 3D scene to generate a 3D component (i.e., a 3D UI component) in the 3D scene.
[0053] Among them, the 3D scene can be generated by 3D scene generation software or software with a 3D scene generation module, which belongs to the existing technology. The 3D scene is, for example, a three-dimensional floor plan scene.
[0054] Among them, the geometric body is a blank three-dimensional object model, such as a blank surface with a geometric shape, which has a thinner thickness, for example, its thickness is not zero but close to 0. Those skilled in the art can appropriately set the thickness of the blank surface, which all fall within the protection scope of the present disclosure.
[0055] The geometry has a target position in the 3D scene, and multiple target positions can be configured in the 3D scene to configure multiple geometries to generate multiple 3D components.
[0056] The geometric body may be a rectangular patch or a patch of other shapes, and the specific shape of the patch may be configured based on the shape requirements of the 3D component.
[0057] The 3D component is associated with a target position of the 3D scene, for example, associated with a target object (eg, floor) in a three-dimensional floor plan scene.
[0058] Step S14 realizes the conversion of 2D components into 3D components by configuring the 2D map obtained in step S12 to the above-mentioned geometric body, and realizes the configuration of the generated 3D components in the 3D scene.
[0059] In some embodiments of the present disclosure, the above-mentioned geometric bodies can be configured in the WidgetComponent of the 3D scene generation software.
[0060] The 2D rendering map can be configured to the geometry in the 3D scene based on the following steps to generate a 3D component in the 3D scene: Provide display parameters to the geometry as material attributes of the geometry; Generate 3D components based on material properties and 2D rendered textures.
[0061] Among them, material properties refer to a series of properties that define the appearance of the object's surface. These properties may include color, texture, transparency, reflection characteristics, etc. These properties together determine the visual effect of the object when it is rendered.
[0062] S16: providing the 3D scene and the 3D components in the 3D scene as 3D interface content to a screen of the electronic device, so that the screen displays the 3D interface.
[0063] After the above 3D components are generated, the 3D scene and the 3D components in the 3D scene are provided to the screen of an electronic device such as a mobile phone, and a 3D interface can be displayed.
[0064] Figure 5 It is a schematic diagram of a 3D interface generated based on the 3D interface content provided by the 3D interface content providing method of the present disclosure.
[0065] Depend on Figure 5 It can be seen that a plurality of 3D components (components pointed to by red arrows) are shown in the 3D interface provided by the 3D interface content providing method disclosed herein. Since these 3D components are three-dimensional geometric bodies and have been associated with the target positions of the 3D scene, if the viewing angle of the 3D scene is adjusted, the viewing angle of these 3D components will also be adjusted synchronously, so that the 3D interface can more intuitively display which target position or target area of the 3D scene each 3D component is specifically associated with. In other words, the 3D components displayed on the 3D interface visually belong to the 3D scene (e.g., a 3D floor plan scene). Figure 5 The red arrow is not part of the 3D interface display.
[0066] Figure 6 It is a flowchart of a method for providing 3D interface content according to another embodiment of the present disclosure.
[0067] refer to Figure 6 The 3D interface content providing method M200 of this embodiment includes steps S22 to S26. The 3D interface content providing method M200 of this embodiment includes steps S22 to S26. Figure 1 The method shown also includes: S25: Determine a mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device.
[0068] Therefore, in step S26 of this embodiment, the 3D scene and the 3D components in the 3D scene are provided as 3D interface contents to the screen of the electronic device based on the above mapping relationship.
[0069] Based on the 3D interface content providing method M200 of the present embodiment, when a user clicks a certain position on the screen of an electronic device, it can determine whether a 3D component in the 3D scene is clicked or whether a subcomponent (such as a control) of the 3D component is clicked based on the above-mentioned mapping relationship, so that the clicked 3D component or subcomponent can respond to the click.
[0070] In some embodiments of the present disclosure, the 3D component has no sub-components, and in other embodiments, the 3D component has one or more sub-components, all of which fall within the protection scope of the present disclosure.
[0071] Figure 7 FIG. 1 is a flow chart of a method for providing 3D interface content according to another embodiment of the present disclosure. Figure 7 The 3D interface content providing method M300 of this embodiment includes steps S32 to S38. The 3D interface content providing method M300 of this embodiment includes steps S32 to S38. Figure 2 The method shown also includes: S38: In response to receiving a viewing angle adjustment operation and / or a zooming operation on the 3D interface via the screen, updating the mapping relationship.
[0072] Since each 3D component described above in the present disclosure is associated with a target position in the 3D scene, and when the viewing angle of the 3D scene is adjusted, the viewing angle of the 3D component will also be adjusted synchronously, therefore, when the screen receives a viewing angle adjustment operation and / or a zoom operation, the above-mentioned mapping relationship will be updated, so that the 3D component can accurately respond to operations such as clicks received on the screen.
[0073] The above mapping relationship may be determined based on a coordinate system conversion relationship between a world coordinate system (which is a global coordinate system) where the 3D scene is located and a two-dimensional screen coordinate system where the screen window is located.
[0074] The screen window can be understood as the viewport of the 3D virtual camera, so the above coordinate system conversion relationship can be determined based on the position of the viewport of the 3D virtual camera in the above world coordinate system. The screen coordinate system is also the 2D coordinate system where the viewport of the 3D virtual camera is located.
[0075] like Figure 8 As shown, in some implementations, since a 3D component such as an information card does not include a subcomponent, the step S15 described above determines the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device based on the following steps: S152, determining the three-dimensional coordinates of the boundary of the 3D component in the 3D scene; S154, projecting the three-dimensional coordinates of the boundary to the screen coordinate system to obtain the two-dimensional coordinates of the boundary of the 3D component on the screen; S156: Determine the corresponding relationship between the three-dimensional coordinates of the boundary and the two-dimensional coordinates of the boundary as a mapping relationship.
[0076] The step S25 described above can also determine the above mapping relationship based on the above steps, which will not be repeated here.
[0077] The boundary of the 3D component in the 3D scene may be a rectangular edge such as a rectangular patch.
[0078] Based on the mapping relationship determined by the above method, when the screen receives a signal such as a click operation whose location is within the range of the two-dimensional coordinates of the boundary of a 3D component on the screen, it can be determined that the operation object of the click operation is the 3D component, so that the 3D component can respond to the click operation.
[0079] like Fig. 9 As shown, in some other implementations, since some 3D components include subcomponents (subcontrols), the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device is determined based on the following steps for step S15 or step S25 described above: S252, traverse the 3D component to obtain the three-dimensional coordinates of the boundary of each subcomponent of the 3D component in the 3D scene; S254, projecting the three-dimensional coordinates of the boundary to the screen coordinate system to obtain the two-dimensional coordinates of the boundary of each subcomponent on the screen; S256: Determine the correspondence between the three-dimensional coordinates of the boundary and the two-dimensional coordinates of the boundary as a mapping relationship. Based on the above method, the mapping relationship between the spatial position of each subcomponent of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device can be determined. Based on the mapping relationship, it can be determined whether a subcomponent of the 3D component is the operation object such as a click operation received by the screen. When the position where the screen receives an operation such as a click is within the range of the two-dimensional coordinates of the boundary of a subcomponent on the screen, it can be determined that the operation object of the click operation is the subcomponent, so that the subcomponent can respond to the click operation.
[0080] Fig.10 It is a flowchart of a method for determining three-dimensional coordinates of a boundary of a 3D component in a 3D scene according to an embodiment of the present disclosure.
[0081] refer to Fig.10 , the step S152 described above can determine the three-dimensional coordinates of the boundary of the 3D component in the 3D scene based on the following steps: S1522, determining the relative position relationship between the boundary of the 3D component and the world coordinate position of the reference point of the 3D component in the 3D scene; S1524: Determine the world coordinate position of the boundary of the 3D component in the 3D scene based on the relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene.
[0082] Among them, the reference point of the 3D component can be the center point of the 3D component (for example, the center point of a rectangular patch), or the center point of its lower edge or a corner point, etc. In short, the world coordinate position of the reference point of the 3D component represents the position of the 3D component in the world coordinate system where the 3D scene is located.
[0083] When generating the above 3D component, the world coordinate position of the reference point of the 3D component in the 3D scene, ie, the position in the global coordinate system (world coordinate system), has been determined, and the geometric size of the 3D component has also been determined.
[0084] Therefore, step S1522 can determine the relative position relationship between the boundary of the 3D component and the reference point of the 3D component, and step S1524 can determine the world coordinate position of the boundary of the 3D component in the 3D scene based on the above relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene.
[0085] Fig.11 It is a flowchart of a method for determining three-dimensional coordinates of a boundary of a 3D component in a 3D scene according to another embodiment of the present disclosure.
[0086] refer to Fig.11 , the step S252 described above can determine the three-dimensional coordinates of the boundary of the 3D component in the 3D scene based on the following steps: S2522, determining the relative position relationship between the boundary of each subcomponent and the world coordinate position of the reference point of the 3D component in the 3D scene; S2524: Determine the world coordinate position of the boundary of each subcomponent in the 3D scene based on the relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene.
[0087] If a 3D component includes one or more subcomponents (sub-controls), when the 3D component is generated, the world coordinate position of the reference point of the 3D component in the 3D scene, that is, the position in the global coordinate system (world coordinate system) has been determined, and the geometric dimensions of the 3D component and the geometric dimensions of its subcomponents and the positions of the subcomponents in the 3D component have also been determined.
[0088] Therefore, step S2522 can determine the relative position relationship between the boundary of each subcomponent and the reference point of the 3D component, and S2524 can determine the world coordinate position of the boundary of each subcomponent in the 3D scene based on the relative position relationship and the world coordinate position of the reference point of the 3D component.
[0089] As described above, the boundary of the 3D component described in the present disclosure may be the edge of the geometry that generates the 3D component. For example, if the 3D component is generated by a rectangular patch (geometry), the rectangular edge of the rectangular patch is the boundary of the 3D component.
[0090] Correspondingly, if a subcomponent of a 3D component is in a rectangular shape, the edge of the rectangular shape is the boundary of the subcomponent, and the subcomponent may also be in other shapes.
[0091] In some other embodiments of the present disclosure, in order to improve the speed of determining the boundaries of 3D components and subcomponents of 3D components, and improve the response speed of 3D components and subcomponents to screen operations such as clicks, the present disclosure uses two or more endpoints on the 3D component or subcomponent as boundary points to characterize the boundary.
[0092] For example, for a subcomponent of a rectangular shape, the two endpoints of the first diagonal of the rectangular shape are used as two boundary points (first boundary point, second boundary point), or the two endpoints of the second diagonal of the rectangular shape are used as two boundary points (first boundary point, second boundary point), or the four endpoints of the rectangular shape are used as four boundary points.
[0093] For another example, for a subcomponent in a triangular shape, three endpoints (ie, three vertices) of the triangular shape are used as three boundary points.
[0094] Inspired by the technical solution of the present disclosure, those skilled in the art can select appropriate endpoints as boundary points to characterize the boundaries of 3D components or sub-components of different shapes, which all fall within the protection scope of the present disclosure.
[0095] In a preferred embodiment of the present disclosure, the surface of the 3D component (i.e., the geometric body described above) is parallel to the Z axis of the global coordinate system where the 3D scene is located. The surface of the 3D component is the surface on which the UI elements (text, subcomponents, etc.) are displayed on the 3D component. The following describes how to determine whether a subcomponent of a 3D component is clicked by a click operation received on the screen.
[0096] (1) Determine the world coordinate information (position and orientation) of the 3D component, and determine the position and size of the subcomponent on the 3D component.
[0097] Determine the world coordinate position of the reference point of the 3D component in the 3D scene, which can be expressed as FVectorComponentWorldLocation. Determine the orientation of the surface of the 3D component on the XY plane of the world coordinate system (the global coordinate system where the 3D scene is located), which can be expressed as FVectorComponentWorldDirectionXY. The orientation is the direction of the projection line of the surface of the 3D component on the XY plane. Since the surface of the 3D component is parallel to the Z axis of the world coordinate system, the orientation of the 3D component on the Z axis can be determined to be parallel to the Z axis. The surface of the 3D component can also be set to be non-parallel to the Z axis. The orientation of the 3D component on the plane perpendicular to the XY plane (the plane where the Z axis is located) can also be determined. The orientation of the 3D component on the Z axis can be expressed as ComponentWorldDirectionZ.
[0098] In addition, you can also configure the scaling parameters of the 3D component in the XY plane and in the Z direction, which are represented by float ComponentScaleXY and float ComponentScaleZ respectively.
[0099] When a 3D component is created, the above two scaling parameters default to 1. If the width (i.e., the length of the projection line on the X plane) or the height (i.e., the length in the Z direction) of the 3D component is subsequently adjusted, the above two scaling parameters will change accordingly.
[0100] by Figure 5 For example, the subcomponent "Enter the Room" in the 3D component A in the example, the 2D coordinates of the center point of the subcomponent on the surface of the 3D component can be determined (which can be expressed as FVector2D WidgetPosition). The 2D coordinates can be 2D coordinates on a plane coordinate system with the reference point of the 3D component as the origin, the surface width as the x direction, and the surface height as the y direction. The 2D coordinates represent the position of the subcomponent on the 3D component. The size of the subcomponent "Enter the Room" on the surface of the 3D component can be determined, and the size can be expressed as FVector2D WidgetSize.
[0101] (2) Calculate the position of the subcomponent's boundary in the world coordinate system.
[0102] Continue with Figure 5 Taking the subcomponent "enter the room" in the 3D component A in the example, the lower left corner endpoint of the subcomponent can be used as the starting position, and the upper right corner endpoint of the subcomponent can be used as the ending position to represent the boundary of the subcomponent.
[0103] The above starting position can be calculated based on the following process.
[0104] Calculate the projection length of the subcomponent's starting position from the reference point on the XY plane of the world coordinate system: float WidgetStartLengthXY = (WidgetPosition.x - WidgetSize.x / 2) *float ComponentScaleXY Among them, WidgetPosition.x is the x component of FVector2D WidgetPosition in the above plane coordinate system, and WidgetSize.x is the x component of the above FVector2D WidgetSize in the above plane coordinate system.
[0105] Calculate the projection length of the subcomponent's starting position from the reference point in the Z direction of the world coordinate system: float WidgetStartLengthZ = (WidgetPosition.y - WidgetSize.y / 2) *float ComponentScaleZ Among them, WidgetPosition.y is the y component of FVector2D WidgetPosition in the above plane coordinate system, and WidgetSize.y is the y component of the above FVector2D WidgetSize in the above plane coordinate system.
[0106] Therefore, the starting position of the child component in the world coordinate system is: FVector WidgetStartWorldLocation = ComponentWorldLocation +ComponentWorldDirectionXY * float WidgetStartLengthXY +ComponentWorldDirectionZ * float WidgetStartLengthZ Based on the same process, the above end position of the subcomponent in the world coordinate system can be calculated.
[0107] Calculate the projection length of the subcomponent's end position from the reference point on the XY plane of the world coordinate system: float WidgetEndLengthXY = (WidgetPosition.x + WidgetSize.x / 2) *float ComponentScaleXY Calculate the projection length of the subcomponent's end position from the above reference point in the Z direction of the world coordinate system: float WidgetEndLengthZ = (WidgetPosition.y + WidgetSize.y / 2) * floatComponentScaleZ Therefore, the end position of the child component in the world coordinate system is: FVector WidgetEndWorldLocation = ComponentWorldLocation +ComponentWorldDirectionXY * float WidgetEndLengthXY +ComponentWorldDirectionZ * float WidgetEndLengthZ (3) Convert the position of the subcomponent's bounds in the world coordinate system to a 2D position in the screen coordinate system.
[0108] The 2D position of the above starting position in the screen coordinate system is: FVector2D WidgetStartScreenPosition= The projection of FVectorWidgetEndWorldLocation in the screen coordinate system.
[0109] The 2D position of the above end position in the screen coordinate system is: FVector2D WidgetEndScreenPosition = The projection of FVectorWidgetEndWorldLocation in the screen coordinate system.
[0110] Therefore, when the screen position (TouchPosition) receiving the click operation is greater than the above FVector2DWidgetStartScreenPosition and less than the above WidgetEndScreenPosition, it can be determined that the above subcomponent is clicked.
[0111] Based on any of the above implementations, the present disclosure further provides a 3D interface content providing device (ie, a 3D scene generating device / 3D scene generating software).
[0112] Fig.12 It is a schematic block diagram of the structure of a 3D interface content providing device according to an embodiment of the present disclosure.
[0113] like Fig.12 As shown, the 3D interface content providing device includes: A 2D rendering texture generation module 1002, which converts the 2D component into a 2D rendering texture; The 3D component generation module 1004 configures the 2D rendering texture to the geometric body in the 3D scene to generate a 3D component in the 3D scene; The output module 1006 provides the 3D scene and the 3D components in the 3D scene as 3D interface content to the screen of the electronic device, so that the screen displays the 3D interface.
[0114] In some implementations, the 3D interface content providing device further includes: The mapping relationship determination module 1008 determines the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device.
[0115] The mapping relationship determination module 1008 further updates the mapping relationship in response to receiving a viewing angle adjustment operation and / or a zoom operation on the 3D interface via the screen.
[0116] The above-mentioned 3D interface content providing device can be in the form of computer software, and its various modules can be in the form of computer software modules. The implementation process of the functions or effects of its various modules is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0117] The execution subject of the 3D interface content providing method in the specific implementation manner of the present disclosure may be a mobile phone, a computer or other electronic device.
[0118] Therefore, based on any one of the above embodiments, the present disclosure further provides an electronic device, which can execute the 3D interface content providing method of any one of the embodiments described above in the present disclosure.
[0119] Fig.13 1 is a schematic block diagram of the structure of an electronic device 1000 according to an embodiment of the present disclosure.
[0120] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300 and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc. The electronic device 1000 can also include a screen 1500.
[0121] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0122] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0123] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.
[0124] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0125] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0129] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.
[0130] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0131] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A method for providing 3D interface content, characterized in that: include: Convert 2D components into 2D rendering textures; Assigning a 2D rendering texture to a geometric body in a 3D scene to generate a 3D component located in the 3D scene; as well as The 3D scene and the 3D components in the 3D scene are provided as 3D interface contents to a screen of an electronic device, so that the screen displays a 3D interface.
2. The 3D interface content providing method according to claim 1, characterized in that: After generating the 3D component located in the 3D scene, the providing method further includes: Determining a mapping relationship between a spatial position of the 3D component in the 3D scene and a two-dimensional position on a screen of the electronic device; The step of providing the 3D scene and the 3D components in the 3D scene as 3D interface content to a screen of an electronic device includes: The 3D scene and the 3D components in the 3D scene are provided as 3D interface contents to a screen of an electronic device based on the mapping relationship.
3. The 3D interface content providing method according to claim 2, characterized in that: The providing method further comprises: In response to receiving a viewing angle adjustment operation and / or a zoom operation on the 3D interface via the screen, the mapping relationship is updated.
4. The 3D interface content providing method according to claim 2, characterized in that: The determining of the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device includes: Determining the three-dimensional coordinates of the boundary of the 3D component in the 3D scene; Projecting the three-dimensional coordinates of the boundary to the screen coordinate system to obtain the two-dimensional coordinates of the boundary of the 3D component on the screen; and The corresponding relationship between the three-dimensional coordinates of the boundary and the two-dimensional coordinates of the boundary is determined as the mapping relationship.
5. The 3D interface content providing method according to claim 2, characterized in that: The determining of the mapping relationship between the spatial position of the 3D component in the 3D scene and the two-dimensional position on the screen of the electronic device includes: Traversing the 3D component to obtain the three-dimensional coordinates of the boundary of each subcomponent of the 3D component in the 3D scene; Projecting the three-dimensional coordinates of the boundary to the screen coordinate system to obtain the two-dimensional coordinates of the boundary of each subcomponent on the screen; and The corresponding relationship between the three-dimensional coordinates of the boundary and the two-dimensional coordinates of the boundary is determined as the mapping relationship.
6. The 3D interface content providing method according to claim 4, characterized in that: The determining of the three-dimensional coordinates of the boundary of the 3D component in the 3D scene includes: Determine a relative positional relationship between a boundary of the 3D component and a world coordinate position of a reference point of the 3D component in the 3D scene; The world coordinate position of the boundary of the 3D component in the 3D scene is determined based on the relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene.
7. The 3D interface content providing method according to any one of claims 1 to 6, characterized in that: The traversing the 3D component to obtain the three-dimensional coordinates of the boundary of each subcomponent of the 3D component in the 3D scene includes: Determining the relative positional relationship between the boundary of each subcomponent and the world coordinate position of the reference point of the 3D component in the 3D scene; Determine the world coordinate position of the boundary of each subcomponent in the 3D scene based on the relative position relationship and the world coordinate position of the reference point of the 3D component in the 3D scene; Optionally, converting the 2D component into a 2D rendering map includes: Determine the UI elements included in the 2D component; Generating the 2D rendering map based on display parameters of the UI element; Optionally, the UI element includes a subcomponent of the 2D component; Optionally, configuring the 2D rendering map to a geometric body in a 3D scene to generate a 3D component located in the 3D scene includes: Provide the display parameters to the geometric body as material attributes of the geometric body; and The 3D component is generated based on the material attributes and the 2D rendering map.
8. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes the 3D interface content providing method according to any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, and when the execution instructions are executed by the processor, they are used to implement the 3D interface content providing method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the 3D interface content providing method according to any one of claims 1 to 7 is implemented.