Method, system and storage medium for setting smooth lens steering based on automatic path finding

By setting the pre-steering threshold and angle of the lens, the lens steering time is extended, and the visual vertigo problem caused by excessive steering of the lens in traditional automatic pathfinding is solved, and the user experience is improved.

CN118967986BActive Publication Date: 2024-12-31VSWORK NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411424187.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2024-12-31
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

In the traditional automatic pathfinding method, the lens turns too fast and leads to visual vertigo, especially when the path is complicated, affecting the user's experience.

Method used

By setting the pre-steering angle and distance threshold of the lens, calculate the angle angle between the azimuth vector and the direction vector, determine whether it exceeds the threshold. If it exceeds the pre-steer, perform pre-steering. Control the lens to turn according to the angle angle in real time to extend the steering time to avoid sudden sudden Steer, optimize the lens rotation during path switching.

Benefits of technology

It effectively relieves visual dizziness, improves visual comfort during automatic pathfinding, and ensures users' stable experience in three-dimensional scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967986B_ABST
    Figure CN118967986B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and storage medium for setting smooth lens steering based on automatic path finding, which belongs to the field of virtual and reality technology. The method includes: setting an angle threshold and a distance threshold for pre-steering of a user's lens; obtaining the user's current position coordinates P1 and the position coordinates P2 of a target point in the next path segment, and calculating an azimuth vector according to P1 and P2; obtaining the orientation vector of the user's current lens, and calculating the angle between the orientation vector and the orientation vector; judging whether the angle exceeds the angle threshold, if not, then ending, if exceeding, then starting distance detection; calculating the remaining distance moved by the user in the current path segment in real time, and when the remaining distance is less than the distance threshold, controlling the user's lens to turn according to the angle. The present invention avoids the occurrence of visual dizziness caused by excessive direction rotation during the path finding process of a three-dimensional scene by pre-steering to the direction of the next path segment when the current path moves to the next path segment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual and reality technology, and in particular to a method, system and storage medium for setting smooth steering of a lens based on automatic path finding. Background Art

[0002] Virtual and reality technology is mainly based on computer technology, and uses and integrates the latest developments of various high technologies such as 3D graphics technology, multimedia technology, simulation technology, display technology, servo technology, etc., and uses computers and other equipment to create a virtual world with realistic 3D vision, touch, smell and other sensory experiences. Therefore, the display of resources is the most important technology in virtual and reality technology. Since users can move in the constructed virtual world when experiencing virtual and reality technology, it is necessary to ensure that resources can follow the user's pace during the rendering process to ensure the user's experience.

[0003] Automatic pathfinding, also known as path finding algorithm, is a technology in the field of artificial intelligence. It is used in games or other simulated environments to allow characters to automatically find the best path from the starting point to the end point. It is widely used in virtual scenes. Since most users in virtual scenes use the first-person perspective to move the characters, if the camera moves too fast, it will cause visual dizziness. In addition, in virtual scenes, the user's camera and the character's orientation are synchronized. As the character turns, the camera also turns. In the traditional automatic pathfinding process, if the path is complex, the character's orientation will keep changing when walking on each path, and the camera will rotate at the same time as the orientation changes. This high rotation frequency can easily cause discomfort to the user. Therefore, the traditional camera steering method used in automatic pathfinding still has certain defects. Summary of the invention

[0004] The purpose of the present invention is to solve the problem of visual dizziness caused by user lens rotation during automatic route finding, and to propose a lens smooth steering setting method, system and storage medium based on automatic route finding. The method has the advantages of adopting pre-steering, lengthening the steering distance, and effectively alleviating the dizziness for paths with large rotation amplitudes.

[0005] In a first aspect, the present invention achieves the above-mentioned purpose through the following technical solutions, a method for setting a smooth steering of a lens based on automatic pathfinding, the method comprising the following steps:

[0006] Set the angle threshold and distance threshold for the user's lens pre-steering;

[0007] Obtain the user's current position coordinates P1 and the position coordinates P2 of the target point in the next path, and calculate the orientation vector based on P1 and P2;

[0008] Obtain the orientation vector of the user's current lens, and calculate the angle between the orientation vector and the orientation vector;

[0009] Determine whether the angle exceeds the angle threshold, if not, end the process, if exceeded, start distance detection;

[0010] The remaining distance that the user has moved in the current segment of the path is calculated in real time. When the remaining distance is less than the distance threshold, the user's camera is controlled to turn according to the angle.

[0011] Preferably, the target point is the end point of the next path segment, and each path segment is formed by a start point and an end point.

[0012] Preferably, the method further comprises detecting the path length of the next path segment. If the path length is less than a distance threshold, the starting point of the next path segment is ignored, and the current path segment and the next path segment are combined as a new current path segment.

[0013] Preferably, ignoring the starting point of the next path segment is to lock the user's camera orientation when the user passes the starting point.

[0014] Preferably, the method for calculating the remaining distance moved by the user in the current path segment in real time is:

[0015] Obtain the user's current position coordinates P1 and the end point P3 in the current segment path in real time;

[0016] The distance between the two coordinates is calculated based on P1 and P3 as the remaining distance.

[0017] Preferably, the method of controlling the user's lens to turn according to the angle is:

[0018] Get the value of the angle;

[0019] Set a fixed time for the user to move a distance threshold;

[0020] Calculate the turning rate, turning rate = angle / fixed time;

[0021] When executing the pre-turn command, the user's lens rotates evenly according to the turn rate.

[0022] In a second aspect, the present invention achieves the above-mentioned purpose through the following technical solutions: a lens smooth steering setting system based on automatic pathfinding, the system comprising:

[0023] A threshold setting unit, used to set an angle threshold and a distance threshold for pre-steering of the user's lens;

[0024] A direction calculation unit, used to obtain the user's current position coordinates P1 and the position coordinates P2 of the target point in the next path, and calculate the direction vector according to P1 and P2;

[0025] An angle calculation unit, used to obtain the orientation vector of the user's current lens, and calculate the angle between the orientation vector and the orientation vector;

[0026] An angle determination unit, used to determine whether the angle exceeds the angle threshold, if not, then end, if exceeded, then start distance detection;

[0027] The steering control unit is used to calculate in real time the remaining distance that the user has moved in the current segment of the path, and when the remaining distance is less than the distance threshold, control the user's lens to turn according to the angle.

[0028] Preferably, the target point is the end point of the next path segment, and each path segment is formed by a start point and an end point.

[0029] Preferably, the system also includes a path length detection unit for detecting the path length of the next path segment. If the path length is less than a distance threshold, the starting point of the next path segment is ignored, and the current path segment and the next path segment are merged as a new current path segment.

[0030] In a third aspect, the present invention achieves the above-mentioned purpose through the following technical scheme: a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method for setting smooth lens steering based on automatic pathfinding as described in the first aspect is implemented.

[0031] Compared with the prior art, the beneficial effect of the present invention is as follows: the present invention uses the current position combined with the target point in the next section of the path to calculate the angle at which the viewing angle needs to be rotated when the current path switches to the next path, and then determines whether pre-steering is needed based on the angle threshold. In this way, during the automatic pathfinding process, the user can pre-steering the lens before the current path switches to the next path, which prolongs the steering time and avoids sudden steering at a point. In a three-dimensional scene, slow and uniform steering can greatly reduce the dizziness caused to the user by the rotation of the viewing angle, thereby improving the visual comfort during automatic pathfinding. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 The present invention is a flow chart of a method for setting a smooth lens turn based on automatic path finding.

[0033] Figure 2 This is a schematic diagram of the distribution of the starting point and the ending point when the path length of the present invention is short.

[0034] Figure 3A schematic diagram of a system for setting smooth lens steering based on automatic pathfinding according to the present invention. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] Example 1

[0037] like Figure 1 As shown, a method for setting a smooth lens turn based on automatic path finding comprises the following steps:

[0038] The angle threshold and distance threshold of the user's lens pre-steering are set. This solution uses pre-steering to solve the visual dizziness caused by too fast lens rotation and too large rotation amplitude. In the traditional automatic path finding process of three-dimensional scenes, the lens moves synchronously with the character. For example, when the character walks straight ahead, the picture taken by the lens is also straight ahead of the character. When the character turns to the right, the lens follows and turns to the right. It can be seen that the lens rotation is completed at the moment of direction change. In this process, if the rotation angle is too large, the scene picture in the lens will move rapidly, so that the user's eyes will feel unable to focus on the picture content and produce dizziness. In particular, when the rotation frequency of each path increases, the picture keeps moving, which deepens the dizziness. Through pre-steering, the rotation time is lengthened, and the movement rate of the picture during rotation is slowed down in disguise. In this way, it is not easy for the naked eye to produce dizziness, and essentially does not change the entire automatic path finding time. This is because if the lens rotation rate is simply slowed down, it will inevitably lead to a sense of visual delay, which will also affect the lengthening of the automatic path finding time. Therefore, in this step, the angle threshold and distance threshold of pre-steering are set in advance. The angle threshold is used to determine whether pre-steering is needed. The switching between path points that do not require pre-steering is consistent with the normal automatic pathfinding rhythm. The distance threshold is used to determine whether to start pre-steering. It takes time for the user to move on the path. The distance threshold is used to control the user to turn while walking within the distance threshold, which indirectly increases the turning time without increasing the entire automatic pathfinding time. It can also slow down the rotation rate, thereby reducing the visual dizziness.

[0039] Get the user's current position coordinates P1 and the position coordinates P2 of the target point in the next section of the path, and calculate the azimuth vector based on P1 and P2; it can be seen from the above steps that the angle threshold is used to determine whether pre-steering is required, and the judgment basis is to see whether the direction changes when the user reaches the next section of the path. If the direction changes, it is necessary to rotate a certain angle. In order to calculate this angle, the angle between the two directions needs to be calculated. Therefore, in this step, it is necessary to calculate the direction vector between the current position and the selected target point.

[0040] Get the orientation vector of the user's current lens, and calculate the angle between the orientation vector and the orientation vector; the lens moves synchronously with the character, so when the user is in the current position, the orientation of the lens is the orientation of the user. Here, you only need to get the user's current orientation to determine the orientation vector of the lens. The orientation vector of the lens is a direction, and the direction vector calculated in the above steps is also a direction. Therefore, the two direction vectors can calculate the angle, which is the basis for judging whether pre-steering is needed.

[0041] Determine whether the angle exceeds the angle threshold, if not, end, if exceeded, start distance detection; since the present application uses the distance threshold to slow down the rotation rate, from the perspective of details, it will still affect the effect of synchronous movement of part of the lens and the character, and not all lens rotations will cause dizziness, so here the angle is compared with the angle threshold. If the angle is relatively small and does not exceed the angle threshold, it means that even if the lens is rotated during normal automatic pathfinding, it is not easy to cause dizziness, so there is no need to switch the pre-steering operation of this scheme. If it exceeds, pre-steering is required, and then the next step is required.

[0042] Calculate the remaining distance of the user in the current path in real time. When the remaining distance is less than the distance threshold, control the user's lens to turn according to the angle. This step describes in detail how the pre-steering of the lens is performed. Since each path has a starting point and an end point, when the user reaches the end point, it means that the current path is finished. When the pre-steering operation is required, it cannot be turned at the end. This is consistent with the traditional method. Therefore, it is necessary to calculate the remaining distance of the current path in real time. Specifically, the user's position coordinates are continuously detected and the coordinate distance between the end point of the current path is subtracted from the two coordinates to obtain the remaining distance. When the remaining distance reaches the distance threshold, the lens pre-steering operation is performed. At this time, the steering angle of the lens is the previously calculated angle. In this way, when the user reaches the end point, the steering operation ends. In this way, the user's direction is consistent with the direction of the target point of the next path. When the user moves toward the target point, the direction will not change, so the lens will not turn. Through the pre-steering operation, the walking of two different directions of the path is completed, which ensures a real experience while reducing visual dizziness.

[0043] The specific remaining distance calculation method is as follows:

[0044] The method for calculating the remaining distance moved by the user in the current segment path in real time is:

[0045] Obtain the user's current position coordinates P1 and the end point P3 in the current segment path in real time;

[0046] The distance between the two coordinates is calculated based on P1 and P3 as the remaining distance.

[0047] In order for the target point to determine the direction of the path, the target point is the end point of the next path, and each path is formed by a start point and an end point. For two adjacent paths, the end point of the previous path must coincide with the start point of the next path. When the user walks on the path, he moves towards the end point of the path. Therefore, as long as the end point of the next path is known, the direction to walk on the next path can be determined. The end point of the next path is selected as the target point for the convenience of calculation. In fact, any point on the path can be used as the target point. Since the various path points of automatic path finding are known when the path finding path is set, this design of this scheme is only to reduce calculation.

[0048] In actual application, there may be a shorter path. If the pre-steering conditions of this solution are met, then this shorter path also needs pre-steering. Although pre-steering can be performed according to this solution, it takes up some computing resources. Therefore, in order to avoid this phenomenon, some pre-steering operations can be abandoned. The method also includes detecting the path length of the next path segment. If the path length is less than the distance threshold, the starting point of the next path segment is ignored, and the current path segment and the next path segment are merged as the new current path segment. In this step, when the path length is shorter than the distance threshold, if it is not ignored, the user needs to pre-steering when reaching the next path segment, and two lens turns may occur in a short period of time. Although the pre-steering reduces the steering rate, two turns that are very close in time will also affect certain visual perceptions. Therefore, this step ignores the starting point of the next path segment with a short length and merges them into the same path segment, so that when the user pre-steering on the current path segment, the end point of the next path segment is used as a reference for the remaining distance calculation, and the two possible lens turns are fixed to one lens turn, such as Figure 2 As shown, a1-a2 is the current path segment, and the distance a2-a3 is shorter, so a2 is ignored, making the current path segment a1-a3, and the next path segment a3-a4. Therefore, a pre-turn is performed before reaching a3, so that when the user reaches the position of a3, he or she will face the direction of a4. This step is optimized for special situations and reduces the user's visual dizziness.

[0049] Still for reference Figure 2 The above-mentioned ignoring the starting point of the next path means locking the user's lens direction when the user passes the starting point. The above-mentioned ignoring a2 actually means that when the user moves from a1-a2-a3, before pre-turning, the lens angle of view always maintains the direction of the user on the path a1-a2. Here, ignoring a2 actually means that the user still has to walk to a2, but the lens does not rotate, because in traditional automatic pathfinding, when the direction of the point changes, the lens also rotates.

[0050] In order to ensure the smoothness and comfort of the lens pre-steering, the method of controlling the user's lens to steer according to the angle is as follows:

[0051] Get the value of the angle;

[0052] Set a fixed time for the user to move a distance threshold;

[0053] Calculate the turning rate, turning rate = angle / fixed time;

[0054] When executing the pre-steering command, the user's lens rotates evenly according to the steering rate;

[0055] The length of a distance threshold that a user walks is fixed, and the walking speed is also fixed, so it is easy to calculate the fixed time of pre-turning. Then, the turning speed can be easily calculated by the fixed time of pre-turning and the angle of pre-turning. By executing this turning speed, the lens can be turned evenly when the user walks a distance threshold, and the turning effect is better.

[0056] Example 2

[0057] like Figure 3 As shown, a lens smooth steering setting system based on automatic path finding includes:

[0058] The threshold setting unit is used to set the angle threshold and distance threshold of the user's lens pre-steering.

[0059] The orientation calculation unit is used to obtain the user's current position coordinates P1 and the position coordinates P2 of the target point in the next path, and calculate the orientation vector according to P1 and P2.

[0060] The angle calculation unit is used to obtain the orientation vector of the user's current lens and calculate the angle between the orientation vector and the orientation vector.

[0061] The angle determination unit is used to determine whether the angle exceeds the angle threshold. If not, the process ends; if exceeded, the process starts distance detection.

[0062] The steering control unit is used to calculate the remaining distance of the user in the current segment of the path in real time. When the remaining distance is less than the distance threshold, the user's lens is controlled to turn according to the angle. The method for calculating the remaining distance of the user in the current segment of the path in real time is:

[0063] Obtain the user's current position coordinates P1 and the end point P3 in the current segment path in real time;

[0064] The distance between the two coordinates is calculated based on P1 and P3 as the remaining distance.

[0065] The target point is the end point of the next path, and each path is formed by a start point and an end point.

[0066] The system also includes a path length detection unit for detecting the path length of the next path segment. If the path length is less than a distance threshold, the starting point of the next path segment is ignored, and the current path segment and the next path segment are combined as a new current path segment.

[0067] Ignoring the starting point of the next path segment is to lock the user's camera orientation when the user passes the starting point.

[0068] In the steering control unit, the method of controlling the user lens to turn according to the angle is:

[0069] Get the value of the angle;

[0070] Set a fixed time for the user to move a distance threshold;

[0071] Calculate the turning rate, turning rate = angle / fixed time;

[0072] When executing the pre-turn command, the user's lens rotates evenly according to the turn rate.

[0073] Embodiment 2 is essentially the same as Embodiment 1, so the specific working principles of each unit will not be described in detail.

[0074] Example 3

[0075] This embodiment proposes a storage medium, which includes a program storage area and a data storage area, wherein the program storage area can store an operating system and programs required for running an instant messaging function, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc. The computer program is stored in the program storage area, and when the computer program is executed by the processor, the method for setting a smooth lens turn based on automatic path finding as described in Example 1 is implemented. The processor may include one or more central processing units, or a digital processing unit, etc.

[0076] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.

[0077] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for setting a smooth camera turn based on automatic pathfinding, characterized in that: The method comprises the following steps: Set the angle threshold and distance threshold for the user's lens pre-steering; Obtain the user's current position coordinates P1 and the position coordinates P2 of the target point in the next path, and calculate the orientation vector based on P1 and P2; Obtain the orientation vector of the user's current lens, and calculate the angle between the orientation vector and the orientation vector; Determine whether the angle exceeds the angle threshold, if not, end the process, if exceeded, start distance detection; The remaining distance that the user has moved in the current segment of the path is calculated in real time. When the remaining distance is less than the distance threshold, the user's camera is controlled to turn according to the angle.

2. The method for setting a smooth lens turn based on automatic pathfinding according to claim 1, characterized in that: The target point is the end point of the next path, and each path is formed by a start point and an end point.

3. The method for setting a smooth lens turn based on automatic pathfinding according to claim 2, characterized in that: The method also includes detecting the path length of the next path segment. If the path length is less than a distance threshold, ignoring the starting point of the next path segment, and merging the current path segment and the next path segment as a new current path segment.

4. The method for setting a smooth lens turn based on automatic pathfinding according to claim 3, characterized in that: Ignoring the starting point of the next path segment is to lock the user's camera orientation when the user passes the starting point.

5. The method for setting a smooth camera turn based on automatic pathfinding according to claim 2, characterized in that: The method for calculating the remaining distance moved by the user in the current segment path in real time is: Obtain the user's current position coordinates P1 and the end point P3 in the current segment path in real time; The distance between the two coordinates is calculated based on P1 and P3 as the remaining distance.

6. The method for setting a smooth camera turn based on automatic pathfinding according to claim 1, characterized in that: The method for controlling the user's lens to turn according to the angle is: Get the value of the angle; Set a fixed time for the user to move a distance threshold; Calculate the turning rate, turning rate = angle / fixed time; When executing the pre-turn command, the user's lens rotates evenly according to the turn rate.

7. A lens smooth steering setting system based on automatic path finding, characterized in that: The system includes: A threshold setting unit, used to set an angle threshold and a distance threshold for pre-steering of the user's lens; A direction calculation unit, used to obtain the user's current position coordinates P1 and the position coordinates P2 of the target point in the next path, and calculate the direction vector according to P1 and P2; An angle calculation unit, used to obtain the orientation vector of the user's current lens, and calculate the angle between the orientation vector and the orientation vector; An angle determination unit, used to determine whether the angle exceeds the angle threshold, if not, then end, if exceeded, then start distance detection; The steering control unit is used to calculate in real time the remaining distance that the user has moved in the current segment of the path, and when the remaining distance is less than the distance threshold, control the user's lens to turn according to the angle.

8. The lens smooth steering setting system based on automatic path finding according to claim 7, characterized in that: The target point is the end point of the next path, and each path is formed by a start point and an end point.

9. The system for setting a smooth camera turn based on automatic pathfinding according to claim 7, characterized in that: The system also includes a path length detection unit for detecting the path length of the next path segment. If the path length is less than a distance threshold, the starting point of the next path segment is ignored, and the current path segment and the next path segment are combined as a new current path segment.

10. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method for setting a smooth lens turn based on automatic path finding as described in any one of claims 1 to 6 is implemented.