Inspection animation generation method, device, computer equipment and storage medium
By determining the inspection point position and the target position in the preset scene 3D model, and calculating the inspection position and target position at each playback moment in real time, an inspection animation is generated. This solves the problem of difficulty in determining the inspection point position and angle in the existing technology and improves the generation efficiency of the inspection animation.
Patent Information
- Application Number
- CN202410004969.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-01-02
AI Technical Summary
Existing technologies cannot provide a convenient method to determine the location and angle of inspection points, resulting in low efficiency in generating inspection animations during automated remote inspections.
By acquiring the inspection point positions and target positions in the preset scene 3D model, and combining them with the preset total playback time, the inspection positions and target positions at each playback moment are calculated in real time to generate inspection animations.
It enables the automated generation of inspection trajectories and inspection animations, improving the efficiency of automated inspection animation generation.
Smart Images

Figure CN117808935B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a method, apparatus, computer device, and storage medium for generating inspection animations. Background Technology
[0002] With the development of computer technology and Internet of Things technology, more and more industrial sites are adopting automated remote inspection methods to conduct inspections of their premises.
[0003] Automated remote inspection involves creating a 3D model of a preset scene. This 3D model includes models of all objects and devices within the preset scene, and the device models are connected to the actual devices in the preset scene via the Internet of Things (IoT) to remotely acquire data from the actual devices during automated remote inspection.
[0004] In web-based 3D projects, to generate inspection animations for a preset scene 3D model, it is necessary to determine the coordinates of the inspection stations and the inspection angles within the preset scene 3D model. Existing technologies struggle to provide a convenient method for determining the coordinates of the inspection stations and the inspection angles. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of the prior art by providing a method, apparatus, computer equipment, and storage medium for generating inspection animations, so as to quickly determine the location and angle of inspection points and thereby achieve automated generation of inspection animations.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, embodiments of this application provide a method for generating inspection animations, the method comprising:
[0008] Obtain the inspection point positions and target positions of multiple inspection points in a preset scene 3D model, wherein the target position is used to indicate the looking direction of the corresponding inspection point;
[0009] Based on the preset total playback time, the location of each inspection point, and the target location, determine the inspection location and the target location at each playback moment.
[0010] Based on the real-time calculated inspection position and the target position at each playback moment, a preset inspection animation is generated.
[0011] Optionally, obtaining the inspection point positions and target positions of multiple inspection points in the preset scene 3D model includes:
[0012] The preset position in the preset scene 3D model is used as the position of the virtual camera;
[0013] In response to the operation of adjusting the position of the virtual camera in the preset scene 3D model, the position of the virtual camera is used as the inspection point position of each of the inspection points;
[0014] Based on the viewing direction of the virtual camera, the position of the virtual camera's target in the preset scene 3D model is determined as the target position.
[0015] Optionally, obtaining the inspection point positions and target positions of multiple inspection points in the preset scene 3D model includes:
[0016] The preset position in the preset scene 3D model is used as the position of the virtual camera;
[0017] Based on the position of the virtual camera in the preset scene 3D model, a virtual mesh centered on the virtual camera is generated;
[0018] Multiple coordinate points are selected as inspection points in the virtual grid, and the inspection point positions of each inspection point are determined.
[0019] The target position to be viewed by each inspection point is determined based on the inspection sequence of each inspection point and the location of the next inspection point of each inspection point.
[0020] Optionally, the step of calculating the inspection position and the target position at each playback moment in real time based on the preset total playback time, the inspection point position of each inspection point, and the target position being looked at includes:
[0021] Calculate the inspection path length based on the location of the inspection points;
[0022] Based on the preset total playback time and the inspection path length, the path distance between the waypoint and the starting inspection point at each playback moment is calculated in real time, wherein the waypoint is the path position corresponding to each playback moment;
[0023] Based on the positions of the two adjacent inspection points before and after the path point and the path distance, the inspection position at each playback moment is calculated in real time.
[0024] Based on the locations of the two inspection points following the aforementioned path point, the target position at each playback moment is determined.
[0025] Optionally, determining the target position at each playback moment based on the positions of the two inspection points following the waypoint includes:
[0026] If the distance between the waypoint and the first inspection point after the waypoint is greater than a preset distance, the target position for each playback moment is determined based on the inspection point position of the first inspection point.
[0027] If the distance between the waypoint and the first inspection point after the waypoint is equal to or less than the preset distance, the target position at each playback moment is determined based on the inspection point position of the first inspection point and the inspection point position of the second inspection point after the waypoint.
[0028] Optionally, the target position at each playback moment is determined based on the position of the first inspection point and the position of the second inspection point after the transit point, including:
[0029] The turning angle is determined by the inscribed circle of the triangle formed by the previous inspection point, the first inspection point after the previous inspection point, and the second inspection point.
[0030] If the angle between the path point and the center of the inscribed circle of the triangle is less than or equal to a preset percentage of the turning angle, the target position at each playback moment is determined as the inspection point position of the first inspection point.
[0031] If the angle between the path point and the center of the inscribed circle of the triangle is greater than a preset percentage of the turning angle, the target position at each playback moment is determined based on the positions of multiple targets between the first inspection point and the second inspection point.
[0032] Optionally, the step of generating a preset inspection animation based on the inspection position and the target position calculated in real time at each playback moment includes:
[0033] Based on the real-time calculated inspection position and the target position at each playback moment, an inspection trajectory is generated.
[0034] Using a virtual camera as a moving target in the preset scene 3D model, the positional changes along the inspection trajectory are acquired, and the preset inspection animation is generated; or...
[0035] Using a virtual camera as a fixed viewing position and the preset scene 3D model as the inspection background, the positional changes of the virtual inspection object moving along the inspection trajectory are acquired to generate the preset inspection animation; or...
[0036] The preset inspection animation is generated by using the virtual camera tracking perspective as the viewing perspective and the positional changes of the virtual inspection object moving along the inspection trajectory in the preset scene 3D model.
[0037] Secondly, embodiments of this application also provide an inspection animation generation device, the device comprising:
[0038] The data acquisition module is used to acquire the inspection point positions and the target positions of multiple inspection points in a preset scene 3D model, wherein the target positions are used to indicate the looking direction of the corresponding inspection point;
[0039] The position determination module is used to calculate the inspection position and the target position at each playback moment in real time based on the preset total playback time, the inspection point position of each inspection point, and the target position.
[0040] The animation generation module is used to generate preset inspection animations based on the inspection position and the target position calculated in real time at the playback moment.
[0041] Optionally, the data acquisition module is specifically used to take a preset position in the preset scene 3D model as the position of the virtual camera; in response to the adjustment operation of the position of the virtual camera in the preset scene 3D model, take the position of the virtual camera as the inspection point position of each of the inspection points; and determine the position of the target being looked at by the virtual camera in the preset scene 3D model as the target position according to the viewing direction of the virtual camera.
[0042] Optionally, the data acquisition module is specifically used to take a preset position in the preset scene 3D model as the position of the virtual camera; generate a virtual mesh centered on the virtual camera according to the position of the virtual camera in the preset scene 3D model; select multiple coordinate points in the virtual mesh as each of the inspection points, and determine the inspection point position of each of the inspection points; determine the target position to which each of the inspection points looks according to the inspection sequence of each of the inspection points and the inspection point position of the next inspection point of each of the inspection points.
[0043] Optionally, the location determination module includes:
[0044] The path length calculation unit is used to calculate the inspection path length based on the inspection point location.
[0045] The path distance calculation unit is used to calculate the path distance between the path point and the starting inspection point at each playback time in real time based on the preset total playback time and the inspection path length, wherein the path point is the path position corresponding to each playback time.
[0046] The inspection position calculation unit is used to calculate the inspection position at each playback time in real time based on the inspection point positions of the two adjacent inspection points before and after the route point and the route distance.
[0047] The target position determination unit is used to determine the target position at each playback moment based on the inspection point positions of the two inspection points after the path point.
[0048] Optionally, the target viewing position determination unit is specifically used to determine the target viewing position at each playback moment based on the inspection point position of the first inspection point if the distance between the waypoint and the first inspection point after the waypoint is greater than a preset distance; and to determine the target viewing position at each playback moment based on the inspection point position of the first inspection point and the inspection point position of the second inspection point after the waypoint if the distance between the waypoint and the first inspection point after the waypoint is equal to or less than the preset distance.
[0049] Optionally, the target position determination unit is specifically used to determine the turning angle based on the inscribed circle of the triangle formed by the previous inspection point, the first inspection point, and the second inspection point after the path point; if the angle between the path point and the center of the inscribed circle of the triangle is less than or equal to a preset percentage of the turning angle, the target position at each playback moment is determined to be the inspection point position of the first inspection point; if the angle between the path point and the center of the inscribed circle of the triangle is greater than the preset percentage of the turning angle, the target position at each playback moment is determined based on the positions of multiple targets between the first and second inspection points.
[0050] Optionally, the animation generation module is specifically used to generate an inspection trajectory based on the inspection position and the target position calculated in real time at each playback moment; using a virtual camera as a moving target in the preset scene 3D model, to obtain the position changes along the inspection trajectory and generate the preset inspection animation; or, using a virtual camera as a fixed viewing position and the preset scene 3D model as the inspection background, to obtain the position changes of the virtual inspection object along the inspection trajectory and generate the preset inspection animation; or, using the virtual camera tracking viewpoint as the viewing viewpoint and the position changes of the virtual inspection object along the inspection trajectory in the preset scene 3D model, to generate the preset inspection animation.
[0051] Thirdly, embodiments of this application also provide a computer device, including: a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the computer device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the inspection animation generation method as described in any of the first aspects.
[0052] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the inspection animation generation method as described in any of the first aspects.
[0053] The beneficial effects of this application are:
[0054] The inspection animation generation method, apparatus, computer equipment, and storage medium provided in this application calculate the inspection position and the target position at each playback moment in real time based on the inspection point positions and the target positions of multiple inspection points in a preset scene 3D model, thereby generating an inspection animation for the preset scene 3D model, realizing the automated generation of inspection trajectories and inspection animations, and improving the generation efficiency of automated inspection animations. Attached Figure Description
[0055] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a schematic diagram of the interface of the scenario configuration system provided in the embodiments of this application;
[0057] Figure 2 Flowchart of the inspection animation generation method provided in the embodiments of this application Figure 1 ;
[0058] Figure 3 This is a schematic diagram of the inspection animation playback interface provided in the embodiments of this application;
[0059] Figure 4 Flowchart of the inspection animation generation method provided in the embodiments of this application Figure 2 ;
[0060] Figure 5 Flowchart of the inspection animation generation method provided in the embodiments of this application Figure 3 ;
[0061] Figure 6 Flowchart of the inspection animation generation method provided in the embodiments of this application Figure 4 ;
[0062] Figure 7 Flowchart of the inspection animation generation method provided in the embodiments of this application Figure 5 ;
[0063] Figure 8 This is a schematic diagram of the corner inspection trajectory provided in the embodiments of this application;
[0064] Figure 9 A schematic diagram of a smooth corner inspection trajectory based on an inscribed circle provided in an embodiment of this application;
[0065] Figure 10This is a schematic diagram of a straight-line corner inspection trajectory provided in an embodiment of this application;
[0066] Figure 11 Flowchart of the inspection animation generation method provided in the embodiments of this application Figure 6 ;
[0067] Figure 12 The inspection screen provided by the tracking perspective in the embodiments of this application;
[0068] Figure 13 This is a schematic diagram of the inspection animation generation device provided in the embodiments of this application;
[0069] Figure 14 A schematic diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0071] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0072] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0073] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0074] The inspection animation generation method provided in this application is applied to a preset scene configuration system, which can run on a computer device. By importing a preset scene 3D model into the scene configuration system, inspection points are determined within the preset scene 3D model through a visual interface provided by the scene configuration system.
[0075] Please refer to Figure 1 This is a schematic diagram of the interface of the scenario configuration system provided in the embodiments of this application, such as... Figure 1 As shown, the visualization interface of the scene configuration system includes: a 3D model display area 11, an inspection trajectory editing area 12, and an inspection point list display area 13.
[0076] The 3D model display area 11 is used to display the preset scene 3D model. Users can set inspection points at any position in the preset scene 3D model. The inspection trajectory editing area 12 can edit the name of the inspection trajectory formed by each inspection point in the preset scene 3D model. For each selected inspection point, the inspection point position, i.e., the 3D coordinates and the target being viewed, can also be displayed in the inspection trajectory editing area 12. The target being viewed selection control 14 can select the target being viewed from a list of multiple virtual object models in the preset 3D scene model. The target being viewed update control 15 can update the target being viewed based on the user's adjustment of the virtual camera's perspective. Based on the inspection point position and the target being viewed position, the viewing angle or viewing direction of the inspection animation at that inspection point position can be determined.
[0077] The inspection point list display area 13 is used to display multiple inspection points, arranged in inspection order. Users can set the inspection movement time between each inspection point in the list within this area to determine the movement time between adjacent points. Additionally, for device models within the preset scene's 3D model, a stop time can be set for inspection. This means that when the inspection reaches the device model, it needs to stop for a certain period to obtain the device parameters of the real device bound to the device model via the Internet of Things (IoT) and display these parameters in the inspection animation. (Example) Figure 1 The gate hoist in the image is a device model.
[0078] The following describes the specific implementation of the inspection animation generation method provided in this application with reference to the embodiments.
[0079] Please refer to Figure 2 This is a flowchart illustrating the inspection animation generation method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method may include:
[0080] S10: Obtain the inspection point positions and target positions of multiple inspection points in the preset scene 3D model. The target position is used to indicate the direction of the corresponding inspection point.
[0081] In this embodiment, the preset scene can be any scene that needs to be inspected. The preset scene 3D model is obtained by 3D modeling all things such as buildings, objects, and equipment contained in the preset scene. The preset scene 3D model is imported into the scene configuration system. In the visualization interface of the scene configuration system, inspection points are set for the preset scene 3D model, and the inspection point positions of each inspection point in the preset scene 3D model are determined. An inspection trajectory can be generated based on multiple inspection points.
[0082] The "Looking Target" indicator indicates the direction, viewpoint, or angle of view in the inspection animation when the inspection point is reached. This direction, viewpoint, or angle can be determined by the line connecting the inspection point's location and the target's location, thus defining the view in that direction, viewpoint, or angle. The "Looking Direction" refers to the direction of the target, which can be selected by the user from virtual objects around the inspection point or determined based on the user's adjusted viewpoint around the inspection point. The "Inspection Point Location" is the relative position of the inspection point in the inspection animation within the preset scene's 3D model, and the "Target Location" is the target's 3D coordinates within the preset scene's 3D model.
[0083] In some embodiments, inspection points may include: a starting point, an ending point, and an inflection point. All inspection points other than the starting point and the ending point are inflection points. That is, except for the starting point and the ending point, the inspection trajectory turns sequentially at all other inspection points. For example, the inspection trajectory between three adjacent inspection points will not be a straight line, but will turn at the middle inspection point.
[0084] Furthermore, when it is necessary to inspect virtual devices in a preset scene 3D model, the inspection points can also include inspection points with a preset default distance from the virtual devices.
[0085] Specifically, you can select a target virtual device in the inspection point list display area 13 to generate an inspection point, set the inspection dwell time for the target virtual device, and determine the inspection point position based on the three-dimensional coordinates of the target virtual device in the preset scene three-dimensional model and the preset default distance. The preset default distance is the distance between the playback view of the inspection animation and the target virtual device when the inspection reaches the target virtual device, and the target position can be the position of the target virtual object.
[0086] S20: Based on the preset total playback time, the location of each inspection point, and the target position, calculate the inspection position and the target position at each playback moment in real time.
[0087] In this embodiment, the inspection animation is played frame by frame. In order to ensure the smoothness of the inspection animation, it is necessary to determine the inspection position and looking direction of the inspection animation at each frame or at each playback moment. However, it is impossible to set inspection points for each frame when setting inspection points in the visualization interface of the scene configuration system. Therefore, it is necessary to calculate the inspection position and looking target position at each playback moment in real time according to the inspection point positions and looking target positions of multiple set inspection points within the preset total playback time, and to determine the inspection position and looking target position of each frame.
[0088] The preset total playback time can be determined based on the sum of the inspection movement time between each inspection point and the inspection dwell time at each inspection point. The inspection position at each playback moment is calculated in real time based on the inspection point positions of the previous and next inspection points corresponding to each playback moment, and the target position at each playback moment is determined based on the inspection point positions of each inspection point. In some embodiments, the next inspection point at each playback moment's location can be used as the target position, then the inspection point position of the next inspection point is the target position.
[0089] When the playback time is the same as the playback time corresponding to the inspection point, the inspection position and the target position at that time do not need to be calculated.
[0090] S30: Generate a preset inspection animation based on the inspection position and the target position calculated in real time at each playback moment.
[0091] In this embodiment, based on the real-time calculated inspection position and target position (including the inspection point position and target position of multiple inspection points) at each playback time, the inspection target is controlled to move to the corresponding inspection position at each playback time and face the target position corresponding to each playback time, so that the played inspection screen is the screen with the viewing direction facing the target position at that inspection position. Based on the screen corresponding to each playback time played in real time, a preset inspection animation is obtained.
[0092] In one possible implementation, please refer to Figure 3 This is a schematic diagram of the inspection animation playback interface provided in the embodiments of this application, such as... Figure 3 As shown, after configuring the inspection point positions and target positions of multiple inspection points through the visualization interface of the scene configuration system and generating the inspection animation, the inspection animation playback interface includes: inspection animation display area 16, pause / continue playback control 17, replay control 18, speed control 19, and playback time progress bar 20.
[0093] The inspection animation display area 16 is used to display the inspection animation. During the playback of the inspection animation, in response to the trigger operation of the pause / resume playback control 17, the playback of the inspection animation is stopped, that is, the update of the inspection position and the target being viewed is stopped in the inspection animation display area 16; in response to the trigger operation of the pause / resume playback control 17 again, the inspection animation is replayed, that is, the inspection position and the target being viewed are updated again in the inspection animation display area 16 according to the playback time.
[0094] In some embodiments, the playback progress bar 20 displays multiple inspection point identifiers 21 corresponding to inspection points. In response to a trigger operation on the inspection point identifier 21, the user can directly jump to the target inspection point corresponding to the inspection point identifier 21 and update the inspection animation according to the inspection point position of the target inspection point and the target position being viewed.
[0095] In one possible implementation, if world time is used as the start time of the inspection animation, the pause time needs to be recorded when the inspection animation is paused and the restart time needs to be recorded when it is restarted. The pause duration is calculated based on the pause time and restart time, and the corresponding playback time is determined by subtracting the pause duration from the restart time. The inspection position and the target position are then updated based on the playback time.
[0096] When playing the inspection animation starting from the target inspection point corresponding to inspection point identifier 21, it is necessary to calculate the time spent from the starting point to the target inspection point stopTimeFromFirst_N based on the total playback time and the length from the starting point to the target inspection point. The start trajectory playback time of the inspection animation time_start is determined based on the time difference between the current world time time_current and the time spent from the starting point to the target inspection point stopTimeFromFirst_N.
[0097] In response to a trigger operation on the replay control 18, the inspection animation restarts from the starting point. In response to a trigger operation on the speed control 19, the playback speed of the inspection animation is adjusted. The inspection position and target position corresponding to each speed playback moment need to be determined based on the inspection position and target position of the original playback moment calculated according to the speed playback moment and playback speed. For example, the speed control 19 can be set to a playback speed of 0.5 times, 1.0 times, 1.2 times, 1.5 times, 2 times, etc., of the original playback speed.
[0098] The inspection animation generation method provided in the above embodiments calculates the inspection position and the target position at each playback moment in real time based on the inspection point positions and the target position of multiple inspection points in the preset scene 3D model, thereby generating an inspection animation for the preset scene 3D model, realizing the automatic generation of inspection trajectory and inspection animation, and improving the generation efficiency of automated inspection animation.
[0099] The following describes, with reference to embodiments, possible implementation methods for obtaining the locations of multiple inspection points and the target location.
[0100] Please refer to Figure 4 This is a flowchart illustrating the inspection animation generation method provided in this application embodiment. Figure 2 ,like Figure 4 As shown, S10 above obtains the inspection point positions and target positions of multiple inspection points in the preset scene 3D model, including:
[0101] S11: Use the preset position in the preset scene 3D model as the position of the virtual camera.
[0102] S12: In response to the adjustment operation of the virtual camera's position in the preset scene 3D model, the position of the virtual camera is used as the inspection point position of each inspection point.
[0103] S13: Based on the virtual camera's viewing direction, determine the position of the virtual camera's target in the preset scene 3D model as the target position.
[0104] In this embodiment, when the preset scene 3D model is displayed in the visualization interface of the scene configuration system, there is actually a virtual camera. The virtual camera simulates the user's human eye. That is, the content that the user sees through the visualization interface is the content that the virtual camera sees. By adjusting the position and viewing angle of the virtual camera in the preset scene 3D model, the content that the user sees can be changed. The user's scaling, dragging and various rotation operations on the preset scene 3D model are actually adjustments to the virtual camera.
[0105] By adjusting the position of the virtual camera in the preset scene 3D model, the user determines the distance and viewing direction of the virtual camera relative to each virtual object in the preset scene 3D model. This distance is the distance between the image seen by the user's eyes and each virtual object when the inspection animation plays to that inspection point. The image corresponding to the viewing direction of the virtual camera is the viewing image seen by the user when the inspection animation plays to that inspection point.
[0106] In response to the adjustment operation for the virtual camera position, the distance and viewing direction of the virtual camera relative to each virtual object in the preset scene 3D model are determined. After determining the optimal distance and optimal viewing direction as perceived by the user, in response to the picking operation for the distance and viewing direction, the position of the virtual camera in the preset scene 3D model is determined as the inspection point position. A virtual object in the viewing direction of the virtual camera is taken as the target of the inspection point, and the position of the virtual object is taken as the target position. If there are multiple virtual objects in the viewing direction of the virtual camera, any virtual object can be selected as the target.
[0107] In some embodiments, when using virtual objects in a preset scene 3D model as inspection points, after determining the inspection point position and the target position based on the above-mentioned adjustment operation for the virtual camera, the association between the virtual object and the inspection point position and the target position can be recorded in a preset database. For inspection points in the inspection point list, the corresponding virtual object can be selected from the preset database to use the inspection point position and the target position of the virtual object as the inspection point position and the target position of the inspection point.
[0108] The inspection animation generation method provided in the above embodiments determines the inspection point position and the target position of the inspection point based on the adjustment operation of the virtual camera relative to the inspection point in the preset scene 3D model. It realizes the flexible configuration of the position and the direction of view of the inspection point, and can generate inspection animations according to the user's needs, viewing habits, preferences, etc., thus enriching the configuration capabilities of inspection animations.
[0109] Please refer to Figure 5 This is a flowchart illustrating the inspection animation generation method provided in this application embodiment. Figure 3 ,like Figure 5 As shown, S10 above obtains the inspection point positions and target positions of multiple inspection points in the preset scene 3D model, including:
[0110] S14: Use the preset position in the preset scene 3D model as the position of the virtual camera.
[0111] S15: Generate a virtual mesh centered on the virtual camera based on the position of the virtual camera on the preset scene 3D model.
[0112] S16: Select multiple coordinate points in the virtual grid as inspection points, and determine the inspection point location of each inspection point.
[0113] S17: Determine the target location for each inspection point based on the inspection sequence of each inspection point and the location of the next inspection point of each inspection point.
[0114] In this embodiment, compared to a fixed grid, an infinite virtual grid actually uses a smaller grid centered on a virtual camera. When the position of the virtual camera changes in the preset scene 3D model, the virtual grid moves with the virtual camera, achieving infinite expansion of the virtual grid. When the size of the preset scene 3D model is large, the infinite virtual grid will not affect the computer's performance, avoiding stuttering during the dragging of the preset scene 3D model.
[0115] The principle behind generating an infinite virtual mesh is as follows: A square plane with a preset width and height is created. The vertices of this positive-direction plane are used as the geometric vertex data for the infinite mesh. In the vertex shader, the real-time position of the virtual camera's xz plane is assigned to the square. Regardless of how the virtual camera moves, the positive direction always follows the virtual camera, achieving a visually infinite range effect for the mesh made of four vertices. In the fragment shader, each mesh line fragment is drawn, and the transparency of the fragments is controlled based on the distance of each fragment's xz position from the virtual camera's xz position, achieving a mesh that is clear at close range and blurred or even completely transparent at distant locations. When the virtual camera moves, the position of each mesh line fragment is calculated in real time, ensuring that each mesh line follows the camera.
[0116] By adjusting the position of the virtual camera within a preset 3D model of the scene, the user generates a virtual mesh within a preset area of the 3D model. In response to the coordinate picking operation of any coordinate point within the virtual mesh, the coordinate point is used as an inspection point, and the 3D coordinates of the coordinate point are the inspection point position. Based on the inspection sequence of each inspection point, the position of the next inspection point is determined, which is the target position that each inspection point is looking at.
[0117] The location of this coordinate point is the center point of the screen as seen by the user's eyes during the inspection animation. The viewing direction at this inspection point is determined based on this coordinate point and the target position. The screen corresponding to this viewing direction is the view that the user sees when the inspection animation plays to this inspection point.
[0118] The inspection animation generation method provided in the above embodiments establishes a virtual mesh centered on a virtual camera. This avoids reducing the computing performance of the computer when extracting the inspection point position and the target position relative to the inspection point in the virtual mesh, ensures the smoothness of the screen when dragging the preset scene 3D model, and improves the generation efficiency of the inspection animation.
[0119] The following describes a possible implementation of determining the inspection position and the target position at each playback moment, in conjunction with an embodiment.
[0120] Please refer to Figure 6 This is a flowchart illustrating the inspection animation generation method provided in this application embodiment. Figure 4 ,like Figure 6 As shown, S20 above determines the inspection position and the target position at each playback moment based on the total playback time of the preset inspection animation, the inspection point position of each inspection point, and the target position being looked at, including:
[0121] S21: Calculate the inspection path length based on the location of the inspection points.
[0122] In this embodiment, the straight-line length between adjacent inspection points is calculated based on the location of each inspection point. The inspection path length is then calculated based on the straight-line length between each adjacent inspection point. The inspection path length is the path length dis_all that starts from the starting inspection point, passes through each inspection point in the inspection order, and reaches the ending inspection point.
[0123] S22: Based on the preset total playback time and inspection path length, calculate in real time the path distance between the path point and the starting inspection point at each playback moment, where the path point is the path position corresponding to each playback moment.
[0124] In this embodiment, the total playback time (time_all) can be determined based on the sum of the inspection movement time between each inspection point and the inspection dwell time of each inspection point. The start playback time (time_start) is the moment when playback begins from the first frame of the inspection animation. The timing of the start playback time (time_start) and any playback time (time_current) can be based on the total playback time, for example, the start playback time (time_start) is 0, and any playback time (time_current) is 3 minutes and 5 seconds; or it can be based on world time, for example, the start playback time (time_start) is 17:23:19 on August 21, 2023, and any playback time (time_current) is 17:26:24 on August 21, 2023. It should be noted that the time difference between the start playback time (time_start) and any playback time (time_current) cannot exceed the total playback time.
[0125] At any given playback time, the inspection position P reached on the inspection path is a waypoint. The waypoint may also be a pre-determined inspection point. Based on any given playback time_current and playback start time_start, the playback duration is calculated. If the time is based on UTC, the playback duration must not include the pause time.
[0126] Based on the proportion of the played time to the total played time and the length of the inspection path, calculate the path distance between the point of passage at each playback moment and the starting inspection point, that is, the length of the inspected path at any playback moment.
[0127] For example, the formula for calculating the path distance dis_current can be expressed as:
[0128] (time_current-time_start) / time_all=dis_current / dis_all
[0129] S23: Calculate the inspection position at each playback moment in real time based on the inspection point positions and path distances of the two adjacent inspection points before and after the passing point.
[0130] In this embodiment, in order to determine the inspection footage played at any given time, it is necessary to determine the inspection position and the target being looked at at any given time. The method for determining the inspection position of any given time can be as follows:
[0131] Determine the preceding checkpoint N and the following checkpoint N+1 adjacent to the pathpoint P at any playback time. That is, pathpoint P lies between checkpoint N and checkpoint N+1. The checkpoint position of checkpoint N is A(ax, ay, az), and the checkpoint position of checkpoint N+1 is B(bx, by, bz). The distance between checkpoint N and pathpoint P is denoted as dis. NP The distance between inspection point N and inspection point N+1 is denoted as dis. NN+1 Based on the distance dis between inspection point N and the route point P NP The distance dis between inspection point N and inspection point N+1 NN+1 Calculate the inspection point position A(ax,ay,az) of inspection point N, the inspection point position B(bx,by,bz) of inspection point N+1, and the inspection position P(px,py,pz) of the path point P at any playback time.
[0132] For example, the formula for calculating the inspection position P(px,py,pz) of any path point P at any playback time can be expressed as:
[0133] dis NP = dis_current - stopDistanceFromFist N
[0134] dis NN+1 = stopDistanceFromFist N+1 - stopDistanceFromFist N
[0135] px = ax + ((bx - ax) × dis NP ) / dis NN+1
[0136] py = ay + ((by - ay) × dis NP ) / dis NN+1
[0137] pz = az + ((bz - az) × dis NP ) / dis NN+1
[0138] Among them, stopDistanceFromFist N The distance between the starting inspection point and inspection point N is stopDistanceFromFist. N+1 This is the distance between the starting inspection point and inspection point N+1.
[0139] S24: Determine the target position at each playback moment based on the locations of the two inspection points after the transit point.
[0140] In this embodiment, during the movement from one waypoint to the next inspection point, the inspection point of the first inspection point after the waypoint can be used as the target position for any playback moment. Then, the inspection point of the second inspection point after the waypoint can be used as the target position for any playback moment.
[0141] Specifically, a critical point can be set between the previous and next inspection points of the transit point. Before the transit point reaches the critical point, the inspection point position of the first inspection point after the transit point is used as the target position for any playback moment. After the transit point reaches the critical point, the inspection point of the second inspection point after the transit point is used as the target position for any playback moment.
[0142] The inspection animation generation method provided in the above embodiments calculates the inspection position and the target position corresponding to the path points at each playback moment, and updates the inspection position and the target position in real time at each playback moment within the total playback time, so as to ensure the smoothness of the generated inspection animation.
[0143] In one possible implementation, the process of S24, which determines the target position at each playback moment based on the positions of the two inspection points after the transit point, may include:
[0144] If the distance between a point of interest and the first inspection point after the point of interest is greater than the preset distance, the target position for each playback moment is determined based on the position of the first inspection point. If the distance between a point of interest and the first inspection point after the point of interest is equal to or less than the preset distance, the target position for each playback moment is determined based on the positions of the first inspection point and the second inspection point after the point of interest.
[0145] In this embodiment, a critical point is set between the previous inspection point and the next inspection point of the transit point. The distance between the critical point and the next inspection point of the transit point is equal to a preset distance. If the distance between the transit point and the first inspection point after the transit point is greater than the preset distance, then the transit point has not yet reached the critical point. In this case, the target of the transit point at any playback time is the first inspection point, that is, the target position of the transit point at any playback time is the inspection point position of the first inspection point.
[0146] If the distance between a waypoint and the first inspection point after the waypoint is equal to or less than a preset distance, the waypoint has reached the critical point. In this case, the viewing angle between the first and second inspection points is determined based on the inspection point positions of the first and second inspection points. The viewing direction of the waypoint is adjusted sequentially at preset angle intervals. After each adjustment of the preset angle interval, any virtual object in that viewing direction becomes the target of the waypoint, and the position of the virtual object becomes the target position of the waypoint. This process is repeated multiple times at preset angle intervals until the target position is the inspection point position of the second inspection point, at which point the adjustment of the viewing direction stops.
[0147] Taking inspection point N-1, inspection point N, and inspection point N+1 as examples, the method for determining the target position at each playback moment is explained.
[0148] The path point P is located after the inspection point N-1. During the movement of path point P towards inspection point N, within a preset distance range, the target of path point P is inspection point N. That is, the target position of the path point at any given playback moment becomes the inspection point position of the next inspection point. Outside the preset distance range, based on the inspection point positions of inspection point N and N+1, the angle between inspection point N and inspection point N+1 is determined. The viewing direction of path point P is sequentially determined according to preset angle intervals. The adjustment process involves adjusting the virtual object at a preset angle interval each time. After this adjustment, any virtual object in the direction of the view becomes the target of the path point P, and the position of the virtual object becomes the target position of the path point P. This continues until the target of the path point P becomes the inspection point N+1. After this, the path point P moves continuously toward the inspection point N+1 until the distance between the path point P and the inspection point N+1 is outside the preset distance range. Then, the target of the path point P is adjusted again at the preset angle interval, so that the view direction of the path point P gradually adjusts toward the inspection point N+2.
[0149] In one possible implementation, please refer to Figure 7 This is a flowchart illustrating the inspection animation generation method provided in this application embodiment. Figure 5 ,like Figure 7As shown, determining the target position at each playback moment based on the location of the first inspection point and the location of the second inspection point after the transit point can include:
[0150] S241: Determine the turning angle based on the inscribed circle of the triangle formed by the previous inspection point, the first inspection point after the inspection point, and the second inspection point.
[0151] S242: If the angle between the path point and the center of the inscribed circle of the triangle is less than or equal to the preset percentage of the turning angle, the target position at each playback moment is determined as the inspection point position of the first inspection point.
[0152] S243: If the angle between the path point and the center of the inscribed circle of the triangle is greater than the preset percentage of the turning angle, determine the target position at each playback moment based on the positions of multiple targets between the first and second inspection points.
[0153] In this embodiment, for example, please refer to Figure 8 This is a schematic diagram of the corner inspection trajectory provided in the embodiments of this application, such as... Figure 8 As shown, the inspection point before the transit point is inspection point N-1, the first inspection point after the transit point is inspection point N, and the second inspection point after the transit point is inspection point N+1. At inspection point N, the angle of the inscribed circle and the turning angle are determined based on the inscribed circle of the triangle formed by inspection points N-1, N, and N+1.
[0154] In this system, the tangent point of the inspection line segment formed by the inscribed circle and inspection points N-1 and N is P1, and the switching point of the inspection line segment formed by the inscribed circle and inspection points N and N+1 is P2. P1 is a critical point set between the previous and next inspection points of the path point. Before the path point P reaches P1, the target that the path point P is looking at at any playback moment is the path point N. After the path point reaches P1, the turning angle is divided into two parts according to a preset proportion. Based on the angle between the path point P and the center O and P1, if the angle is less than or equal to the path point N, the path point P is considered to be at the center O. A critical point is set between the previous and next inspection points of a path point. At any given playback moment, the target seen by path point P is path point N. If the angle between the two points is greater than a preset percentage of the turning angle, the viewing angle between inspection points N and N+1 is determined. The viewing direction of path point P is adjusted sequentially at preset angle intervals. After each adjustment, any virtual object in that viewing direction becomes the target seen by path point P, and the position of that virtual object becomes the target position of path point P, until the target seen by path point P becomes inspection point N+1. The preset percentage can be, for example, 1 / 2.
[0155] In some embodiments, in order to ensure the smoothness of the inspection trajectory when turning corners, the inspection trajectory can be smoothed after the passing point reaches P1, until the passing point reaches P2 and then ends.
[0156] The inspection location of the points along the route between P1 and P2 can be calculated as follows:
[0157] Let the center of the incircle of the triangle be O(x0,y0,z0), and the points of tangency be P1(x1,y1,z1) and P2(x2,y2,z3). Then the angle between the point P, the point of tangency P1, and the center of the circle is a1, and the angle between the point P, the point of tangency P2, and the center of the circle is a2. The coordinates of the point P(x3,y3,z3) can be expressed as:
[0158] x3=inverse[0]×(-GH)+inverse[1]×GM+inverse[2]×GN
[0159] y3=inverse[3]×(-GH)+inverse[4]×GM+inverse[5]×GN
[0160] z3=inverse[6]×(-GH)+inverse[7]×GM+inverse[8]×GN
[0161] The transpose matrix inverse = [GE,GF, GG,x1 - x0,y1 - y0,z1 - z0,x2 - x0,y2 - y0,z2 - z0]-1, where:
[0162] GE=(y1-y0)×(z2-z0)-(y2-y0)×(z1-z0)
[0163] GF=-(x1-x0)×(z2-z0)+(x2-x0)×(z1-z0)
[0164] GG=(x1-x0)×(y2-y0)-(x2-x0)×(y1-y0)
[0165] GH=-((y1-y0)×(z2-z0)-(y2-y0)×(z1-z0))×x0+((x1-x0)×(z2-z0)-(x2-x0)×(z1-z0))×y0-((x1-x0)×(y2-y0)-(x2-x0)×(y1-y0))×z0
[0166] GM=(x1-x0)×x0+(y1-y0)×y0+(z1-z0)×z0+Math.pow(R,2)×Math.cos(a1)
[0167] GN=(x2-x0)×x0+(y2-y0)×y0+(z2-z0)×z0+Math.pow(R,2)×Math.cos(a2)
[0168] For example, please refer to Figure 9 This is a schematic diagram of a smooth corner inspection trajectory based on an inscribed circle provided in an embodiment of this application, as shown below. Figure 9 As shown, the inspection trajectory is a smooth curve at the turning point, and the inspection perspective is also a smooth perspective at the turning point.
[0169] In one possible implementation, the process of S24, which determines the target position at each playback moment based on the positions of the two inspection points after the transit point, may include:
[0170] Before the first inspection point after reaching the waypoint, determine the target position at each playback moment as the inspection point position of the first inspection point; after reaching the first inspection point after reaching the waypoint, calculate the turning angle at each playback moment based on the time difference between each playback moment and the moment of reaching the first inspection point and the preset unit time turning angle; determine the target position at any playback moment based on the target position corresponding to the turning angle at each playback moment.
[0171] In this embodiment, the first path point N is used as the critical point. Before the path point P reaches the first inspection point N, the target of the path point P at any playback moment is always the first inspection point N, and the position of the target of the path point P is the inspection point position of the first inspection point N. After the path point P reaches the first inspection point N, the time of reaching the first inspection point N is determined, and then it moves towards the second inspection point N+1. Based on the playback time of the path point P moving towards the second inspection point N+1 and the time of reaching the first inspection point N, the time difference is calculated. Based on the preset unit angle of rotation and the time difference, the angle of rotation of the path point P moving towards the second inspection point N+1 at each playback moment is determined, thereby determining the target of rotation at that angle and obtaining the position of the target of rotation at any playback moment of the path point P moving towards the second inspection point N+1.
[0172] During the process of reaching one inspection point and moving to the next inspection point, the inspection perspective is a smooth corner effect. Under this cornering method, the inspection trajectory moves according to the position of each inspection point, and the inspection trajectory is a broken line composed of multiple line segments.
[0173] For example, please refer to Figure 10 This is a schematic diagram of the straight-line corner inspection trajectory provided in the embodiments of this application, such as... Figure 10 As shown, the inspection trajectory is a broken line at the turning point, and the inspection perspective is a smooth perspective at the turning point.
[0174] The inspection animation generation method provided in the above embodiments determines the target position based on the distance between the path point and the first inspection point after the path point. When the distance is greater than a preset distance, the target position is determined based on the inspection point positions of the first and second inspection points. This determines the smooth transition of the inspection perspective or line of sight, improving the visual effect of the inspection animation playback.
[0175] In one possible implementation, please refer to Figure 11 This is a flowchart illustrating the inspection animation generation method provided in this application embodiment. Figure 6 ,like Figure 11 As shown, S30 generates a preset inspection animation based on the inspection positions and the target positions at all playback moments within the total playback time, including:
[0176] S31: Generate an inspection trajectory based on the inspection position and the target position calculated in real time at each playback moment.
[0177] S32: Using a virtual camera as a moving target in a preset scene 3D model, acquire the positional changes along the inspection trajectory and generate a preset inspection animation.
[0178] S33: Using a virtual camera as a fixed viewing position and a preset scene 3D model as the inspection background, the positional changes of the virtual inspection object along the inspection trajectory are obtained, and a preset inspection animation is generated.
[0179] S34: Using the virtual camera tracking perspective as the viewing perspective and the positional changes of the virtual inspection object moving along the inspection trajectory in the preset scene 3D model, a preset inspection animation is generated.
[0180] In this embodiment, after calculating the inspection position and the target position at all playback moments within the total playback time, an inspection trajectory is generated. Based on the inspection trajectory, the inspection position reached at each playback moment and the corresponding screen of the target can be determined.
[0181] This embodiment provides a way to play the inspection trajectory from three different perspectives. The inspection animation is different when playing the inspection trajectory from the three different perspectives. The three perspectives are explained below.
[0182] Specifically, the first perspective is the first-person perspective, which is the user's perspective. In this perspective, a virtual camera is used as a moving target and moves along an inspection trajectory in a preset 3D scene model. The virtual camera is equivalent to a virtual inspection object. The scene seen when the virtual inspection object moves along the inspection trajectory is the inspection animation, which is also the inspection animation seen by the user. In this case, the content in the direction of the target position at each playback moment is the playback screen at each playback moment.
[0183] The second perspective is the third-person perspective, also known as the "God's-eye view." This perspective uses a pre-set 3D scene model as the inspection background. Within this model, a virtual inspection object exists, which could be a virtual inspector or a virtual inspection vehicle. A virtual camera is positioned at a fixed angle, and the inspection animation consists of images captured by the virtual camera showing the virtual inspection object moving along an inspection trajectory within the pre-set 3D scene model. In this case, the target position at each playback moment indicates the direction the virtual inspection object is looking. The playback screen at each moment shows the location and orientation angle of the virtual inspection object against the background of the pre-set 3D scene model. (Example...) Figure 9 This shows a third-person perspective, in which you can pan, rotate, and zoom the screen.
[0184] The third perspective is the tracking perspective, where the virtual inspection object moves along an inspection trajectory within a preset 3D scene model, and the virtual camera follows the movement of the virtual inspection object. For an example, please refer to [link / reference needed]. Figure 12 This is an inspection screen with a tracking perspective provided in an embodiment of this application, such as... Figure 12 As shown, the virtual inspection object adjusts its viewing direction according to the target position at each playback moment, and the main subject in the inspection screen is always the virtual inspection object.
[0185] The inspection animation generation method provided in the above embodiments offers multiple playback modes for inspection animations from various perspectives, providing users with a rich variety of inspection animations. Users can choose the playback perspective according to their needs, thereby improving the user experience.
[0186] Based on the above method embodiments, this application also provides an inspection animation generation device. Please refer to... Figure 13 This is a schematic diagram of the inspection animation generation device provided in the embodiments of this application, as shown below. Figure 13 As shown, the device may include:
[0187] The data acquisition module 100 is used to acquire the inspection point positions and the target positions of multiple inspection points in the preset scene 3D model. The target positions are used to indicate the looking direction of the corresponding inspection point.
[0188] The position determination module 200 is used to calculate the inspection position and the target position at each playback moment in real time based on the preset total playback time, the inspection point position of each inspection point, and the target position.
[0189] The animation generation module 300 is used to generate preset inspection animations based on the inspection position and the target position at each playback moment calculated in real time.
[0190] Optionally, the data acquisition module 100 is specifically used to take a preset position in the preset scene 3D model as the position of the virtual camera; in response to the adjustment operation of the position of the virtual camera in the preset scene 3D model, take the position of the virtual camera as the inspection point position of each inspection point; and determine the position of the target being looked at by the virtual camera in the preset scene 3D model as the target position according to the viewing direction of the virtual camera.
[0191] Optionally, the data acquisition module 100 is specifically used to take a preset position in the preset scene 3D model as the position of the virtual camera; generate a virtual mesh centered on the virtual camera based on the position of the virtual camera in the preset scene 3D model; select multiple coordinate points in the virtual mesh as inspection points and determine the inspection point position of each inspection point; determine the target position to be looked at by each inspection point based on the inspection sequence of each inspection point and the inspection point position of the next inspection point of each inspection point.
[0192] Optionally, the location determination module 200 includes:
[0193] The path length calculation unit is used to calculate the inspection path length based on the location of the inspection points.
[0194] The path distance calculation unit is used to calculate the path distance between the path point and the starting inspection point at each playback time in real time based on the preset total playback time and inspection path length. The path point is the path position corresponding to each playback time.
[0195] The inspection position calculation unit is used to calculate the inspection position at each playback moment in real time based on the inspection position and path distance of the two adjacent inspection points before and after the passing point.
[0196] The target position determination unit is used to determine the target position at each playback moment based on the positions of the two inspection points after the passing point.
[0197] Optionally, the target position determination unit is specifically used to determine the target position at each playback moment based on the inspection point position of the first inspection point if the distance between the path point and the first inspection point after the path point is greater than a preset distance; and to determine the target position at each playback moment based on the inspection point position of the first inspection point and the inspection point position of the second inspection point after the path point if the distance between the path point and the first inspection point after the path point is equal to or less than a preset distance.
[0198] Optionally, the target position determination unit is specifically used to determine the turning angle based on the inscribed circle of the triangle formed by the previous inspection point, the first inspection point after the inspection point, and the second inspection point; if the angle between the inspection point and the center of the inscribed circle of the triangle is less than or equal to a preset percentage of the turning angle, the target position at each playback moment is determined as the inspection point position of the first inspection point; if the angle between the inspection point and the center of the inscribed circle of the triangle is greater than a preset percentage of the turning angle, the target position at each playback moment is determined based on the positions of multiple targets between the first and second inspection points.
[0199] Optionally, the animation generation module 300 is specifically used to generate an inspection trajectory based on the inspection position and the target position at all playback moments within the total playback time; using a virtual camera as a moving target in a preset scene 3D model, it acquires the positional changes along the inspection trajectory and generates a preset inspection animation; or, using a virtual camera as a fixed viewing position and a preset scene 3D model as the inspection background, it acquires the positional changes of the virtual inspection object along the inspection trajectory and generates a preset inspection animation; or, using the virtual camera tracking viewpoint as the viewing viewpoint and the positional changes of the virtual inspection object along the inspection trajectory in the preset scene 3D model, it generates a preset inspection animation.
[0200] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0201] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0202] Please refer to Figure 14 This is a schematic diagram of a computer device provided in an embodiment of this application, such as... Figure 14 As shown, the computer device 400 includes a processor 401, a storage medium 402, and a bus. The storage medium 402 stores program instructions executable by the processor 401. When the computer device 400 is running, the processor 401 communicates with the storage medium 402 via the bus, and the processor 401 executes the program instructions to perform the above-described method embodiment. The specific implementation and technical effects are similar and will not be described in detail here.
[0203] Optionally, the present invention also provides a computer-readable storage medium storing a computer program, which is executed by a processor to perform the above-described method embodiments.
[0204] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0205] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0206] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0207] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0208] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating inspection animation, characterized in that, The method includes: Obtain the inspection point positions and target positions of multiple inspection points in a preset scene 3D model, wherein the target position is used to indicate the looking direction of the corresponding inspection point; Based on the preset total playback time, the location of each inspection point and the target position, the inspection position and the target position at each playback moment are calculated in real time. Based on the real-time calculated inspection position and the target position at each playback moment, a preset inspection animation is generated; The step of calculating the inspection position and the target position at each playback moment in real time based on the preset total playback time, the inspection point position of each inspection point, and the target position being looked at includes: Calculate the inspection path length based on the location of the inspection points; Based on the preset total playback time and the inspection path length, the path distance between the waypoint and the starting inspection point at each playback moment is calculated in real time, wherein the waypoint is the path position corresponding to each playback moment; Based on the positions of the two adjacent inspection points before and after the path point and the path distance, the inspection position at each playback moment is calculated in real time. If the distance between the waypoint and the first inspection point after the waypoint is greater than a preset distance, the target position for each playback moment is determined based on the inspection point position of the first inspection point. If the distance between the waypoint and the first inspection point after the waypoint is equal to or less than the preset distance, the turning angle is determined according to the inscribed circle of the triangle formed by the inspection point before the waypoint, the first inspection point after the waypoint, and the second inspection point. If the angle between the path point and the center of the inscribed circle of the triangle is less than or equal to a preset percentage of the turning angle, the target position at each playback moment is determined as the inspection point position of the first inspection point. If the angle between the path point and the center of the inscribed circle of the triangle is greater than a preset percentage of the turning angle, the target position at each playback moment is determined based on the positions of multiple targets between the first inspection point and the second inspection point.
2. The method as described in claim 1, characterized in that, The step of obtaining the inspection point positions and target positions of multiple inspection points in the preset scene 3D model includes: The preset position in the preset scene 3D model is used as the position of the virtual camera; In response to the operation of adjusting the position of the virtual camera in the preset scene 3D model, the position of the virtual camera is used as the inspection point position of each of the inspection points; Based on the viewing direction of the virtual camera, the position of the virtual camera's target in the preset scene 3D model is determined as the target position.
3. The method as described in claim 1, characterized in that, The step of obtaining the inspection point positions and target positions of multiple inspection points in the preset scene 3D model includes: The preset position in the preset scene 3D model is used as the position of the virtual camera; Based on the position of the virtual camera in the preset scene 3D model, a virtual mesh centered on the virtual camera is generated; Multiple coordinate points are selected as inspection points in the virtual grid, and the inspection point positions of each inspection point are determined. The target position to be viewed by each inspection point is determined based on the inspection sequence of each inspection point and the location of the next inspection point of each inspection point.
4. The method according to any one of claims 1-3, characterized in that, The process of generating a preset inspection animation based on the inspection position and the target position calculated in real time at each playback moment includes: Based on the real-time calculated inspection position and the target position at each playback moment, an inspection trajectory is generated. Using a virtual camera as a moving target in the preset scene 3D model, the positional changes along the inspection trajectory are acquired, and the preset inspection animation is generated; or... Using a virtual camera as a fixed viewing position and the preset scene 3D model as the inspection background, the positional changes of the virtual inspection object moving along the inspection trajectory are acquired to generate the preset inspection animation; or... The preset inspection animation is generated by using the virtual camera tracking perspective as the viewing perspective and the positional changes of the virtual inspection object moving along the inspection trajectory in the preset scene 3D model.
5. An inspection animation generation device, characterized in that, The device includes: The data acquisition module is used to acquire the inspection point positions and the target positions of multiple inspection points in a preset scene 3D model, wherein the target positions are used to indicate the looking direction of the corresponding inspection point; The position determination module is used to calculate the inspection position and the target position at each playback moment in real time based on the preset total playback time, the inspection point position of each inspection point, and the target position. The animation generation module is used to generate preset inspection animations based on the inspection position and the target position at each playback moment calculated in real time. The location determination module includes: The path length calculation unit is used to calculate the inspection path length based on the inspection point location. The path distance calculation unit is used to calculate the path distance between the path point and the starting inspection point at each playback time in real time based on the preset total playback time and the inspection path length, wherein the path point is the path position corresponding to each playback time. The inspection position calculation unit is used to calculate the inspection position at each playback time in real time based on the inspection position of the two adjacent inspection points before and after the path point and the path distance. The target position determination unit is used to: if the distance between the path point and the first inspection point after the path point is greater than a preset distance, determine the target position at each playback moment based on the inspection point position of the first inspection point; if the distance between the path point and the first inspection point after the path point is equal to or less than the preset distance, determine the turning angle based on the inscribed circle of the triangle formed by the inspection point before the path point, the first inspection point after the path point, and the second inspection point; if the angle between the path point and the center of the inscribed circle of the triangle is less than or equal to a preset percentage of the turning angle, determine the target position at each playback moment as the inspection point position of the first inspection point; if the angle between the path point and the center of the inscribed circle of the triangle is greater than a preset percentage of the turning angle, determine the target position at each playback moment based on the positions of multiple targets between the first inspection point and the second inspection point.
6. A computer device, characterized in that, include: The system includes a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the computer device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the inspection animation generation method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, performs the steps of the inspection animation generation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Inspection management method based on inspection robot and related equipment
CN114115277A
Virtual image generation method and device, electronic equipment and storage medium
CN116563505A
BIM (Building Information Modeling)-based three-dimensional roaming inspection method and system for coal preparation plant equipment
CN116972855A