House type distribution cover picture generation method and device, storage medium and program product
By calculating the focus and position of the virtual camera and adjusting the shooting parameters, the problem of generating floor layout distribution cover images in virtual reality technology is solved, and the rapid, accurate and beautiful cover image generation is achieved, improving the user experience.
Patent Information
- Application Number
- CN202411554656.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-25
AI Technical Summary
When virtual reality technology is widely used in the real estate industry, how to quickly and accurately generate a beautiful and practical cover picture for the three-dimensional scene of a house or community has become an important task.
By calculating based on the spatial size of the target spatial object, the focus and initial position of the virtual camera are determined, and the three-dimensional scene is photographed using the virtual camera to generate an initial image. If the initial image does not meet the specified cover image boundary requirements, the focus and/or position of the virtual camera is adjusted until a target image that meets the requirements is captured as the cover image.
It realizes efficient and precise generation of both beautiful and practical room type distribution cover pictures, improving users' experience when browsing real estate projects using virtual reality technology.
Smart Images

Figure CN119516143A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual reality technology, and in particular to a method, device, storage medium and program product for generating a housing type distribution cover map. Background Art
[0002] As an immersive experience, virtual reality (VR) technology is gradually changing people's understanding and perception of spatial layout. Especially in the real estate industry, the application of VR technology enables potential customers to preview the spatial distribution of different houses or community units in a virtual way, greatly improving the efficiency of buying or renting decisions.
[0003] With the development of VR technology, the visual experience it provides has become more realistic and delicate, and the scenes have become more diverse. However, while VR technology is widely used in the real estate industry, it also faces new technical challenges, namely how to quickly and accurately generate a beautiful and practical apartment layout cover map for the three-dimensional scenes of houses or communities displayed using VR technology is an important task. Summary of the invention
[0004] Multiple aspects of the present application provide a method, device, storage medium and program product for generating an apartment distribution cover map, which are used to efficiently and accurately generate an apartment distribution cover map that is both beautiful and practical, thereby enhancing the user experience when browsing real estate projects using virtual reality technology.
[0005] An embodiment of the present application provides a method for generating a cover image of an apartment distribution, which is applied to an electronic device, wherein a graphical user interface is displayed on a screen of the electronic device, and a virtual three-dimensional scene of a target space object is displayed on the graphical user interface, wherein the virtual three-dimensional scene includes a virtual camera, and the method includes: based on the spatial size of the target space object, calculating a target position point in the target space object as the focus of the virtual camera; determining an initial position of the virtual camera with the goal of being able to completely capture the target space object when the virtual camera is directed toward the focus in the horizontal direction and the vertical direction of the screen respectively; controlling the virtual camera to capture toward the focus along a specified shooting direction at the initial position to obtain an initial image including the target space object; if it is determined that the initial image does not meet the specified cover image boundary requirements based on the position of the target space object in the initial image, adjusting the focus and / or position of the virtual camera until the target image that meets the specified cover image boundary requirements is captured, and using the target image as the cover image of the virtual three-dimensional scene.
[0006] Further optionally, the target position point is implemented as the geometric center point of the target space object; the initial position of the virtual camera is determined with the goal of being able to completely capture the target space object when the virtual camera shoots toward the focus in the horizontal direction and vertical direction of the screen respectively, including: taking the geometric center point of the target space object as the center of the sphere, and generating a circumscribed sphere of the target space object in combination with the spatial size of the target space object; determining a first distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the vertical direction of the screen; determining a second distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction of the screen; taking the larger distance between the first distance and the second distance as the target distance at which the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction and vertical direction of the screen; and determining the initial position of the virtual camera according to the specified shooting direction and target distance.
[0007] Further optionally, determining a first distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the vertical direction of the screen includes: projecting the circumscribed sphere to a first plane perpendicular to the horizontal direction of the screen to obtain a first circular body, the center and radius of the first circular body being the center and radius of the circumscribed sphere respectively; determining a first position point tangent to both sides of the first circular body on a first straight line passing through the center of the first circular body in the depth direction of the screen according to the radius of the first circular body; and calculating the distance between the first position point and the center of the first circular body as the first distance.
[0008] Further optionally, determining a second distance from the center of the sphere when the virtual camera is able to completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction of the screen includes: projecting the target space object onto a second plane perpendicular to the vertical direction of the screen to obtain a projection polygon, calculating the minimum circumscribed circle of the projection polygon to obtain a second body, the center of the second body being the center of the circumscribed sphere; calculating the radius of the second body according to the spatial size of the target space object on the second plane, and obtaining an extended radius according to the spatial size of the target space object in the vertical direction of the world coordinate system; determining a second position point on a second straight line passing through the center of the second body in the depth direction of the screen according to the aspect ratio of the screen and the radius of the second body; calculating the distance between the second position point and the center of the second body as the third distance, and calculating the sum of the third distance and the extended radius as the second distance.
[0009] Further optionally, determining that the initial image does not meet the specified cover image boundary requirements is based on the position of the target space object in the initial cover image, including: calculating the actual area in which the target space object appears in the initial image based on the position of the target space object in the initial image; calculating the effective area in the initial image based on the specified cover image boundary requirements, the effective area refers to the area position where the target space object is expected to appear in the initial image according to the specified cover image boundary requirements; if the center point of the actual area does not coincide with the center point of the effective area or is not within a preset first position error, and / or if the boundary of the actual area does not coincide with the boundary of the effective area or is not within a set second position error, it is determined that the initial image does not meet the specified cover image boundary requirements.
[0010] Further optionally, the focus and / or position of the virtual camera is adjusted until a target image that meets the specified cover image boundary requirements is captured, including: determining an adjustment object based on whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area coincides with the boundary of the effective area or are not within a set second position error, the adjustment object being the focus and / or position of the virtual camera, the focus and position of the virtual camera being used to change the position and size of the target space object in the cover image, respectively; adjusting the adjustment object at least once in a manner adapted to the adjustment object, and controlling the virtual camera to re-shoot in a specified shooting direction based on the adjusted adjustment object until a target image that meets the specified cover image boundary requirements is captured.
[0011] Further optionally, the adjustment object is determined based on whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within a set second position error, including: when the center point of the actual area and the center point of the effective area do not coincide with each other or are not within the preset first position error, determining that the focus and the position of the virtual camera are both the adjustment objects; when the center point of the actual area and the center point of the effective area coincide with each other or are within the preset first position error, but the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within the set second position error, determining that the position of the virtual camera is the adjustment object.
[0012] Further optionally, the adjustment object is adjusted at least once according to a method that is compatible with the adjustment object, including: before each adjustment of the adjustment object, determine whether the number of continuous adjustments to the adjustment object has reached a preset maximum number of iterations; if not, adjust the adjustment object once according to a method that is compatible with the adjustment object, and add 1 to the number of continuous adjustments to the adjustment object; if so, end the adjustment of the adjustment object.
[0013] Further optionally, the adjustment object is adjusted at least once in a manner adapted to the adjustment object, including: if the adjustment object includes the focus of the virtual camera, projecting the target space object onto the third plane where the screen is located according to the current position and current focus of the virtual camera, and the vertices of the target space object correspond to the projection points on the third plane; determining the horizontal axis offset and the vertical axis offset corresponding to the current focus according to the extreme values in the horizontal axis coordinates and the extreme values in the vertical axis coordinates of each projection point on the third plane; determining the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus according to the horizontal axis offset and the vertical axis offset corresponding to the current focus; determining the adjusted focus position according to the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus.
[0014] Further optionally, the adjustment object is adjusted at least once in a manner adapted to the adjustment object, including: if the adjustment object includes the position of the virtual camera, then according to the current position and current focus of the virtual camera, the target space object is projected onto the third plane where the screen is located, and the vertices of the target space object correspond to the projection points on the third plane; calculating the fourth distance and fifth distance that the virtual camera should satisfy from the current focus when each projection point in the third plane falls on the horizontal boundary and vertical boundary of the screen respectively; selecting the larger distance from the fourth distance and the fifth distance as the sixth distance, that is, determining the distance that the virtual camera should satisfy from the current focus when all the projection points on the third plane are displayed on the screen; and recalculating the position of the virtual camera according to the sixth distance, the current focus and the specified shooting direction to obtain the adjusted position.
[0015] An embodiment of the present application also provides an electronic device, including: a processor and a memory, the memory being used to store a computer program. When the computer program is executed by the processor, the processor is enabled to implement the steps in the method for generating a housing distribution cover map provided in this embodiment.
[0016] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is enabled to implement the steps in the method for generating a housing type distribution cover map provided in this embodiment.
[0017] An embodiment of the present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement the steps in the method for generating a housing distribution cover map provided in this embodiment.
[0018] In an embodiment of the present application, a cover image of the virtual three-dimensional scene is generated based on a virtual three-dimensional scene of a target space object. Specifically, some simple calculations are performed based on the spatial size of the target space object to determine the focus and position of the virtual camera. The target space object in the virtual three-dimensional scene is directly photographed with the virtual camera to obtain an initial image. The image is optimized by specifying cover image boundary requirements and adjusting the focus and position of the virtual camera until a target image that meets the requirements is captured as the cover image, thereby achieving efficient and accurate generation of a beautiful and practical apartment distribution cover image, thereby improving the user experience when browsing real estate projects using virtual reality technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 A schematic diagram of a flow chart of a method for generating a cover image of a housing type distribution provided by an exemplary embodiment of the present application;
[0021] Figure 2a A schematic diagram of a circumscribed sphere provided for an exemplary embodiment of the present application;
[0022] Figure 2b A schematic diagram of a state of calculating a first circular body based on a virtual camera projected onto a first plane relative to a circumscribed sphere provided by an exemplary embodiment of the present application;
[0023] Figure 2c A schematic diagram of a state of calculating a second circular body based on a virtual camera projected onto a second plane relative to a target space object provided by an exemplary embodiment of the present application;
[0024] Figure 3 A schematic diagram of the relationship between the position of the boundary of the effective area where the target space object is located in the cover image and the boundary position of the cover image provided by the exemplary embodiment of the present application;
[0025] Figure 4 A schematic diagram of a state of calculating and adjusting the focus of a virtual camera provided by an exemplary embodiment of the present application;
[0026] Figure 5 A schematic diagram of a state when the projection point of the target space object is just at the boundary of the effective area provided by the exemplary embodiment of the present application;
[0027] Figure 6 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of the present application;
[0028] Figure 7A schematic diagram of the state of a cover image effect generated by taking a community including multiple buildings as an example provided by an exemplary embodiment of the present application;
[0029] Figure 8 Another state diagram of the cover image effect generated by taking a community including multiple buildings as an example provided by the exemplary embodiment of the present application;
[0030] Fig. 9 Another state diagram of the cover image effect generated by taking a community including multiple buildings as an example provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only 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 ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0032] In response to the technical problem of how to quickly and accurately generate a beautiful and practical apartment distribution cover image for a three-dimensional scene of a house or community displayed using VR technology, in an embodiment of the present application, a cover image of the virtual three-dimensional scene is generated based on a virtual three-dimensional scene of a target space object. Specifically, some simple calculations are performed based on the spatial size of the target space object to determine the focus and position of the virtual camera, and the target space object in the virtual three-dimensional scene is directly photographed with the virtual camera to obtain an initial image. The image is optimized by specifying the cover image boundary requirements and continuously adjusting the focus and position of the virtual camera until a target image that meets the requirements is captured as the cover image, thereby achieving efficient and accurate generation of a beautiful and practical apartment distribution cover image, thereby improving the user experience when browsing real estate projects using virtual reality technology.
[0033] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0034] Figure 1 The following is a flow chart of a method for generating a cover image of a house type distribution provided by an exemplary embodiment of the present application. Figure 1 As shown, the method includes:
[0035] 11. Based on the spatial size of the target spatial object, calculate the target position point in the target spatial object as the focus of the virtual camera;
[0036] 12. The initial position of the virtual camera is determined with the goal of being able to completely capture the target space object when the virtual camera shoots towards the focal point in the horizontal and vertical directions of the screen.
[0037] 13. Control the virtual camera to shoot at the initial position along the specified shooting direction toward the focus to obtain an initial image including the target space object.
[0038] 14. Determine that the initial image does not meet the specified cover image boundary requirements based on the position of the target space object in the initial image, adjust the focus and / or position of the virtual camera until the target image that meets the cover image boundary requirements is captured, and use the target image as the cover image of the virtual three-dimensional scene.
[0039] The embodiment of the present application provides a method for generating a cover map of a house type distribution, which is applied to an electronic device, which may be a mobile phone, a laptop computer, a tablet computer, a desktop computer, or any other device with a screen. A graphical user interface is displayed on the screen of the electronic device, and a virtual three-dimensional scene of a target space object is displayed on the graphical user interface.
[0040] A virtual three-dimensional scene is a three-dimensional scene corresponding to a target space object constructed using computer technology, such as a VR scene or an AR scene corresponding to the target space. The target space object corresponds to a physical space object or a model of a physical space object that actually exists in the real world. The target space object is a virtualization of a physical space object or a model of a physical space object, and is a virtual space object. In an optional embodiment, the physical space object may be a house, a building, a community, or even a city, and the model of the physical space object may be a house model, a building model, a community model, or even a city model. Accordingly, the target space object may be a virtual house, a virtual building, a virtual community, or even a virtual city.
[0041] In the virtual 3D scene of this embodiment, there is a virtual camera, which is a virtual object simulating a real camera, equivalent to the user's eyes, used to observe the virtual 3D scene from different angles and project the virtual 3D scene onto a screen.
[0042] In this embodiment, the target spatial object has spatial dimensions, such as length, width, height, etc. Based on the spatial dimensions of the target spatial object, a target position point in the target spatial object is calculated as the focus of the virtual camera. Among them, the focus of the virtual camera is the point that the virtual camera initially looks at. The target position point can be any position point in the target spatial object, and there is no limitation on this. To accurately determine the focus, the spatial dimensions of the target spatial object can be calculated in combination with the world coordinate system. The world coordinate system includes the X-axis, Y-axis, and Z-axis. For example, taking the east-west direction as the X-axis, the north-south direction as the Z-axis, and the vertical direction of the plane where the east-west direction and the north-south direction are located as the Y-axis as an example for illustration. When the value ranges of the target spatial object on the X-axis, Y-axis, and Z-axis can be determined, denoted as [minX, maxX], [minY, maxY], and [minZ, maxZ], the value ranges of the target spatial object on the X-axis, Y-axis, and Z-axis refer to the spatial region defined by the minimum and maximum values of the target spatial object on the X-axis, Y-axis, and Z-axis. Among them, minX represents the minimum value of the target spatial object on the X-axis, and maxX represents the maximum value of the target spatial object on the X-axis; minY represents the minimum value of the target spatial object on the Y-axis, and maxY represents the maximum value of the target spatial object on the Y-axis; minZ represents the minimum value of the target spatial object on the Z-axis, and maxZ represents the maximum value of the target spatial object on the Z-axis. Based on these value ranges, a target position point in the target spatial object can be calculated as the focus of the virtual camera.
[0043] In an alternative embodiment, the midpoints of these value ranges can be calculated, that is, [(minX + maxX) / 2, (minY + maxY) / 2, (minZ + maxZ) / 2], as the target position point, which is also the focus of the virtual camera. This midpoint represents the central position of the target spatial object in each dimension, ensuring that the virtual camera can be aligned with the geometric center of the target spatial object during shooting, thereby obtaining the best perspective and composition. For example, the target spatial object is a community containing multiple buildings. This community contains three buildings, and the farthest corner points of each building are the maximum coordinates, and the nearest corner points are the minimum coordinates. The minimum corner point coordinates and maximum corner point coordinates of the first building are (X 1min , Y 1min , Z 1min ) = (5, 5, 1) and (X 1max , Y 1max , Z 1max ) = (15, 10, 5), and the minimum corner point coordinates and maximum corner point coordinates of the second building are (X 2min , Y 2min , Z 2min ) = (10, 5, 2) and (X 2max , Y 2max , Z 2max) = (20, 15, 6), the minimum and maximum corner coordinates of the third building are (X 3min , Y 3min , Z 3min ) = (15, 10, 3) and (X 3max , Y 3max , Z 3max ) = (25, 20, 7). Next, calculate the value ranges of the entire community on each axis. The value range of the X-axis: [minX, maxX] = [min(5, 10, 15), max(15, 20, 25)] = [5, 25]. The value range of the Y-axis: [minY, maxY] = [min(5, 5, 10), max(10, 15, 20)] = [5, 20]. The value range of the Z-axis: [minZ, maxZ] = [min(1, 2, 3), max(5, 6, 7)] = [1, 7]. Based on the value ranges of the above axes, calculate the geometric center point of the virtual community, that is, the focus of the virtual camera. The X coordinate of the focus is [(minX + maxX) / 2] = 15, the Y coordinate is [(minY + maxY) / 2] = 12.5, and the Z coordinate is [(minZ + maxZ) / 2] = 4. In this example, the focus of the virtual camera is set at the geometric center point, that is, the position point where X = 15, Y = 12.5, and Z = 4. The geometric center point of this virtual community, that is, the central position of the community, is set as the focus of the virtual camera. That is to say, the geometric center point of the community is used as the target position point. Such a focus selection helps to ensure that when shooting, the virtual camera can evenly capture the target space objects in the three-dimensional scene.
[0044] In this embodiment, with the goal that when the virtual camera shoots towards the focus in the horizontal and vertical directions of the screen respectively, it can completely shoot the target space object, the initial position of the virtual camera is determined. Among them, after selecting the focus, this embodiment further determines the initial position of the virtual camera, which is to calculate how far the virtual camera is from the focus so that when shooting towards the focus in the horizontal and vertical directions of the screen respectively, it can completely shoot the target space object. The horizontal direction of the screen refers to the left and right directions of the screen, corresponding to the X-axis in the camera coordinate system; the vertical direction of the screen refers to the up and down directions of the screen, corresponding to the Y-axis in the camera coordinate system. Among them, the direction of the screen includes three directions. In addition to the above horizontal and vertical directions of the screen, it also includes the depth direction of the screen. The depth direction of the screen refers to the front and back directions of the screen, corresponding to the Z-axis in the camera coordinate system. For example, if the target space object is a community containing multiple buildings, then the initial position of the virtual camera will be determined to be able to cover all the main roads, squares, greening areas, and each building in the community in both the horizontal and vertical directions of the screen.
[0045] In this embodiment, the virtual camera is controlled to shoot along the specified shooting direction toward the focus at the initial position to obtain an initial image including the target space object. After determining the initial focus and the initial position, the virtual camera is controlled to shoot along the specified shooting direction at the initial position to generate an initial image. Among them, the specified shooting direction is the predetermined direction of the virtual camera when shooting, for example, this direction can be a 45-degree downward viewing angle from the southeast direction; or it can also be the due north direction to highlight the main entrance and central square of the community; or it can also be the due south direction to focus on the leisure facilities and green belts of the community; or it can also be the due east direction to show the sunrise view of the community and the building complex on the east side; or it can also be the due west direction to capture the sunset beauty of the community and the residential buildings on the west side, which can be flexibly set according to application requirements. In this embodiment, the image obtained by shooting the virtual camera along the specified shooting direction toward the focus at the initial position is recorded as the initial image, and the initial image can be used as the cover image of the virtual three-dimensional scene if the cover image boundary requirements are met. Based on this, after obtaining the initial image, it can be determined whether the initial image meets the cover image boundary requirements to ensure that the ultimately generated cover image meets specific design and aesthetic standards.
[0046] If the initial image does not meet the specified cover image boundary requirements, adjust the focus and / or position of the virtual camera, and control the virtual camera to re-shoot according to the adjusted focus and / or position until the target image that meets the cover image boundary requirements is captured, and the target image is used as the cover image of the virtual three-dimensional scene. Among them, the cover image boundary requirements refer to specific requirements for the position and size of the target space object in the effective area of the cover image. For example, the position of the target space object can be located in the center of the effective area of the cover image to maintain visual balance, or it can be located directly above the effective area of the cover image to highlight the importance of the target space object and attract user attention; the size of the target space object can be scaled proportionally to ensure that the target space object can fully adapt to the boundary of the effective area in the cover image. The specific position and size of the target space object can be flexibly set according to application requirements. Among them, the effective area in the cover image refers to the area in the cover image used to display the target space object after removing the upper, lower, left and right blanks. Based on the upper, lower, left and right blanks of the cover image, the maximum range that the target space object can occupy in the horizontal and vertical directions can be determined, and then the boundary position of the effective area in the cover image can be obtained. Among them, the upper, lower, left and right blank design of the cover image can enhance visual clarity, highlight the content of the effective area in the cover image, and improve aesthetics and browsability. The target image refers to an image that meets the cover image boundary requirements obtained by adjusting the focus and / or position of the virtual camera and controlling the virtual camera to re-shoot the target space object according to the adjusted focus and / or position. Each time the virtual camera shoots the target space object, it shoots from the current position along the specified shooting direction toward the current focus.
[0047] After the initial image is generated, if it is found that the initial image does not meet the specific requirements of the position and size of the target space object in the effective area of the cover image, it is necessary to adjust the focus and / or position of the virtual camera and re-shoot the target space object according to the adjusted focus and / or position to optimize the position and size of the target space object in the captured image. This adjustment can ensure that the target space object in the image will not be cropped or deformed, while meeting the aesthetic and practical requirements of the design. If the re-shot image still does not meet the requirements of the cover image, continue to adjust, iterate, and continuously optimize the focus and position of the virtual camera until a target image that meets the requirements is captured, thereby ensuring that the cover image is not only visually attractive, but also displays content accurately and effectively, meeting the user's experience needs when browsing real estate projects using virtual reality technology.
[0048] In an optional embodiment, the target position point is implemented as the geometric center point of the target space object. For the focus of the virtual camera, it is the point that the virtual camera initially looks at, and it is also the geometric center point of the target space object. The geometric center is a specific implementation and the optimal performance. For example, if the target space object is a virtual cell, then its geometric center point is the center point of the virtual cell, that is, the midpoint of the range of values of the virtual cell in the east-west direction (i.e., the X-axis), the north-south direction (i.e., the Z-axis), and the vertical direction (i.e., the Y-axis) of the plane where the east-west direction and the north-south direction are located. This center point serves as the focus of the virtual camera of this virtual cell.
[0049] In the case where the above-mentioned target position point is implemented as the geometric center point of the target space object, the initial position of the virtual camera is determined with the goal of being able to completely capture the target space object when the virtual camera shoots toward the focus in the horizontal direction and the vertical direction of the screen respectively, including: taking the geometric center point of the target space object as the center of the sphere, and combining the spatial size of the target space object to generate a circumscribed sphere of the target space object; determining a first distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the vertical direction of the screen; determining a second distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction of the screen; taking the larger of the first distance and the second distance as the target distance at which the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction and the vertical direction of the screen; and determining the initial position of the virtual camera according to the specified shooting direction and target distance.
[0050] Specifically, the geometric center point of the target space object is taken as the sphere center, and the circumscribed sphere of the target space object is generated in combination with the spatial size of the target space object, such as Figure 2a The schematic diagram of the style of the circumscribed sphere provided for the exemplary embodiment of the present application is shown. The circumscribed sphere is the smallest sphere that contains the entire target space object. Based on the calculation of the center of the circumscribed sphere, the radius of the circumscribed sphere is calculated to obtain the circumscribed sphere. The center of the circumscribed sphere is the geometric center of the target space object, and the radius is the distance from the center of the circumscribed sphere to the farthest point of the target space object. Formula (1) is used to calculate the radius of the circumscribed sphere.
[0051]
[0052] Wherein, X, Y, and Z in formula (1) represent the three coordinate axes in the world coordinate system, namely, the east-west direction, the perpendicular direction of the plane where the east-west direction and the north-south direction are located, and the north-south direction; wherein, the meanings of minX, maxX, minY, maxY, minZ, and maxZ are the same as those defined above and are not repeated here; and R represents the radius of the circumscribed sphere.
[0053] In this embodiment, a circumscribed sphere of the target space object is generated and used to replace the target space object. When the virtual camera can capture the entire circumscribed sphere from an appropriate position, it means that the complete target space object can be captured.
[0054] Next, determine the distance that the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the vertical direction of the screen, and record it as the first distance. Specifically, the circumscribed sphere can be projected onto a plane perpendicular to the horizontal direction of the screen to form a circular area, and calculate how far the virtual camera is from the center of the sphere to ensure that the sphere is completely located in the plane perpendicular to the horizontal direction of the screen. Then, determine the distance that the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction of the screen, and record it as the second distance. Similarly, the circumscribed sphere can be projected onto a plane perpendicular to the vertical direction of the screen, and calculate how far the camera is from the center of the sphere to ensure that the sphere is completely located in the plane perpendicular to the vertical direction of the screen.
[0055] The first distance is compared with the second distance, and the larger distance is selected as the target distance, which ensures that the virtual camera can completely capture the circumscribed sphere in both horizontal and vertical directions. Finally, the initial position of the virtual camera is determined according to the specified shooting direction and target distance. This initial position is where the virtual camera is placed to ensure that it can capture the target space object from the best perspective.
[0056] Wherein, on the basis of determining the focus of the virtual camera and the target distance of the virtual camera, the initial position of the virtual camera is calculated, and the X component of the initial position coordinate of the virtual camera can be calculated using the following formula (2):
[0057] X -d = O.x+cameraDistance×Math.sin(verRadian)×Math.sin(horRadian) (2)
[0058] Wherein, Ox in formula (2) is the X component of the focal coordinate of the virtual camera; Math.sin represents the sine function, which is used to calculate the sine value of a given angle; X -d Indicates the X component of the initial position coordinates of the virtual camera.
[0059] The Y component of the initial position coordinates of the virtual camera can be calculated using the following formula (3):
[0060] Y -d = O.y+cameraDistance×Math.cos(verRadian) (3)
[0061] Wherein, Oy in formula (3) is the Y component of the focal coordinate of the virtual camera; Math.cos represents the cosine function, which is used to calculate the cosine value of a given angle; Y -d Indicates the Y component of the initial position coordinates of the virtual camera.
[0062] The Z component of the initial position coordinates of the virtual camera can be calculated using the following formula (4):
[0063] Z -d = O.z+cameraDistance×Math.sin(verRadian)×Math.cos(horRadian) (4)
[0064] Wherein, Oz in formula (4) is the Z component of the focal coordinate of the virtual camera; the meanings of Math.sin and Math.cos are the same as those in the above definition and will not be repeated here; Z -d Indicates the Z component of the initial coordinates of the virtual camera.
[0065] In the above formulas (2)-(4), cameraDistance represents the target distance of the virtual camera; horRadian represents the angle between the specified shooting direction and the Z axis of the circumscribed sphere when projected onto the plane where the X axis and Z axis are located. The size of the angle will vary depending on the specified shooting direction. For example, if the specified shooting direction is 45 degrees from the southeast and 45 degrees downward, the angle is 45 degrees southeast; verRadian represents the angle between the specified shooting direction and the Y axis of the circumscribed sphere. The size of the angle will vary depending on the specified shooting direction. For example, if the specified direction is 45 degrees from the southeast and 45 degrees downward, the angle is 45 degrees downward. It should be noted that the definitions of the X axis, Y axis and Z axis of the circumscribed sphere are different from those of the X axis, Y axis and Z axis of the world coordinate system in that the center of the circumscribed sphere is not equal to the origin of the world coordinate system, and the center is a certain position point in the world coordinate system.
[0066] In an optional embodiment, determining the first distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the vertical direction of the screen includes: projecting the circumscribed sphere to a first plane perpendicular to the horizontal direction of the screen (the first plane is also the plane where the vertical direction and depth direction of the screen are located) to obtain a first circular body, the center and radius of the first circular body are respectively the center and radius of the circumscribed sphere; according to the radius of the first circular body, on the first straight line passing through the center of the first circular body in the depth direction of the screen, determining the first position point tangent to both sides of the first circular body; calculating the distance between the first position point and the center of the first circular body as the first distance. Wherein, the first circular body is the minimum enclosing circle of the circumscribed sphere projected to the first plane perpendicular to the horizontal direction of the screen. Wherein, Figure 2b A schematic diagram of the state of calculating the first circle based on the projection of the virtual camera relative to the circumscribed sphere onto the first plane provided by an exemplary embodiment of the present application. Figure 2b As shown, the circumscribed sphere is projected onto a first plane perpendicular to the horizontal direction of the screen (i.e., the YOZ plane in the camera coordinate system) to obtain a first circular body, the center and radius of which are respectively the center and radius of the circumscribed sphere. According to the radius of the first circular body, a first position point tangent to both sides of the first circular body is determined on a first straight line passing through the center of the first circular body in the depth direction of the screen. The distance between the first position point and the center of the first circular body can be calculated using formula (5) as the first distance.
[0067]
[0068] Wherein, verticalDis in formula (5) represents the first distance; R represents the radius of the circumscribed sphere; Fov represents the field of view angle of the virtual camera in the vertical direction; the meaning of Math.sin is the same as that in the above definition and will not be repeated here. This formula is based on the principle of trigonometric function. It determines how far the virtual camera is from the target space object by the field of view angle and the radius of the sphere to ensure that the virtual camera can also completely capture the circumscribed sphere in the vertical direction of the screen.
[0069] In an optional embodiment, the same method for calculating the first distance can be used to calculate the second distance, and the calculation method is not repeated. In addition, in another optional embodiment, determining the second distance from the center of the sphere when the virtual camera can completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction of the screen includes: projecting the target space object to a second plane perpendicular to the vertical direction of the screen (the second plane is the plane where the horizontal direction and depth direction of the screen are located) to obtain a projection polygon, calculating the minimum circumscribed circle of the projection polygon to obtain a second body, and the center of the second body is the center of the circumscribed sphere; calculating the radius of the second body according to the spatial size of the target space object on the second plane, and obtaining the extension radius according to the spatial size of the target space object in the vertical direction of the world coordinate system; determining the second position point on the second straight line passing through the center of the second body in the depth direction of the screen according to the aspect ratio of the screen and the radius of the second body; calculating the distance between the second position point and the center of the second body as the third distance, and calculating the sum of the third distance and the extension radius as the second distance. Among them, the second circle is the minimum enclosing circle of the circumscribed sphere projected onto the second plane perpendicular to the vertical direction of the screen, and the second plane is the XOZ plane in the camera coordinate system; the third distance is obtained by dividing the radius of the second circle by the tangent value of half the vertical field of view of the virtual camera, divided by the aspect ratio of the cover image; the extended radius is calculated based on the radius of the target space object in the vertical direction in the world coordinate system when the virtual camera is looking down on the target space object completely. The extension radius is added to ensure that the virtual camera can completely capture the target space object even when looking down completely. In this embodiment, it is beneficial to improve the accuracy of the second distance, and thus to improve the accuracy of the final initial position of the virtual camera. Among them, Figure 2c A schematic diagram of the state of calculating the second circle projected onto the second plane by the virtual camera relative to the target space object provided by the exemplary embodiment of the present application. The second distance can be calculated using formula (6).
[0070]
[0071] Wherein, in formula (6), horizontalDis represents the second distance; horR represents the radius of the second circle, which is half of the distance between the two farthest points of the target space object in the horizontal direction; verR represents the extension radius, which is half of the distance between the highest point and the lowest point of the target space object in the vertical direction; Fov represents the field of view angle of the virtual camera in the vertical direction; coverHeight and coverWidth are the height and width of the cover image respectively; Math.tan represents the tangent function, which is used to calculate the tangent value of a given angle.
[0072] Wherein, in formula (6), the radius of the second circle can be calculated using the following formula (7):
[0073]
[0074] In formula (7), X and Z represent the coordinate axes in the east-west direction and the north-south direction in the world coordinate system, respectively; the meanings of minX, maxX, minZ, and maxZ are the same as those defined above and are not repeated here; horR represents the radius of the second circle.
[0075] The extension radius in formula (6) can be calculated using the following formula (8):
[0076] verR=(maxY - minY) / 2 (8)
[0077] In formula (8), Y represents the coordinate axis in the vertical direction of the plane where the east-west direction and the north-south direction of the world coordinate system are located; the meanings of minY and maxY are the same as those in the above definition and are not repeated here; verR represents the extension radius. Formula (6) takes into account the camera's field of view angle, the aspect ratio of the cover image, and the size of the target space object to ensure that the virtual camera can also fully capture the target space object in the horizontal direction of the screen.
[0078] For example, the target space object is a virtual shopping mall, the range of the shopping mall in the X-axis direction is -50 to 50, the range in the Z-axis direction is -50 to 50, the range in the Y-axis direction is 0 to 100, the field of view angle Fov of the virtual camera in the vertical direction is 90 degrees, the radian value is π / 2, the width of the cover image is 1920 pixels, and the height is 1080 pixels. First, the first distance is calculated. The first distance is 50√6 obtained by the above formula (5). Then, the second distance is calculated. The radius and extension radius of the second circle are 50√2 and 50 respectively obtained by the above formulas (7) and (8). The result is substituted into the above formula (6) to obtain the second distance of 28.125√2+50. By comparing the first distance and the second distance, the larger value is taken as the target distance of the virtual camera. In this example, the first distance is selected as the target distance. Finally, according to the specified shooting direction of 45 degrees southeast, 45 degrees downward, and the target distance of 50√6, the initial position of the virtual camera is determined. The virtual camera should be placed in the southeast direction of the shopping center, 50√6 away from the geometric center of the shopping center.
[0079] In an optional embodiment, the effective area in the cover image can be determined according to the cover image requirements. The effective area is the position area of the desired target space object in the image, which can be specifically determined according to the cover image requirements. For the convenience of distinction and description, the area where the target space object is actually located in the initial image is called the actual area; if the actual area coincides with the effective area or the positional relationship between the two is within a certain error range, it is considered that the initial image where the target space object is currently located meets the cover image requirements, and the initial image can be used as the cover image of the virtual three-dimensional scene where the target space object is located; if the actual area does not coincide with the effective area or the positional relationship between the two is not within a certain error range, it is determined that the initial image does not meet the cover image requirements, and the focus and / or position of the virtual camera needs to be adjusted until the target image that meets the specified cover image requirements is captured.
[0080] Based on the above, determining that the initial image does not meet the specified cover image boundary requirements based on the position of the target space object in the initial cover image includes: calculating the actual area in which the target space object appears in the initial image based on the position of the target space object in the initial image; calculating the effective area in the initial image based on the specified cover image boundary requirements, the effective area refers to the area position where the target space object is expected to appear in the initial image according to the specified cover image boundary requirements; if the center point of the actual area does not coincide with the center point of the effective area or is not within a preset first position error, and / or if the boundary of the actual area does not coincide with the boundary of the effective area or is not within a set second position error, determining that the initial image does not meet the specified cover image boundary requirements.
[0081] in, Figure 3 This is a schematic diagram of the relationship between the position of the boundary of the effective area where the target space object is located in the cover image and the boundary position of the cover image provided by the exemplary embodiment of the present application. Figure 3 As shown, when calculating the effective area position, first determine the overall size of the cover image, including its width and height. Starting from the total width of the cover image, determine the blank space on each side. The blank space is the blank area from the edge of the cover image to the effective area. The following formula (9) can be used to calculate the effective area boundary position in the horizontal (left boundary, right boundary) direction of the screen.
[0082]
[0083] In formula (9), 1 represents the maximum value of the screen border, that is, the distance from the leftmost or rightmost end of the screen to the vertical center line of the screen. The distance here is a normalized representation, but is not limited to this; coverPadding represents the blank space; coverWidth has the same meaning as defined above and is not repeated here; MaxProjX represents the border position of the effective area in the horizontal direction of the screen. A similar method is adopted in the horizontal direction, and the following formula (10) is used to calculate the border position of the effective area in the vertical (upper border, lower border) direction of the screen.
[0084]
[0085] Wherein, in formula (10), 1 represents the maximum value of the screen border, that is, the distance from the bottom or top of the screen to the horizontal line of the center of the screen. The distance here is a normalized representation, but is not limited to this; coverPadding represents the blank space; coverHeight has the same meaning as defined above and is not repeated here; MaxProjY represents the effective area boundary position in the vertical direction. It is noted that in the above embodiments and the attached drawings, Figure 3 In the example, the sizes of the blank spaces on the four boundaries of the cover image are the same, but the invention is not limited thereto. Depending on the application scenario of the cover image and the target space object, the sizes of the blank spaces on the various boundaries may be different.
[0086] In an optional embodiment, the focus and / or position of the virtual camera is adjusted until a target image that meets the specified cover image boundary requirements is captured, including: determining an adjustment object based on whether the center points of the actual area where the target space object is located coincide with the center points of the effective area or are not within a preset first position error, and whether the boundary of the actual area where the target space object is located coincides with the boundary of the effective area or are not within a set second position error, the adjustment object being the focus and / or position of the virtual camera, and the focus and position of the virtual camera are respectively used to change the position and size of the target space object in the cover image; adjusting the adjustment object at least once in a manner that is compatible with the adjustment object, and controlling the virtual camera to re-shoot in the specified shooting direction based on the adjusted adjustment object until the target image that meets the specified cover image boundary requirements is captured. Among them, the center point of the effective area is the position of the intersection of the diagonals of the effective area; the rectangle formed by the four boundaries of the actual area of the target space object in the effective area is the minimum enclosing rectangle of the plane diagram formed by all the projection points of the target space object projected onto the screen, so in judging whether the four boundaries of the effective area coincide with the four boundaries of the actual area of the target space object in the effective area respectively, the four boundaries of the actual area of the target space object are the four boundaries of the above-mentioned minimum enclosing rectangle, and these projection points are the points where the target space object in the three-dimensional scene is projected onto the two-dimensional plane. In this optional embodiment, the relationship between the center point of the target space object and the center point of the effective area of the cover image and the relationship between the four boundaries of the target space object and the four boundaries of the effective area are analyzed to determine the adjustment object. The adjustment object can be the focus and / or position of the virtual camera. By changing these properties of the virtual camera, the visual presentation of the target space object in the final image can be adjusted, including its position and size. According to the adjustment object determined above, the focus and / or position of the virtual camera is adjusted in a method that matches the adjustment object. Adjusting the focus of the virtual camera can change the position of the effective area of the target object in the cover image, and adjusting the position of the virtual camera can enlarge or reduce the visual representation of the effective area of the target space object in the cover image. Then, the virtual camera retakes the image using the updated focus and / or position, and checks whether it meets the requirements of the cover image boundary. If the image still does not meet the requirements, this adjustment process will be repeated until the captured image fully meets the cover image standard or the number of adjustments reaches the preset maximum number of iterations.
[0087] In an optional embodiment, the adjustment object is determined based on whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within a set second position error, including: when the center point of the actual area and the center point of the effective area do not coincide with each other or are not within the preset first position error, determining that the focus and the position of the virtual camera are both adjustment objects; when the center point of the actual area and the center point of the effective area coincide with each other or are within the preset first position error, but the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within the set second position error, determining that the position of the virtual camera is the adjustment object. Among them, the first position error refers to the maximum deviation error allowed between the center point of the actual area of the target space object and the center point of the effective area. If the center point of the actual area of the target space object deviates from the center point of the effective area, that is, exceeds this error range, then the adjustment object is considered to be the focus and position of the virtual camera; the second position error refers to the maximum deviation distance allowed between the boundary of the actual area of the target space object and the boundary of the effective area. Even if the center point of the actual area of the target space object and the center point of the effective area have overlapped or are within the first position error range, but the boundary of the actual area of the target space object is not aligned with the boundary of the effective area or exceeds the second position error range, it is necessary to adjust the position of the virtual camera to make the actual area of the target space object visually aligned with the effective area. Among them, by adjusting the focus of the virtual camera, the specific position of the target space object in the cover image can be changed to ensure that the center point of the target space object coincides with the center point of the effective area or is within the first position error range; by adjusting the position of the virtual camera, the visual size of the target space object in the effective area of the cover image can be changed, and its boundary is completely aligned with the boundary of the effective area or within the second position error range, so as to achieve the display effect required by the cover image.
[0088] According to the above process, the adjustment object is determined, and the following embodiments respectively list three relevant situations:
[0089] In Example A1, the initial image of the virtual art gallery shows that the center point of the gallery coincides with the center point of the effective area of the cover image within the error range, but the four boundaries of the gallery are not aligned with the four boundaries of the effective area, resulting in insufficient display of the gallery in the effective area. Therefore, it is determined that the adjustment object is the position of the virtual camera. By fine-tuning the camera position, the position of the virtual camera is close to the virtual art gallery. After adjusting the position of the virtual camera, the four boundaries of the gallery are completely consistent with the four boundaries of the effective area respectively, ensuring the complete display of the gallery image in the cover image and improving the visual effect.
[0090] In Example A2, the initial image of the virtual cell shows that the center point of the cell does not coincide with the center point of the effective area, and the adjustment objects are determined to be the focus and distance of the virtual camera, and the right border of the cell is aligned with the right border of the effective area, and the other borders of the cell are not aligned with the borders of the effective area, resulting in insufficient display of the cell in the effective area. Therefore, the focus and position of the virtual camera are adjusted at the same time, and shooting is performed after each adjustment. If the cover image still does not meet the requirements, the focus and position adjustment will continue to be performed until a satisfactory display effect is achieved.
[0091] In Example A3, the initial image of the virtual library shows that the center point of the library coincides with the center point of the effective area, and all boundaries of the library are correspondingly aligned with the boundaries of the effective area. The effective area has fully and completely displayed the layout of the library and meets the cover image requirements without any adjustment.
[0092] In an optional embodiment, the adjustment object is adjusted at least once according to a method adapted to the adjustment object, including: before each adjustment of the adjustment object, it is determined whether the number of continuous adjustments to the adjustment object has reached a preset maximum number of iterations; if not, the adjustment object is adjusted once according to a method adapted to the adjustment object, and the number of continuous adjustments to the adjustment object is increased by 1; if yes, the adjustment of the adjustment object is terminated. Wherein, the process starts with setting a maximum number of iterations to limit the number of adjustments to improve efficiency and avoid waste of resources. Before each adjustment, it can be checked whether the current number of adjustments has reached this upper limit. If it has not been reached, the virtual camera will be adjusted once according to a predetermined adaptation method, which includes adjusting the focus and / or position of the camera to obtain a better viewing angle. After each adjustment, the number of adjustments can be recorded and it can be checked whether the focus or position of the camera has changed. If the adjustment results in a change and the number of adjustments does not reach the upper limit, the process will continue. If the focus and position do not change after one adjustment, or the number of adjustments has reached the preset maximum value, the system will end the adjustment process and consider that the best camera settings have been found and the target image that meets the requirements of the cover image can be generated.
[0093] In an optional embodiment, the adjustment object is adjusted at least once in a manner adapted to the adjustment object, including: if the adjustment object includes the focus of the virtual camera, the target space object is projected onto the third plane where the screen is located according to the current position and current focus of the virtual camera, and the vertices of the target space object correspond to the projection points on the third plane; the horizontal axis offset and the vertical axis offset corresponding to the current focus are determined according to the extreme values in the horizontal axis coordinates and the extreme values in the vertical axis coordinates of each projection point on the third plane; the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus are determined according to the horizontal axis offset and the vertical axis offset corresponding to the current focus; the adjusted focus position is determined according to the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus. Figure 5 The state diagram of calculating and adjusting the focus of a virtual camera provided by an exemplary embodiment of the present application is shown. Among them, the adjustment object is determined according to the above embodiment, and now the focus of the virtual camera is adjusted according to the determined adjustment object and the way the adjustment object is adapted. This includes projecting the target space object onto the screen, and determining the horizontal axis offset and the vertical axis offset corresponding to the current focus according to the horizontal axis and vertical axis coordinate extreme values of the projection point. Then, the adjustment amplitude of the horizontal axis and the vertical axis is determined according to these offsets, and the adjusted focus position is determined accordingly. Among them, the current deviation is calculated, which is obtained by obtaining the average value of the maximum and minimum values of the horizontal and vertical coordinates of all projected coordinates, or it can be obtained by obtaining the horizontal and vertical coordinates of all projected coordinates and performing weighted summation respectively. If the absolute value of the current deviation is greater than the set offset threshold, it is determined that the focus of the virtual camera needs to be further adjusted, and the current deviation is compared with the adjustment offset of the focus in the horizontal axis direction. If the current deviation is larger, the adjustment amplitude is reduced to half of the original; if not, the current deviation is saved for the next offset comparison, and the above steps are repeated. Next, the movement of the virtual camera focus on the horizontal axis is calculated by multiplying the current deviation, the tangent value of half the virtual camera's field of view, the current virtual camera's distance, and the screen's aspect ratio; the movement of the virtual camera focus on the vertical axis is calculated by multiplying the current deviation, the tangent value of half the virtual camera's field of view, and the current virtual camera's distance; the calculated movement of the horizontal and vertical axes are respectively multiplied by the corresponding adjustment amplitude to update the virtual camera's focal coordinates. Among them, if both the focus and position of the virtual camera need to be adjusted, during the iteration process, the distance of the current virtual camera is the calculated target distance for the first time, and the fifth distance calculated when the virtual camera position is adjusted during the first iteration for the second time, and so on.
[0094] In an optional embodiment, the adjustment object is adjusted at least once in a manner adapted to the adjustment object, including: if the adjustment object includes the position of the virtual camera, then according to the current position and current focus of the virtual camera, the target space object is projected onto the third plane where the screen is located, and the vertices of the target space object correspond to the projection points on the third plane; the fourth distance and fifth distance that the virtual camera should satisfy from the current focus when each projection point in the third plane falls on the horizontal and vertical boundaries of the screen respectively; the larger distance is selected from the fourth distance and the fifth distance as the sixth distance, that is, the distance that the virtual camera should satisfy from the current focus when all the projection points of the target space object are displayed on the screen; the position of the virtual camera is recalculated according to the sixth distance, the current focus and the specified shooting direction to obtain the adjusted position. Figure 6 The state diagram provided for the exemplary embodiment of the present application when the projection point of the calculated target space object is exactly at the boundary of the effective area is shown. In order to adjust the camera position, the sixth distance must be calculated first. The sixth distance is the maximum value of the horizontal and vertical boundary camera distances, that is, the maximum value between the fourth distance and the fifth distance. The virtual camera position determined according to this distance can ensure that the target space object can be in the effective area of the cover image.
[0095] Among them, according to the depth of each point in the target space object in the camera coordinate system and the projection coordinates of each point on the screen, for each point on the screen, calculate the camera distance required to ensure that the point is still clearly visible if it is projected exactly on the boundary of the valid area in the cover image.
[0096] The fourth distance is the virtual camera distance when each point of the target space object is projected exactly on the horizontal boundary of the effective area in the cover image. The ratio of the absolute value of the horizontal coordinate of the projection of the point on the effective area to the horizontal coordinate of the maximum projection on the effective area is calculated. This ratio represents the position of the projection of the point relative to the center point of the effective area. If the ratio is close to 0, the projection of the point is close to the center point of the effective area; if the ratio is close to 1, the projection of the point is close to the edge of the effective area. Then, multiply this ratio by the depth of the point. This ratio reflects the position of the projection of the point relative to the center point of the effective area, and the depth of the point is the projection distance of the vector from the camera position to the point in the direction of the camera's line of sight. This ratio multiplied by the depth of the point obtains the depth of the new camera position to the point if the projection of the point is at the edge of the effective area. Finally, add this distance to the difference between the current distance from the camera to the virtual camera focus and the depth of the point to obtain an accurate camera distance so that the projection of the point is exactly on the horizontal boundary of the effective area, and obtain the fourth distance.
[0097] The fifth distance is the virtual camera distance when each point of the target space object is projected exactly on the vertical boundary of the effective area in the cover image. The ratio of the absolute value of the ordinate of the projection of the point on the effective area to the maximum projection ordinate on the effective area is calculated. This ratio represents the position of the projection of the point relative to the center point of the effective area. If the ratio is close to 0, the projection of the point is close to the center point of the effective area; if the ratio is close to 1, the projection of the point is close to the edge of the effective area. Then, multiply this ratio by the depth of the point. This ratio reflects the position of the projection of the point relative to the center point of the effective area, and the depth of the point is the projection distance of the vector from the camera position to the point in the direction of the camera's line of sight. This ratio multiplied by the depth of the point obtains the depth of the new camera position to the point if the projection of the point is at the edge of the effective area. Finally, add this distance to the difference between the current distance from the camera to the virtual camera focus and the depth of the point to obtain an accurate camera distance so that the projection of the point is exactly on the vertical boundary of the screen, and obtain the fifth distance. By comparing the maximum value obtained in the horizontal and vertical boundary camera distances, it is used as the adjusted virtual camera distance, that is, the sixth distance.
[0098] Each time the focus or position is adjusted, the calculated sixth distance can be used as the distance of the current virtual camera calculated when the focus of the virtual camera is adjusted next time in the iteration process. During the iteration process, the sixth distance will be recalculated after each adjustment of the focus or position. This new sixth distance will be used as the current distance of the camera in the next iteration to adjust the focus of the virtual camera, and is used to calculate the new focus coordinates and camera position. This process is continuous, and each iteration will update the parameters based on the results of the previous one. For example, the target space object is a virtual house. First, the initial focus of the virtual camera is determined to be the geometric center point of the virtual house, and the target distance is calculated to be 311.84 based on the spatial size of the house. This is the distance that the camera should meet from the focus in order to fully capture the house. Then, take an image at the initial position of the camera, and determine that the focus and position of the virtual camera need to be adjusted based on the relationship between the actual area of the target space object and the effective area in the cover image. At this time, the target distance is used to calculate the focus position of the virtual camera; after adjustment, the first sixth distance is 328.33, and the second image is taken based on the new focus and the first sixth distance. Continue to take the second image based on the relationship between the actual area of the house in the image and the effective area in the cover image, and then it is found that the focus and position of the virtual camera still need to be adjusted. At this time, the focus position of the virtual camera will use the first sixth distance; after adjustment, the second sixth distance is 335.29, and then the third image is taken. This process is continuous, and each iteration will update the parameters according to the previous result until the cover image meets the requirements or the number of adjustments reaches the preset maximum number of iterations, and the iteration is terminated. This iterative method is more efficient and reduces the waste of computing resources and time.
[0099] According to this new camera distance, the position of the camera is recalculated to achieve the best visual effect. The above process of adjusting the focus and position of the virtual camera can be iterated multiple times until the focus and position of the virtual camera are optimized to meet specific visual requirements. The iterative process can be referred to in the above embodiment, so it will not be repeated here.
[0100] The cover image can be obtained by using the above embodiment. Taking a community including multiple buildings as an example, the generated cover image is as follows: Figure 7-9 It is worth noting that Figure 7-Figure 9 The cover images shown are generated for different communities, and different communities contain different numbers of buildings and building layouts.
[0101] Figure 6 The following is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. Figure 6 As shown, the device includes: a processor 65 and a memory 64.
[0102] The memory 64 is used to store computer programs and can be configured to store various other data to support operations on the device for generating the housing layout cover map. Examples of such data include instructions for any application or method used to operate on the electronic device, housing layout data, user interface elements, image files, three-dimensional models, etc.
[0103] The memory 64 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0104] The processor 65 is coupled to the memory 64 and is used to execute the computer program in the memory 64, so as to: calculate the target position point in the target space object as the focus of the virtual camera based on the spatial size of the target space object; determine the initial position of the virtual camera with the goal of being able to completely capture the target space object when the virtual camera shoots toward the focus in the horizontal direction and the vertical direction of the screen respectively; control the virtual camera to shoot toward the focus along the specified shooting direction at the initial position to obtain an initial image including the target space object; if it is determined that the initial image does not meet the specified cover image boundary requirements based on the position of the target space object in the initial image, adjust the focus and / or position of the virtual camera until the target image that meets the specified cover image boundary requirements is captured, and use the target image as the cover image of the virtual three-dimensional scene.
[0105] In an optional embodiment, the target position point is implemented as the geometric center point of the target space object. Based on this, the processor 65 determines the initial position of the virtual camera with the goal of being able to completely capture the target space object when the virtual camera shoots toward the focus in the horizontal direction and vertical direction of the screen, including: taking the geometric center point of the target space object as the sphere center, and combining the spatial size of the target space object, generating a circumscribed sphere of the target space object; determining the first distance from the sphere center when the virtual camera shoots toward the sphere center in the vertical direction of the screen, when the circumscribed sphere can be completely captured; determining the second distance from the sphere center when the virtual camera shoots toward the sphere center in the horizontal direction of the screen, when the circumscribed sphere can be completely captured; taking the larger distance between the first distance and the second distance as the target distance for the virtual camera to completely capture the circumscribed sphere when the virtual camera shoots toward the sphere center in the horizontal direction and vertical direction of the screen; determining the initial position of the virtual camera according to the specified shooting direction and target distance.
[0106] In an optional embodiment, the processor 65 determines a first distance from the center of the sphere when the virtual camera is able to completely capture the circumscribed sphere when shooting toward the center of the sphere in the vertical direction of the screen, including: projecting the circumscribed sphere to a first plane perpendicular to the horizontal direction of the screen to obtain a first circular body, the center and radius of the first circular body being the center and radius of the circumscribed sphere respectively; according to the radius of the first circular body, on a first straight line passing through the center of the first circular body in the depth direction of the screen, a first position point tangent to both sides of the first circular body is determined; and the distance between the first position point and the center of the first circular body is calculated as the first distance.
[0107] In an optional embodiment, the processor 65 determines the second distance from the center of the sphere when the virtual camera is able to completely capture the circumscribed sphere when shooting toward the center of the sphere in the horizontal direction of the screen, including: projecting the target space object to a second plane perpendicular to the vertical direction of the screen to obtain a projection polygon, calculating the minimum circumscribed circle of the projection polygon to obtain a second body, the center of the second body being the center of the circumscribed sphere; calculating the radius of the second body according to the spatial size of the target space object on the second plane, and obtaining the extended radius according to the spatial size of the target space object in the vertical direction of the world coordinate system; determining a second position point on a second straight line passing through the center of the second body in the depth direction of the screen according to the aspect ratio of the screen and the radius of the second body; calculating the distance between the second position point and the center of the second body as a third distance, and calculating the sum of the third distance and the extended radius as the second distance.
[0108] In an optional embodiment, the processor 65 determines that the initial image does not meet the specified cover image boundary requirements based on the position of the target space object in the initial cover image, including: calculating the actual area in which the target space object appears in the initial image based on the position of the target space object in the initial image; calculating the effective area in the initial image based on the specified cover image boundary requirements, the effective area refers to the area position where the target space object is expected to appear in the initial image according to the specified cover image boundary requirements; if the center point of the actual area and the center point of the effective area do not coincide with each other or are not within a preset first position error, and / or if the boundary of the actual area does not coincide with the boundary of the effective area or is not within a set second position error, it is determined that the initial image does not meet the specified cover image boundary requirements.
[0109] In an optional embodiment, the processor 65 adjusts the focus and / or position of the virtual camera until a target image that meets the specified cover image boundary requirements is captured, including: determining an adjustment object based on whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area coincides with the boundary of the effective area or are not within a set second position error, the adjustment object being the focus and / or position of the virtual camera, and the focus and position of the virtual camera are respectively used to change the position and size of the target space object in the cover image; adjusting the adjustment object at least once according to a method adapted to the adjustment object, and controlling the virtual camera to re-shoot in the specified shooting direction according to the adjusted adjustment object until a target image that meets the specified cover image boundary requirements is captured.
[0110] In an optional embodiment, the processor 65 determines the adjustment object according to whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within a set second position error, including: when the center point of the actual area and the center point of the effective area do not coincide with each other or are not within a preset first position error, determining that the focus and the position of the virtual camera are both adjustment objects; when the center point of the actual area and the center point of the effective area coincide with each other or are within a preset first position error, but the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within a set second position error, determining that the position of the virtual camera is the adjustment object.
[0111] In an optional embodiment, the processor 65 adjusts the adjustment object at least once according to a method adapted to the adjustment object, including: before each adjustment to the adjustment object, determining whether the number of continuous adjustments to the adjustment object has reached a preset maximum number of iterations; if not, adjusting the adjustment object once according to a method adapted to the adjustment object, and adding 1 to the number of continuous adjustments to the adjustment object; if so, ending the adjustment of the adjustment object.
[0112] In an optional embodiment, the processor 65 adjusts the adjustment object at least once in a manner adapted to the adjustment object, including: if the adjustment object includes the focus of the virtual camera, projecting the target space object onto the third plane where the screen is located according to the current position and current focus of the virtual camera, and the vertices of the target space object correspond to the projection points on the third plane; determining the horizontal axis offset and the vertical axis offset corresponding to the current focus according to the extreme values in the horizontal axis coordinates and the extreme values in the vertical axis coordinates of each projection point on the third plane; determining the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus according to the horizontal axis offset and the vertical axis offset corresponding to the current focus; determining the adjusted focus position according to the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus.
[0113] In an optional embodiment, the processor 65 adjusts the adjustment object at least once in a manner adapted to the adjustment object, including: if the adjustment object includes the position of the virtual camera, then according to the current position and current focus of the virtual camera, the target space object is projected onto the third plane where the screen is located, and the vertices of the target space object correspond to the projection points on the third plane; calculating the fourth distance and fifth distance that the virtual camera should satisfy from the current focus when each projection point in the third plane falls on the horizontal boundary and the vertical boundary of the screen respectively; selecting the larger distance from the fourth distance and the fifth distance as the sixth distance, that is, determining the distance that the virtual camera should satisfy from the current focus when all the projection points on the third plane are displayed on the screen; and recalculating the position of the virtual camera according to the sixth distance, the current focus and the specified shooting direction to obtain the adjusted position.
[0114] Further, if Figure 6 As shown, the computing platform also includes: a communication component 66, a display 67, a power component 68, an audio component 69 and other components. Figure 6 Only some components are shown schematically, which does not mean that the computing platform only includes Figure 6 In addition, Figure 6The components in the dashed box are optional components, not mandatory components, and the specific components depend on the product form of the working node. The working node of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT device, or a server-side device such as a conventional server, a cloud server, or a server array. If the working node of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, etc., it can include Figure 6 If the working node of this embodiment is implemented as a server device such as a conventional server, a cloud server or a server array, it may not include Figure 6 Components within the dashed box.
[0115] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by the computing platform in the above method embodiment.
[0116] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0117] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
[0118] The above-mentioned display includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0119] The power supply assembly provides power to various components of the device where the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply assembly is located.
[0120] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.
[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-readable storage media (including but not limited to disk storage, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage, etc.) containing computer-usable program code.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 generate 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.
[0123] 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 including 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.
[0124] 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.
[0125] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interface, network interface and memory.
[0126] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0127] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0128] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0129] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for generating a cover image of apartment type distribution, characterized in that: Applied to an electronic device, a graphical user interface is displayed on a screen of the electronic device, a virtual three-dimensional scene of a target space object is displayed on the graphical user interface, and the virtual three-dimensional scene includes a virtual camera. The method includes: Based on the spatial size of the target spatial object, calculating a target position point in the target spatial object as the focus of the virtual camera; Determining an initial position of the virtual camera with the goal of being able to completely capture the target space object when the virtual camera is shooting toward the focal point in the horizontal direction and the vertical direction of the screen respectively; Controlling the virtual camera to shoot at the initial position along a specified shooting direction toward the focus to obtain an initial image including the target space object; If it is determined based on the position of the target space object in the initial image that the initial image does not meet the specified cover image boundary requirements, adjust the focus and / or position of the virtual camera until the target image that meets the specified cover image boundary requirements is captured, and use the target image as the cover image of the virtual three-dimensional scene.
2. The method according to claim 1, characterized in that: The target position point is implemented as the geometric center point of the target space object; when the virtual camera shoots toward the focus in the horizontal direction and the vertical direction of the screen respectively, the target space object can be completely photographed as the goal, and the initial position of the virtual camera is determined, including: Taking the geometric center point of the target space object as the sphere center and combining the spatial size of the target space object, generating a circumscribed sphere of the target space object; Determine a first distance from the sphere center when the virtual camera is able to completely capture the circumscribed sphere when shooting toward the sphere center in the vertical direction of the screen; Determine a second distance from the sphere center when the virtual camera is able to completely capture the circumscribed sphere when shooting toward the sphere center in the horizontal direction of the screen; The larger distance between the first distance and the second distance is used as a target distance at which the virtual camera can completely capture the circumscribed sphere when shooting toward the sphere center in both the horizontal direction and the vertical direction of the screen; The initial position of the virtual camera is determined according to the specified shooting direction and the target distance.
3. The method according to claim 2, characterized in that Determining a first distance from the sphere center when the virtual camera can completely capture the circumscribed sphere when shooting toward the sphere center in the vertical direction of the screen includes: Projecting the circumscribed sphere onto a first plane perpendicular to the horizontal direction of the screen to obtain a first circular body, wherein the center and radius of the first circular body are respectively the center and radius of the circumscribed sphere; According to the radius of the first circular body, determining a first position point tangent to two sides of the first circular body on a first straight line passing through the center of the first circular body in the depth direction of the screen; The distance between the first position point and the center of the first circle is calculated as the first distance.
4. The method according to claim 2, characterized in that: Determining a second distance from the sphere center when the virtual camera can completely capture the circumscribed sphere when shooting toward the sphere center in the horizontal direction of the screen includes: Projecting the target space object onto a second plane perpendicular to the vertical direction of the screen to obtain a projection polygon, calculating the minimum circumscribed circle of the projection polygon to obtain a second circular body, the center of the second circular body being the center of the circumscribed sphere; Calculating the radius of the second circular body according to the spatial size of the target spatial object on the second plane, and obtaining the extension radius according to the spatial size of the target spatial object in the vertical direction of the world coordinate system; Determine a second position point on a second straight line passing through the center of the second circular body in the depth direction of the screen according to the aspect ratio of the screen and the radius of the second circular body; The distance between the second position point and the center of the second circular body is calculated as the third distance, and the sum of the third distance and the extension radius is calculated as the second distance.
5. The method according to any one of claims 1 to 4, characterized in that: Determining, according to the position of the target space object in the initial cover image, that the initial image does not meet the specified cover image boundary requirement includes: Calculating an actual area where the target space object appears in the initial image according to the position of the target space object in the initial image; According to the specified cover image boundary requirement, calculating the effective area in the initial image, the effective area refers to the area position where the target spatial object is expected to appear in the initial image according to the specified cover image boundary requirement; If the center point of the actual area does not coincide with the center point of the effective area or is not within a preset first position error, and / or if the boundary of the actual area does not coincide with the boundary of the effective area or is not within a preset second position error, It is determined that the initial image does not meet specified cover image boundary requirements.
6. The method according to claim 5, characterized in that Adjusting the focus and / or position of the virtual camera until a target image that meets the specified cover image boundary requirements is captured, including: According to whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area coincides with the boundary of the effective area or are not within a set second position error, determining an adjustment object, wherein the adjustment object is the focus and / or position of the virtual camera, and the focus and position of the virtual camera are respectively used to change the position and size of the target space object in the cover image; The adjustment object is adjusted at least once in a manner adapted to the adjustment object, and the virtual camera is controlled to shoot again in the specified shooting direction according to the adjusted adjustment object until a target image that meets the specified cover image boundary requirements is captured.
7. The method according to claim 6, characterized in that Determining the adjustment object according to whether the center point of the actual area and the center point of the effective area coincide with each other or are not within a preset first position error, and whether the boundary of the actual area and the boundary of the effective area do not coincide with each other or are not within a set second position error, includes: When the center point of the actual area and the center point of the effective area do not coincide with each other or are not within a preset first position error, determining that the focus and the position of the virtual camera are both adjustment objects; When the center point of the actual area coincides with the center point of the effective area or is within a preset first position error, but the boundary of the actual area does not coincide with the boundary of the effective area or is not within a set second position error, the position of the virtual camera is determined to be the adjustment object.
8. The method according to claim 6, characterized in that According to a method adapted to the adjustment object, the adjustment object is adjusted at least once, including: Before adjusting the adjustment object each time, determining whether the number of consecutive adjustments to the adjustment object has reached a preset maximum number of iterations; If not, the adjustment object is adjusted once according to a method adapted to the adjustment object, and the number of consecutive adjustments to the adjustment object is increased by 1; if so, the adjustment of the adjustment object is terminated.
9. The method according to claim 6, characterized in that According to a method adapted to the adjustment object, the adjustment object is adjusted at least once, including: If the adjustment object includes the focus of the virtual camera, projecting the target space object onto a third plane where the screen is located according to the current position and current focus of the virtual camera, the vertices of the target space object correspond to the projection points on the third plane; Determine the horizontal axis offset and the vertical axis offset corresponding to the current focus respectively according to the extreme values in the horizontal axis coordinates and the extreme values in the vertical axis coordinates of each projection point on the third plane; According to the horizontal axis offset and the vertical axis offset corresponding to the current focus, respectively determine the horizontal axis adjustment amplitude and the vertical axis adjustment amplitude corresponding to the current focus; The adjusted focus position is determined according to the horizontal axis adjustment range and the vertical axis adjustment range corresponding to the current focus.
10. The method according to claim 6, characterized in that According to a method adapted to the adjustment object, the adjustment object is adjusted at least once, including: If the adjustment object includes the position of the virtual camera, projecting the target space object onto a third plane where the screen is located according to the current position and current focus of the virtual camera, the vertices of the target space object correspond to the projection points on the third plane; Calculating a fourth distance and a fifth distance that the virtual camera should satisfy from the current focus when each projection point in the third plane falls on the horizontal boundary and the vertical boundary of the screen respectively; Selecting a larger distance from the fourth distance and the fifth distance as a sixth distance, that is, determining that all the projection points on the third plane are displayed on the screen requires the distance from the virtual camera to the current focus to be satisfied; The position of the virtual camera is recalculated according to the sixth distance, the current focus and the specified shooting direction to obtain an adjusted position.
11. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the processor is enabled to implement the steps in the method according to any one of claims 1 to 10.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is enabled to implement the steps in the method according to any one of claims 1 to 10.
13. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of the method according to any one of claims 1 to 10.