Method and system for controlling model rotation during interaction by using space pen, and storage medium
The method addresses instability and imprecision in spatial pen-controlled model rotation by employing rotation mapping, timestamping, and data smoothing, resulting in precise and smooth model rotation in virtual reality environments.
Patent Information
- Application Number
- CN202411783236.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for controlling model rotation using a spatial pen in virtual reality are unstable and lack precision, requiring high user operation and leading to inaccurate control.
A method involving rotation mapping, timestamp binding, delayed data synchronization, and data smoothing to ensure precise and smooth model rotation using a spatial pen, utilizing a gyroscope for rotation detection and a timer for timestamp recording, with communication via network or Bluetooth, and offset filtering to eliminate data jitter.
The method provides stable, precise, and realistic control over model rotation, reducing hand-shake-induced errors and enhancing the visual experience by ensuring synchronized and smooth rotation data transmission.
Smart Images

Figure CN119248123A_ABST
Abstract
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 controlling the rotation of a model when using a space pen for interaction. Background Art
[0002] Virtual reality technology (English name: Virtual Reality, abbreviated as VR) encompasses computers, electronic information, and simulation technologies. Its basic implementation method is based on computer technology, utilizing and integrating the latest developments in three-dimensional graphics technology, multimedia technology, simulation technology, display technology, servo technology, and other high-tech technologies. With the help of computers and other equipment, it creates a realistic three-dimensional virtual world with multiple sensory experiences such as vision, touch, and smell, thereby giving people in the virtual world an immersive feeling.
[0003] When interacting in a virtual scene, peripherals are usually used to assist in the interaction. Taking the spatial pen as an example, the buttons set on the spatial pen can correspond to the functions in the scene, or the spatial pen can be used as a mouse to control the cursor in the scene to realize the use of functions. However, when the traditional spatial pen controls the rotation of the model, it can only rely on the cursor function of the mouse to control the rotation of the model. Since the spatial pen adopts a holding operation method, unlike the mouse, the mouse is placed on a table for use and has better stability. Therefore, using the spatial pen to control the rotation of the model requires too high operation from the user, otherwise the rotation will easily get out of control. In addition, the operation of controlling the rotation direction and angle of the model by dragging the cursor is not close to reality and will also lead to low control accuracy. Therefore, the rotation control of the model in the prior art cannot meet the needs of users. Summary of the invention
[0004] The purpose of the present invention is to solve the above-mentioned traditional problem of instability and poor precision when using peripherals to control the rotation of models in the scene, and to propose a method, system and storage medium for controlling the rotation of models when using a spatial pen for interaction. The method adopts a method of mapping synchronous rotation angles, can accurately control the rotation of the model to a specified angle, and the operation is in line with reality and has the advantages of higher precision.
[0005] In a first aspect, the present invention achieves the above-mentioned purpose through the following technical solution, a method for controlling the rotation of a model when using a space pen to interact, the method comprising the following steps: Setup steps: Setting a rotation mapping for the spatial pen, the rotation mapping includes mapping the horizontal rotation of the spatial pen to the rotation of the model around the vertical axis, and mapping the vertical rotation of the spatial pen to the rotation of the model around the horizontal axis; Setting the spatial pen to bind a timestamp when sending rotation data, the timestamp is used to record the initial time t0 of each data sent by the spatial pen; Set the delayed time interval T of data synchronization, calculate the standard time t1=t0+T, record the time t2 when the rotation data is received, if t2<t1, set t1 as the starting time for the model to rotate according to the rotation data, if t2≥t1, set t2 as the starting time for the model to rotate according to the rotation data; Control steps: Establishing a communication connection between the model and the space pen in advance to receive control instructions from the user; The rotation data of the spatial pen is obtained, and the rotation data is synchronized to the model for execution.
[0006] Preferably, the method further comprises smoothing the rotation data during data synchronization, wherein the smoothing method is: Set an offset filter box, which is used to detect relative offset. The relative offset is defined as when the rotation data is used to control horizontal rotation, the vertical angle component and the horizontal repeated angle component are the relative offset; when the rotation data is used to control vertical rotation, the horizontal angle component and the vertical repeated angle component are the relative offset; Smoothing the received rotation data input into the offset filter frame; If no offset is detected, retaining the rotation data; If an offset is detected, components are deleted and duplicates are removed from the rotation data to obtain processed rotation data.
[0007] Preferably, the method for determining whether the rotation data is used to control horizontal rotation and vertical rotation is: obtaining the total angle values of the horizontal and vertical directions in the rotation data, comparing the total angle values of the two directions, and retaining the direction with the largest total angle value as the rotation direction.
[0008] Preferably, the setting of the rotation mapping for the space pen further includes setting the mapping ratio as follows: Space pen rotation angle: model rotation angle = 1:4; Assuming the initial state of the space pen is 0°, the angle threshold for horizontal rotation is -45° to 45°, and the angle threshold for vertical rotation is -30° to 60°.
[0009] Preferably, the setting of binding the timestamp while sending the rotation data of the spatial pen is to record the rotation data by a gyroscope built into the spatial pen and to record the timestamp by a timer.
[0010] Preferably, the method for establishing a communication connection between the model and the space pen is a network protocol connection or a Bluetooth connection.
[0011] In a second aspect, the present invention achieves the above-mentioned purpose through the following technical solutions: a system for controlling the rotation of a model when using a space pen to interact, the system comprising: A setting unit, the setting unit comprising: A rotation mapping module, used to set a rotation mapping for the space pen, wherein the rotation mapping includes mapping the horizontal rotation of the space pen to the rotation of the model around the vertical axis, and mapping the vertical rotation of the space pen to the rotation of the model around the horizontal axis; A timing module, used for setting a time stamp to be bound when the spatial pen sends rotation data, and the time stamp is used to record the initial time t0 of each data sent by the spatial pen; A data processing module, used to set a delayed time interval T for data synchronization, calculate a standard time t1=t0+T, record a time t2 when the rotation data is received, and if t2<t1, set t1 as a start time for the model to rotate according to the rotation data; if t2≥t1, set t2 as a start time for the model to rotate according to the rotation data; A control unit, the control unit comprising: An instruction receiving module, used to establish a communication connection between the model and the space pen in advance and receive a control instruction from a user; The synchronous execution module is used to obtain the rotation data of the spatial pen and synchronize the rotation data to the model for execution.
[0012] Preferably, the setting unit further includes a smoothing processing module for smoothing the rotation data during data synchronization, and the smoothing processing method is: Set an offset filter box, which is used to detect relative offset. The relative offset is defined as when the rotation data is used to control horizontal rotation, the vertical angle component and the horizontal repeated angle component are the relative offset; when the rotation data is used to control vertical rotation, the horizontal angle component and the vertical repeated angle component are the relative offset; Smoothing the received rotation data input into the offset filter frame; If no offset is detected, retaining the rotation data; If an offset is detected, components are deleted and duplicates are removed from the rotation data to obtain processed rotation data.
[0013] Preferably, the rotation mapping module further includes setting a mapping ratio as follows: Space pen rotation angle: model rotation angle = 1:4; Assuming the initial state of the space pen is 0°, the angle threshold for horizontal rotation is -45° to 45°, and the angle threshold for vertical rotation is -30° to 60°.
[0014] In a third aspect, the present invention achieves the above-mentioned purpose through the following technical scheme: a storage medium storing a computer program, which, when executed by a processor, implements the method of controlling the rotation of a model when using a spatial pen to interact as described in the first aspect.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention utilizes the rotation of the spatial pen to map the rotation of the model, so when the spatial pen is rotated, the model also rotates. When the model receives the rotation data of the spatial pen, the start time of the model executing the rotation data is controlled by setting a delay time interval, so that the time of the spatial pen synchronizing to the model can be unified, and the delay fluctuation of data transmission can be avoided to affect the visual effect of the user watching the synchronous rotation of the model. Moreover, because of the setting of the delay time interval, the execution of the rotation data has a delayed operation. In this delayed process, the rotation data can be smoothed, and the smoothing process can eliminate some offset errors in the rotation data, so that the rotation of the final rotation data is smoother. When the spatial pen is used to control the rotation of the model, the situation that the rotation is not smooth enough due to the shaking of the user's hand is reduced, and the rotation restoration effect is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flow chart of the method for controlling the rotation of a model when using a space pen to interact according to the present invention.
[0017] Figure 2 It is a schematic diagram of the rotation mapping between the space pen and the model of the present invention.
[0018] Figure 3 It is a schematic diagram of the rotation angle change before smoothing, taking horizontal rotation as an example of the present invention.
[0019] Figure 4 It is a schematic diagram of the change of the rotation angle after smoothing processing taking horizontal rotation as an example of the present invention.
[0020] Figure 5 This is a schematic diagram of the system composition for controlling the rotation of a model when using a space pen for interaction according to the present invention. DETAILED DESCRIPTION
[0021] 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.
[0022] Example 1 like Figure 1 As shown, a method for controlling the rotation of a model when using a space pen to interact, the method comprising the following steps: Setup steps: A rotation mapping is set for the spatial pen, and the rotation mapping includes mapping the horizontal rotation of the spatial pen to the rotation of the model with the vertical axis as the center, and mapping the vertical rotation of the spatial pen to the rotation of the model with the horizontal axis as the center. The rotation mapping is to establish a rotation correspondence between the spatial pen and the model in the virtual scene, and during mapping, the spatial pen and the model are set to have two rotation directions, horizontal and vertical. The rotation direction of the spatial pen can be detected by a gyroscope, which requires a built-in gyroscope in the spatial pen. The gyroscope can be used to record the rotation direction and rotation angle of the spatial pen. Because the model is virtual data, its rotation is controlled by a rotation command. Therefore, the rotation mapping between the spatial pen and the model is actually to obtain the rotation direction and rotation angle through the gyroscope as rotation data, and then use the rotation data as the input of the rotation command, so as to achieve the effect of synchronous rotation control of the model, such as Figure 2 As shown, the XYZ coordinate system is established with the model as the center, and the rotation center of the model is the origin of the coordinate system. It can be seen that the rotation mapping is mapped to the horizontal rotation of the model according to the left and right rotation of the space pen, and the model can rotate clockwise or counterclockwise on the plane formed by the X-axis and the Y-axis. The up and down rotation of the space pen is mapped to the vertical rotation of the model, and the model can rotate clockwise or counterclockwise on the plane formed by the Y-axis and the Z-axis.
[0023] By utilizing the above-mentioned rotation mapping, when the user controls the rotation of the model, they only need to hold the space pen, which is equivalent to holding the model in the virtual scene. This control method brings a sense of experience that is closer to reality, and compared to the traditional mouse-pulling method to rotate the model, it is less difficult to learn. Since the space pen is held and rotated, the operation is more precise.
[0024] The spatial pen is set to bind a timestamp when sending rotation data, and the timestamp is used to record the initial time t0 each time the spatial pen sends data; in this step, the timestamp is bound to facilitate recording the time when the spatial pen sends rotation data. Since the spatial pen is a real device and the model is displayed in the running virtual scene, in order to transmit data between the two, the spatial pen must have the function of sending data. According to the existing data transmission technology, the transmission efficiency of wired transmission is greater than that of wireless transmission. After adding the timestamp, the spatial pen sends the rotation data to the virtual scene client and also transmits the time when it sends the data to the client. The client can also read the current time of the running device. Therefore, based on the comparison of the two times, it is convenient for the client to know the time consumed in the data transmission process, and also provides support for subsequent data processing.
[0025] Set the delayed time interval T for data synchronization, calculate the standard time t1=t0+T, record the time t2 when the rotation data is received, if t2<t1, set t1 as the starting time for the model to rotate according to the rotation data, if t2≥t1, set t2 as the starting time for the model to rotate according to the rotation data. The above steps use the space pen to bind the timestamp when sending the rotation data to know the time when the data is sent. Since data transmission has a certain delay, the execution time after each rotation data is received is unified by increasing the delayed time interval T. This execution time is the standard time t1. In theory, although data transmission has a certain delay, the delay time is short, so the synchronization start time of the rotation data is executed according to the standard time to ensure that the delay is at a fixed value, and there will be no occasional delay. A large or small delay will bring a sense of visual conflict. However, when special circumstances occur, such as the delay in data transmission becomes larger, the standard time is already less than the moment when the client receives the rotation data, then the standard time cannot be directly used as the start time of execution. Therefore, it is necessary to record the time t2 when the rotation data is received. If the delay is too large, t2 is directly used as the start time for the model to execute the rotation data, so as to respond to emergencies more reasonably. Since the size of the standard time will affect the user's visual viewing delay and the frequency of encountering special situations, the size of the standard time should be neither too small nor too large. If it is too small, the frequency of encountering special situations will increase, and if it is too large, the sense of delay will increase, resulting in insufficient sensitivity of the rotation control. Therefore, selecting the delay time interval T in the range of 20 to 30ms can meet the above-mentioned usage requirements.
[0026] According to the above setting steps, it can be ensured that the space pen can control the model rotation to run normally. The specific steps of using the space pen are described in detail below: Control steps: A communication connection is established between the model and the spatial pen in advance to receive control instructions from the user; when the spatial pen is operated, a communication connection needs to be established with the client of the virtual scene so that the instructions can be normally transmitted to the virtual scene, and the spatial pen also needs to set a rotation control instruction, because the spatial pen exists not only to provide a rotation control function, but also has other functions, such as the opening and closing and use of other interactive functions in some scenes. Therefore, the control instruction received by the client is only used to turn on the rotation control function. A function button can be set on the spatial pen. When the function button is long pressed, the rotation control is turned on. When the function button is released, the rotation stops, which can facilitate the user to stop the model to the rotated position in time. In addition, this button is added. After stopping the current control, it is turned on again, and the gyroscope of the spatial pen recalculates the rotation angle for synchronization. In this way, the spatial pen does not need to maintain the same angle with the model in the initial stage when re-controlling. The model is rotated only from the current state of the spatial pen as the starting state, which is more convenient to operate.
[0027] By acquiring the rotation data of the spatial pen and synchronizing the rotation data to the model for execution, the rotation trajectory of the spatial pen can be restored and a synchronous rotation visual effect can be achieved.
[0028] The rotation of the model is a process, so there will be a rotation trajectory. Since the space pen is manually controlled, there will inevitably be up and down jitters, or horizontal shaking, which will cause a large number of errors in the rotation data. When the model is restored, in order to filter out these offset jitters, it is necessary to further optimize the rotation data transmitted by the space pen. Therefore, the method also includes smoothing the rotation data during data synchronization. The smoothing process makes the rotation trajectory of the model smoother and can also improve the user's perception. The smoothing method is: An offset filter box is set, and the offset filter box is used to detect a relative offset. The definition of the relative offset is that when the rotation data is used to control horizontal rotation, the angular component in the vertical direction and the angular component repeated in the horizontal direction are the relative offsets; when the rotation data is used to control vertical rotation, the angular component in the horizontal direction and the angular component repeated in the vertical direction are the relative offsets. The length of the offset filter box is used to detect the unit time, and the width is used to detect the frequency of the angle change in the unit time. It filters out the angle change line segments with high frequency of angle change in the unit time, retains the starting angle and the ending angle of the line segments in the box, deletes other angles of the original line segments in the box, and uses an interpolation algorithm to insert a value between the starting angle and the ending angle to make a uniform transition.
[0029] Smoothing the received rotation data input into the offset filter frame; If no offset is detected, retaining the rotation data; If an offset is detected, components are deleted and duplicates are removed from the rotation data to obtain processed rotation data.
[0030] The offset filter box is used to filter out errors in rotation data. Take horizontal rotation as an example. Figure 3 The figure shows the angle change over time when the space pen rotates horizontally. Since the space pen is manually operated, there will be multiple time periods of angle offset. At this time, the offset filter box is used to smooth these high-frequency offset line segments to obtain the following Figure 4 The diagram shown in Figure 3 The jittery and fluctuating lines in the model are smoothed to obtain smooth lines. Figure 4 The rotation data shown can effectively solve the jitter during rotation and make the rotation smoother. Due to the existence of the delayed time interval T, the starting time of the angle change in the lower half of the chart starts from t1.
[0031] The method for determining whether the rotation data is used to control horizontal rotation and vertical rotation is: obtaining the total angle values of the horizontal and vertical directions in the rotation data, comparing the total angle values of the two directions, and retaining the direction with the largest total angle value as the rotation direction. Although the gyroscope can determine whether the space pen is rotating horizontally or vertically, in actual operation, when the angles of the two control directions have changed in the user's initial state, the gyroscope cannot determine the user's specific intentions. Therefore, a horizontal and vertical judgment method is added here, and the total angle value is used to determine the rotation direction that the user ultimately wants to operate. This will prevent the technical error of filtering the correct direction when using the offset filter box because the direction in the initial stage is inconsistent with the user's original direction.
[0032] In order to reduce the angle deflection when the user uses it, a small deflection is conducive to manipulation, and a large deflection is not conducive to ergonomic design. Therefore, the setting of rotation mapping for the space pen also includes setting the mapping ratio as follows: Space pen rotation angle: model rotation angle = 1:4; Assuming the initial state of the space pen is 0°, the angle threshold for horizontal rotation is -45° to 45°, and the angle threshold for vertical rotation is -30° to 60°. Figure 3 As shown, when the space pen rotates within the range of 0 to 45°, the corresponding changes of the model from 0 to 180°. Since horizontal rotation can easily keep the left and right rotation angles consistent, and vertical rotation, the height of the wrist lifted upward is less than the height of the wrist tilted downward, therefore, the angle threshold of horizontal rotation is selected as -45° to 45°, and the angle threshold of vertical rotation is selected as -30° to 60°, to reduce the height lifted upward.
[0033] The setting of binding the timestamp while sending the rotation data of the spatial pen is to record the rotation data by the built-in gyroscope of the spatial pen and record the timestamp by the timer. The method of establishing a communication connection between the model and the spatial pen is a network protocol connection or a Bluetooth connection. In order to avoid the inconvenience of spatial pen operation, the general spatial pen does not use a wired connection, but mostly uses Bluetooth, a low-cost data transmission method. This is also the wireless transmission method mentioned above. There will be a certain delay problem.
[0034] Example 2 like Figure 5 As shown, a system for controlling the rotation of a model when using a space pen to interact, the system comprising: A setting unit, the setting unit comprising: A rotation mapping module is used to set a rotation mapping for the spatial pen, wherein the rotation mapping includes mapping the horizontal rotation of the spatial pen to the rotation of the model with the vertical axis as the center, and mapping the vertical rotation of the spatial pen to the rotation of the model with the horizontal axis as the center; a method for determining whether the rotation data is used to control the horizontal rotation and the vertical rotation is as follows: obtaining the total angle values of the horizontal direction and the vertical direction in the rotation data, comparing the total angle values of the two directions, and retaining the direction with the largest total angle value as the rotation direction; A timing module, used for setting a time stamp to be bound when the spatial pen sends rotation data, and the time stamp is used to record the initial time t0 of each data sent by the spatial pen; A data processing module is used to set the delayed time interval T of data synchronization, calculate the standard time t1=t0+T, record the time t2 when the rotation data is received, and if t2<t1, set t1 as the starting time for the model to rotate according to the rotation data; if t2≥t1, set t2 as the starting time for the model to rotate according to the rotation data.
[0035] A control unit, the control unit comprising: An instruction receiving module, used to establish a communication connection between the model and the space pen in advance and receive a control instruction from a user; The synchronous execution module is used to obtain the rotation data of the spatial pen and synchronize the rotation data to the model for execution.
[0036] The setting unit further includes a smoothing processing module, which is used to perform smoothing processing on the rotation data during data synchronization, and the smoothing processing method is: Set an offset filter box, which is used to detect relative offset. The relative offset is defined as when the rotation data is used to control horizontal rotation, the vertical angle component and the horizontal repeated angle component are the relative offset; when the rotation data is used to control vertical rotation, the horizontal angle component and the vertical repeated angle component are the relative offset; Smoothing the received rotation data input into the offset filter frame; If no offset is detected, retaining the rotation data; If an offset is detected, components are deleted and duplicates are removed from the rotation data to obtain processed rotation data.
[0037] The rotation mapping module also includes setting the mapping ratio as: Space pen rotation angle: model rotation angle = 1:4; Assuming the initial state of the space pen is 0°, the angle threshold for horizontal rotation is -45° to 45°, and the angle threshold for vertical rotation is -30° to 60°.
[0038] The setting that the spatial pen sends the rotation data and binds the timestamp at the same time is to record the rotation data through the built-in gyroscope of the spatial pen and record the timestamp through a timer.
[0039] Embodiment 2 is essentially the same as Embodiment 1, so the specific working principles of each unit will not be described in detail.
[0040] Example 3 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 instant messaging functions, 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 controlling the rotation of the model when using the space pen to interact as described in Example 1 is implemented. The processor may include one or more central processing units, or a digital processing unit, etc.
[0041] 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.
[0042] 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 controlling the rotation of a model when using a space pen to interact, characterized in that: The method comprises the following steps: Setup steps: Setting a rotation mapping for the spatial pen, the rotation mapping includes mapping the horizontal rotation of the spatial pen to the rotation of the model around the vertical axis, and mapping the vertical rotation of the spatial pen to the rotation of the model around the horizontal axis; Setting the spatial pen to bind a timestamp when sending rotation data, the timestamp is used to record the initial time t0 of each data sent by the spatial pen; Set the delayed time interval T of data synchronization, calculate the standard time t1=t0+T, record the time t2 when the rotation data is received, if t2<t1, set t1 as the starting time for the model to rotate according to the rotation data, if t2≥t1, set t2 as the starting time for the model to rotate according to the rotation data; Control steps: Establishing a communication connection between the model and the space pen in advance to receive control instructions from the user; The rotation data of the spatial pen is obtained, and the rotation data is synchronized to the model for execution.
2. The method for controlling the rotation of a model when using a space pen to interact according to claim 1, characterized in that: The method further includes smoothing the rotation data during data synchronization, wherein the smoothing method is: Set an offset filter box, which is used to detect relative offset. The relative offset is defined as when the rotation data is used to control horizontal rotation, the vertical angle component and the horizontal repeated angle component are the relative offset; when the rotation data is used to control vertical rotation, the horizontal angle component and the vertical repeated angle component are the relative offset; Smoothing the received rotation data input into the offset filter frame; If no offset is detected, retaining the rotation data; If an offset is detected, components are deleted and duplicates are removed from the rotation data to obtain processed rotation data.
3. The method for controlling the rotation of a model when using a space pen to interact according to claim 2, characterized in that: The method for determining whether the rotation data is used to control horizontal rotation and vertical rotation is: obtaining the total angle values of the horizontal direction and the vertical direction in the rotation data, comparing the total angle values of the two directions, and retaining the direction with the largest total angle value as the rotation direction.
4. The method for controlling the rotation of a model when using a space pen to interact according to claim 1, characterized in that: The setting of the rotation mapping for the spatial pen further includes setting the mapping ratio as follows: Space pen rotation angle: model rotation angle = 1:4; Assuming the initial state of the space pen is 0°, the angle threshold for horizontal rotation is -45° to 45°, and the angle threshold for vertical rotation is -30° to 60°.
5. The method for controlling the rotation of a model when using a space pen to interact according to claim 1, characterized in that: The setting that the spatial pen sends the rotation data and binds the timestamp at the same time is to record the rotation data through the built-in gyroscope of the spatial pen and record the timestamp through a timer.
6. The method for controlling the rotation of a model when using a space pen for interaction according to claim 1, characterized in that: The method for establishing a communication connection between the model and the space pen is a network protocol connection or a Bluetooth connection.
7. A system for controlling the rotation of a model when using a space pen for interaction, characterized in that: The system includes: A setting unit, the setting unit comprising: A rotation mapping module, used to set a rotation mapping for the space pen, wherein the rotation mapping includes mapping the horizontal rotation of the space pen to the rotation of the model around the vertical axis, and mapping the vertical rotation of the space pen to the rotation of the model around the horizontal axis; A timing module, used for setting a time stamp to be bound when the spatial pen sends rotation data, and the time stamp is used to record the initial time t0 of each data sent by the spatial pen; A data processing module, used to set a delayed time interval T for data synchronization, calculate a standard time t1=t0+T, record a time t2 when the rotation data is received, and if t2<t1, set t1 as a start time for the model to rotate according to the rotation data; if t2≥t1, set t2 as a start time for the model to rotate according to the rotation data; A control unit, the control unit comprising: An instruction receiving module, used to establish a communication connection between the model and the space pen in advance and receive a control instruction from a user; The synchronous execution module is used to obtain the rotation data of the spatial pen and synchronize the rotation data to the model for execution.
8. The system for controlling the rotation of a model when using a space pen for interaction according to claim 7, characterized in that: The setting unit further includes a smoothing processing module, which is used to perform smoothing processing on the rotation data during data synchronization, and the smoothing processing method is: Set an offset filter box, which is used to detect relative offset. The relative offset is defined as when the rotation data is used to control horizontal rotation, the vertical angle component and the horizontal repeated angle component are the relative offset; when the rotation data is used to control vertical rotation, the horizontal angle component and the vertical repeated angle component are the relative offset; Smoothing the received rotation data input into the offset filter frame; If no offset is detected, retaining the rotation data; If an offset is detected, components are deleted and duplicates are removed from the rotation data to obtain processed rotation data.
9. The system for controlling the rotation of a model when using a space pen for interaction according to claim 7, characterized in that: The rotation mapping module also includes setting the mapping ratio as: Space pen rotation angle: model rotation angle = 1:4; Assuming the initial state of the space pen is 0°, the angle threshold for horizontal rotation is -45° to 45°, and the angle threshold for vertical rotation is -30° to 60°.
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 controlling the rotation of a model when using a space pen for interaction as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Exhibition hall system based on virtual reality interaction and using method thereof
CN111399665A
Method, device and equipment for determining lane line shape in crowdsourcing data
CN111611958A
Operation gesture detection processing method and device based on VR interaction device and medium
CN114237403A
Desktop interaction system, implementation method and storage medium
CN115373513A
Time synchronization method and device, equipment and storage medium
CN115694704A
