CN108683807B - Radar animation display method, device and equipment based on mobile phone gyroscope - Google Patents

Radar animation display method, device and equipment based on mobile phone gyroscope Download PDF

Info

Publication number
CN108683807B
CN108683807B CN201810421732.6A CN201810421732A CN108683807B CN 108683807 B CN108683807 B CN 108683807B CN 201810421732 A CN201810421732 A CN 201810421732A CN 108683807 B CN108683807 B CN 108683807B
Authority
CN
China
Prior art keywords
mobile phone
radar
gyroscope
image
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810421732.6A
Other languages
Chinese (zh)
Other versions
CN108683807A (en
Inventor
谷闹年
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Jiyi Network Technology Co ltd
Original Assignee
Wuhan Jiyi Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Jiyi Network Technology Co ltd filed Critical Wuhan Jiyi Network Technology Co ltd
Priority to CN201810421732.6A priority Critical patent/CN108683807B/en
Publication of CN108683807A publication Critical patent/CN108683807A/en
Application granted granted Critical
Publication of CN108683807B publication Critical patent/CN108683807B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72427User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for supporting games or graphical animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a radar animation display method, device and equipment based on a mobile phone gyroscope. The method comprises the following steps: if the judgment shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, displaying a radar sector image in a target image; and acquiring the rotation angular velocity of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation. The embodiment of the invention provides a method for realizing radar animation by utilizing a mobile phone gyroscope, wherein the radar animation can be applied to various applications of a mobile phone.

Description

Radar animation display method, device and equipment based on mobile phone gyroscope
Technical Field
The embodiment of the invention relates to the field of computers, in particular to a radar animation display method, device and equipment based on a mobile phone gyroscope.
Background
The mobile phone gyroscope is also called as an angular velocity sensor, and is different from an accelerometer (G-sensor), the measured physical quantity of the mobile phone gyroscope is the rotation angular velocity during deflection and inclination, and the rotation and deflection actions can be well measured, so that the actual actions of a user can be accurately analyzed and judged.
With more and more gyroscope phones, developers of APP applications will create more and more gyroscope applications. However, at the current mobile end, such as Android, there is no realization method of radar animation based on a gyroscope.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a radar animation display method, device and equipment based on a mobile phone gyroscope, which can rotate along with the rotation of the mobile phone gyroscope to realize radar animation.
In a first aspect, an embodiment of the present invention provides a radar animation display method based on a mobile phone gyroscope, including:
if the judgment shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, displaying a radar sector image in a target image;
and acquiring the rotation angular velocity of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
In a second aspect, an embodiment of the present invention provides a radar animation display method and apparatus based on a mobile phone gyroscope, including:
the radar display module is used for displaying a radar sector image in a target image if judging that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value;
and the radar rotating module is used for acquiring the rotating angular speed of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotating angular speed and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
In a third aspect, an embodiment of the present invention provides a radar animation display device based on a mobile phone gyroscope, including:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the mobile phone gyroscope-based radar animation display method according to the first aspect of the embodiment of the invention and the method according to any optional embodiment of the method.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions for executing the method for displaying radar animation based on a mobile phone gyroscope according to the first aspect of the present invention and the method according to any optional embodiment of the present invention.
According to the radar animation display method based on the mobile phone gyroscope, provided by the embodiment of the invention, after the rotation angular speed of the mobile phone gyroscope reaches a certain speed, the radar sector image is displayed in the target image, and the angular position of the radar sector image is set according to the rotation angle of the mobile phone gyroscope, so that the radar sector image rotates by taking a preset area or a preset point in the target image as a center, and radar animation is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flowchart of a radar animation display method based on a mobile phone gyroscope according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a radar animation according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a gyroscope of a mobile phone according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a radar animation display device based on a mobile phone gyroscope according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a framework of a mobile phone gyroscope-based radar animation display device according to an embodiment of the present invention;
description of the reference numerals
1. Target image, 2, radar sector image, 3, predetermined area or predetermined point.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Firstly, it should be noted that the development tool of the radar animation display method based on the mobile phone gyroscope in the embodiment of the invention is Android studio3.0, and the method can be operated on systems of Android4.0 and above.
Fig. 1 is a flowchart of a radar animation display method based on a mobile phone gyroscope according to an embodiment of the present invention, where the radar animation display method based on a mobile phone gyroscope shown in fig. 1 includes that an execution main body is a mobile phone APP, and includes:
s100, if the fact that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value is judged and known, displaying a radar sector image in a target image;
the principle of a gyroscope is that the direction in which the axis of rotation of a rotating object points is not changed when not affected by an external force. In the embodiment of the present invention, when the rotation angular velocity of the gyroscope of the mobile phone reaches a certain value, the radar animation is started, that is, the first preset threshold is reached, and the specific first preset threshold may be determined according to actual needs, for example, 0.1rad/s, 0.15rad/s, 0.2rad/s, and the like, which is not specifically limited in the embodiment of the present invention.
The target image may be any image, in other words, the radar sector image may be displayed at any place where it is desired to be shown. Fig. 2 is a schematic diagram of a radar animation according to an embodiment of the present invention, please refer to fig. 2, in which a target image 1 is a circular area image, a central circular area of the target image 1 is a predetermined area 3, and a sector image between an outermost circular image and the circular area of the predetermined area 3 is a radar sector image 2. Fig. 2 is only a schematic illustration of a radar animation, but the radar image according to the embodiment of the present invention is not limited to the representation form of fig. 2.
S101, acquiring a rotation angular velocity of the mobile phone gyroscope and a current time value of the mobile phone gyroscope, and setting an angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
Specifically, after the rotational angular velocity of the mobile phone gyroscope reaches the threshold value, the radar animation is started, and in step S101, the radar sector image is updated in real time according to the rotational angular velocity of the mobile phone gyroscope and the current time value, that is, the current timestamp of the mobile phone gyroscope, so that the radar sector image rotates around a predetermined area or a predetermined point in the target image, and the radar animation in which the radar sector image moves along with the mobile phone gyroscope is visually displayed.
The embodiment of the invention provides a method for realizing radar animation by using a mobile phone gyroscope, which is characterized in that after the rotating angular speed of the mobile phone gyroscope reaches a certain speed, a radar sector image is displayed in a target image, and the angular position of the radar sector image is set according to the rotating angle of the mobile phone gyroscope, so that the radar sector image rotates by taking a preset area in the target image as the center, and the radar animation is realized.
Based on the above embodiment, in step S100, if it is determined that the rotation angular velocity of the mobile phone gyroscope reaches the first preset threshold, displaying the radar sector image in the target image specifically includes:
if the judgment result shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, drawing a radar sector image, wherein the sector angle of the radar sector image is a preset display wide angle;
displaying the radar sector image in the target image, wherein the position of the radar sector image in the target image is related to the Z-axis position of the mobile phone gyroscope and is related to a preset area and a preset point of the target image.
In this embodiment, after the rotation angular velocity of the mobile phone gyroscope reaches the threshold, the radar sector image is displayed, and first the sector image needs to be drawn, specifically, a sector in the drawn radar sector image has an angle, please refer to fig. 2, where the angle may be set according to an actual display requirement, that is, a preset display wide angle may be set according to the actual requirement, for example, the preset display wide angle is set to be 30 degrees, 45 degrees, 60 degrees, and the like, which is not specifically limited in this embodiment of the present invention. And displaying the radar sector image after the angle is set and drawn.
Specifically, since the radar fan image needs to be rotated around a predetermined area or a predetermined point in the target image, the display position of the radar fan image is related to the predetermined area or the predetermined point, and as shown in fig. 2, one side of the radar fan image 2 is close to or connected to the predetermined area 3. And the specific direction of the radar sector image is related to the Z-axis position of the mobile phone gyroscope, so that the display position of the radar sector image can be determined according to the preset area or the preset point and the Z-axis position of the mobile phone gyroscope.
Specifically, the position of the radar sector image in the target image is related to the Z-axis position of the mobile phone gyroscope, and may be:
and the fan-shaped central line of the radar fan-shaped image is consistent with the Z-axis direction of the mobile phone gyroscope.
By way of illustration of the present embodiment: if the sector angle of the radar sector image is 45 degrees, and the sector center line of the radar sector image is overlapped with the Z axis of the mobile phone gyroscope, the sector angles on two sides of the Z axis position of the mobile phone gyroscope, namely two sides of the radar sector image center line, are 22.5 degrees respectively.
Fig. 3 is a schematic diagram of three axes of a mobile phone gyroscope according to an embodiment of the present invention, and please refer to fig. 3 for the positions of the X axis, the Y axis, and the Z axis of the mobile phone gyroscope.
Based on the above embodiment, in step S100, if it is determined that the rotation angular velocity of the mobile phone gyroscope reaches the first preset threshold, displaying the radar sector image in the target image, where the method further includes:
and acquiring the Z-axis rotating angular speed of the mobile phone gyroscope, and judging whether the Z-axis rotating angular speed reaches a first preset threshold value.
In this embodiment, it is determined whether the rotational angular velocity of the gyroscope of the mobile phone reaches a first preset threshold, and it is mainly determined whether the rotational angular velocity of the Z axis reaches the first preset threshold. Specifically, the Z-axis rotation angular velocity of the mobile phone gyroscope needs to be continuously obtained, and the Z-axis rotation angular velocity is compared with a first preset threshold value, so that whether the Z-axis rotation angular velocity reaches the first preset threshold value is judged.
Based on the above embodiment, the obtaining of the Z-axis rotation angular velocity of the mobile phone gyroscope and the determining whether the Z-axis rotation angular velocity reaches a first preset threshold further include:
acquiring all sensors in the mobile phone, and identifying whether a gyroscope sensor exists or not;
if the gyroscope sensor exists, registering the gyroscope sensor;
and acquiring a method corresponding to the change of the sensor value of the gyroscope sensor, and acquiring the rotation angular speed and/or the time value of the mobile phone gyroscope by the method corresponding to the change of the sensor value.
In the embodiment of the invention, the mobile phone gyroscope needs to be collected first when the rotation angular speed of the mobile phone gyroscope needs to be obtained. Specifically, in this embodiment, all sensors in the mobile phone are acquired, and a gyro sensor is found in all the sensors, which is to prevent an application program from being abnormal because some mobile phones are not configured with a gyro sensor. When the gyroscope sensor axis is found and the gyroscope sensor is registered, the values of the angles of the gyroscope can be obtained through the relevant class of the gyroscope sensor.
Specifically, in order to implement the above process, a developer may instantiate a management class SensorManager of the device sensor, and then globally traverse the sensors of the management class SensorManager instance of the device sensor, thereby taking all the sensors; the gyro sensor is then found among all sensors, and if present, registered. Further, the monitoring class of the sensor, such as SensorEventListener, may be inherited to implement the method corresponding to the change in the sensor value, so that the method needs to be acquired, and the method corresponding to the change in the sensor value is named onsensor changed, and the rotational angular velocity required by the embodiment of the present invention may be acquired by the onsensor changed method.
Based on the above embodiment, in step S101, the obtaining a rotation angular velocity of the mobile phone gyroscope and a current time value of the mobile phone gyroscope, and setting an angular position of the radar sector image according to the rotation angular velocity and the current time value specifically include:
s101.1, acquiring a Z-axis rotating angular speed of the mobile phone gyroscope and a current time value of the mobile phone gyroscope based on a preset time interval, and calculating a rotating angle according to the Z-axis rotating angular speed and the current time value;
s101.2, redrawing the radar sector image, and enabling the newly drawn radar sector image to rotate around the preset area and the preset point by a preset angle relative to the original radar sector image, wherein the preset angle is the rotation angle.
Specifically, to realize that the radar animation rotates along with the rotation of the mobile phone gyroscope, the rotation angle of the mobile phone gyroscope needs to be acquired in real time, and the real-time acquisition is realized through a preset time interval, namely the rotation angle of the mobile phone gyroscope is continuously acquired within a short time interval, so that a real-time effect is achieved.
Specifically, the rotation angle of the mobile phone gyroscope can be obtained by calculation according to the rotation angular velocity of the Z axis and the current time value of the gyroscope, and the calculation formula is as follows:
the rotation angle is equal to the rotation angular speed of the Z axis.
The unit of the time value of the mobile phone gyroscope is nanosecond, and the rotation angle needs to be calculated after the unit of the time value is converted, for example, the unit is converted from nanosecond to second, and the conversion ratio is 1.0f/1000000000.0 f.
After the rotation angle of the mobile phone gyroscope is obtained, the radar sector image can be redrawn according to the rotation angle of the mobile phone gyroscope, so that the central line of the radar sector image is always consistent with the Z axis of the mobile phone gyroscope, and radar animation in which the radar sector image rotates along with the rotation of the mobile phone gyroscope is realized.
Based on the above embodiment, in step S101, the obtaining a rotation angular velocity of the mobile phone gyroscope and a current time value of the mobile phone gyroscope, and setting an angular position of the radar sector image according to the rotation angular velocity and the current time value further includes:
and if the fact that the Z-axis rotating angular speed of the mobile phone gyroscope is smaller than a second preset threshold value is detected, the radar sector image is not displayed.
According to the embodiment of the invention, the radar animation is started after the rotation angular speed of the mobile phone gyroscope is increased to reach the first preset threshold value, and correspondingly, the radar animation can be stopped after the rotation angular speed of the mobile phone gyroscope is decreased to reach the second preset threshold value, namely, the radar sector image is not displayed. Generally, the difference between the second preset threshold and the first preset threshold is within a certain difference range, for example, the first preset threshold is 0.15rad/s, the second preset threshold may be 0.15rad/s, or 0.1rad/s, or 0.2rad/s, and then the difference range is 0.05rad/s, that is, the gyroscope speed when the radar animation stops may be near the gyroscope speed when the radar animation is turned on; preferably, the gyroscope speed when the radar animation is stopped is the same as the gyroscope speed when the radar animation is turned on.
In summary, the embodiment of the present invention provides a radar animation display method based on a mobile phone gyroscope, so that hardware sensor information is visually displayed in a radar animation form; the starting time of the radar animation and the sector angle of the radar sector image can be controlled, many actual requirements can be met through self-defining of the starting time and the sector angle, most requirements for the animation based on a sensor can be met, hardware information is associated with page display, and interaction is achieved well. In addition, the size of the sector of the radar animation, the specific shape of the sector, the color, and other changes may also be set according to actual needs, which is not specifically limited in the embodiment of the present invention.
Fig. 4 is a schematic diagram of a radar animation display device based on a mobile phone gyroscope according to an embodiment of the present invention, and the embodiment of the present invention further provides a radar animation display device based on a mobile phone gyroscope, including:
the radar display module 400 is configured to display a radar sector image in a target image if it is determined that the rotation angular velocity of the mobile phone gyroscope reaches a first preset threshold;
the radar rotation module 401 is configured to acquire a rotation angular velocity of the mobile phone gyroscope and a current time value of the mobile phone gyroscope, and set an angular position of the radar sector image according to the rotation angular velocity and the current time value, so that the radar sector image rotates around a predetermined area or a predetermined point in the target image, thereby implementing radar animation.
The device of the embodiment of the invention can be used for executing the technical scheme of the embodiment of the radar animation display method based on the mobile phone gyroscope shown in fig. 1, the implementation principle and the technical effect are similar, and the details are not repeated here.
Based on the above embodiments, the radar display module 400 specifically includes:
the radar drawing unit is used for drawing a radar sector image if judging that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, wherein the sector angle of the radar sector image is a preset display wide angle;
and the radar display unit is used for displaying the radar sector image in the target image, and the position of the radar sector image in the target image is related to the Z-axis position of the mobile phone gyroscope and is related to a preset area and a preset point of the target image.
Based on the above embodiment, the position of the radar sector image in the target image is related to the Z-axis position of the mobile phone gyroscope, which specifically includes:
and the fan-shaped central line of the radar fan-shaped image is consistent with the Z-axis direction of the mobile phone gyroscope.
Based on the above embodiment, if it is determined that the rotation angular velocity of the mobile phone gyroscope reaches the first preset threshold, displaying the radar sector image in the target image, the method further includes:
and acquiring the Z-axis rotating angular speed of the mobile phone gyroscope, and judging whether the Z-axis rotating angular speed reaches a first preset threshold value.
Based on the above embodiment, the obtaining of the Z-axis rotation angular velocity of the mobile phone gyroscope and the determining whether the Z-axis rotation angular velocity reaches a first preset threshold further include:
acquiring all sensors in the mobile phone, and identifying whether a gyroscope sensor exists or not;
if the gyroscope sensor exists, registering the gyroscope sensor;
and acquiring a method corresponding to the change of the sensor value of the gyroscope sensor, and acquiring the rotation angular speed and/or the time value of the mobile phone gyroscope by the method corresponding to the change of the sensor value.
Based on the above embodiment, the radar rotation module 401 specifically includes:
the angle calculation unit is used for acquiring the Z-axis rotating angular speed of the mobile phone gyroscope and the current time value of the mobile phone gyroscope based on a preset time interval, and calculating a rotating angle according to the Z-axis rotating angular speed and the current time value;
and the radar redrawing unit is used for redrawing the radar sector image, so that the newly drawn radar sector image rotates by a preset angle around the preset area or the preset point relative to the original radar sector image, and the preset angle is the rotation angle.
Based on the above embodiment, the obtaining a rotation angular velocity of the mobile phone gyroscope and a current time value of the mobile phone gyroscope, and setting an angular position of the radar sector image according to the rotation angular velocity and the current time value further includes:
and if the fact that the Z-axis rotating angular speed of the mobile phone gyroscope is smaller than a second preset threshold value is detected, the radar sector image is not displayed.
Fig. 5 is a schematic frame diagram of a radar animation display device based on a mobile phone gyroscope according to an embodiment of the present invention. Referring to fig. 5, an embodiment of the present invention provides a radar animation display device based on a mobile phone gyroscope, including: a processor (processor)510, a communication Interface (Communications Interface)520, a memory (memory)530, and a bus 540, wherein the processor 510, the communication Interface 520, and the memory 530 communicate with each other via the bus 540. Processor 510 may call logic instructions in memory 530 to perform methods comprising: if the judgment shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, displaying a radar sector image in a target image; and acquiring the rotation angular velocity of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: if the judgment shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, displaying a radar sector image in a target image; and acquiring the rotation angular velocity of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, the methods include: if the judgment shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, displaying a radar sector image in a target image; and acquiring the rotation angular velocity of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
Those of ordinary skill in the art will understand that: the implementation of the above-described apparatus embodiments or method embodiments is merely illustrative, wherein the processor and the memory may or may not be physically separate components, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a usb disk, a removable hard disk, a ROM/RAM, a magnetic disk, an optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute the method according to the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A radar animation display method based on a mobile phone gyroscope is characterized by comprising the following steps:
if the judgment shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, displaying a radar sector image in a target image;
and acquiring the rotation angular velocity of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotation angular velocity and the current time value so as to enable the radar sector image to rotate by taking a preset area or a preset point in the target image as a center, thereby realizing radar animation.
2. The method according to claim 1, wherein if it is determined that the rotation angular velocity of the mobile phone gyroscope reaches a first preset threshold, displaying a radar sector image in the target image, specifically comprising:
if the judgment result shows that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value, drawing a radar sector image, wherein the sector angle of the radar sector image is a preset display wide angle;
displaying the radar sector image in the target image, wherein the position of the radar sector image in the target image is related to the Z-axis position of the gyroscope of the mobile phone and is related to a preset area and a preset point of the target image, and the Z-axis is towards the right upper side of the mobile phone when the mobile phone is laid flat.
3. The method according to claim 2, wherein if it is determined that the rotation angular velocity of the gyroscope of the mobile phone reaches the first preset threshold, displaying the radar sector image in the target image, and before the method, further comprising:
and acquiring the Z-axis rotating angular speed of the mobile phone gyroscope, and judging whether the Z-axis rotating angular speed reaches a first preset threshold value.
4. The method according to claim 3, wherein the obtaining the Z-axis rotation angular velocity of the gyroscope of the mobile phone, and determining whether the Z-axis rotation angular velocity reaches a first preset threshold further comprise:
acquiring all sensors in the mobile phone, and identifying whether a gyroscope sensor exists or not;
if the gyroscope sensor exists, registering the gyroscope sensor;
and acquiring a method corresponding to the change of the sensor value of the gyroscope sensor, and acquiring the rotation angular speed and/or the time value of the mobile phone gyroscope by the method corresponding to the change of the sensor value.
5. The method according to any one of claims 1 to 4, wherein the acquiring a rotation angular velocity of the mobile phone gyroscope and a current time value of the mobile phone gyroscope, and setting an angular position of the radar sector image according to the rotation angular velocity and the current time value specifically comprises:
acquiring a Z-axis rotating angular speed of the mobile phone gyroscope and a current time value of the mobile phone gyroscope based on a preset time interval, and calculating a rotating angle according to the Z-axis rotating angular speed and the current time value;
and redrawing the radar sector image, so that the newly drawn radar sector image rotates by a preset angle around the preset area and the preset point relative to the original radar sector image, wherein the preset angle is the rotation angle.
6. The method of claim 1, wherein the obtaining of the rotational angular velocity of the handset gyroscope and the current time value of the handset gyroscope, and the setting of the angular position of the radar sector image according to the rotational angular velocity and the current time value, further comprises:
and if the fact that the Z-axis rotating angular speed of the mobile phone gyroscope is smaller than a second preset threshold value is detected, the radar sector image is not displayed.
7. The utility model provides a radar animation display device based on cell-phone gyroscope which characterized in that includes:
the radar display module is used for displaying a radar sector image in a target image if judging that the rotation angular speed of the mobile phone gyroscope reaches a first preset threshold value;
and the radar rotating module is used for acquiring the rotating angular speed of the mobile phone gyroscope and the current time value of the mobile phone gyroscope, and setting the angular position of the radar sector image according to the rotating angular speed and the current time value so as to enable the radar sector image to rotate by taking a preset area and a preset point in the target image as centers, thereby realizing radar animation.
8. A radar animation display device based on a mobile phone gyroscope is characterized by comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1 to 6.
CN201810421732.6A 2018-05-04 2018-05-04 Radar animation display method, device and equipment based on mobile phone gyroscope Active CN108683807B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810421732.6A CN108683807B (en) 2018-05-04 2018-05-04 Radar animation display method, device and equipment based on mobile phone gyroscope

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810421732.6A CN108683807B (en) 2018-05-04 2018-05-04 Radar animation display method, device and equipment based on mobile phone gyroscope

Publications (2)

Publication Number Publication Date
CN108683807A CN108683807A (en) 2018-10-19
CN108683807B true CN108683807B (en) 2020-12-08

Family

ID=63803028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810421732.6A Active CN108683807B (en) 2018-05-04 2018-05-04 Radar animation display method, device and equipment based on mobile phone gyroscope

Country Status (1)

Country Link
CN (1) CN108683807B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013083060A1 (en) * 2011-12-07 2013-06-13 东蓝数码股份有限公司 Data exchange system based on mobile terminal state change
CN103513788A (en) * 2013-09-13 2014-01-15 广东欧珀移动通信有限公司 Gesture recognition method and system based on gyroscope sensor and mobile terminal
CN104166464A (en) * 2013-05-17 2014-11-26 北京百度网讯科技有限公司 Method, device and portable terminal for controlling panorama display
CN104374363A (en) * 2014-10-29 2015-02-25 广东欧珀移动通信有限公司 Orientation method and device of mobile equipment
CN106648365A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Screen anti-shake method and device for three-dimensional image
CN106921796A (en) * 2017-02-13 2017-07-04 上海斐讯数据通信技术有限公司 A kind of method for controlling mobile terminal based on gyroscope

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013083060A1 (en) * 2011-12-07 2013-06-13 东蓝数码股份有限公司 Data exchange system based on mobile terminal state change
CN104166464A (en) * 2013-05-17 2014-11-26 北京百度网讯科技有限公司 Method, device and portable terminal for controlling panorama display
CN103513788A (en) * 2013-09-13 2014-01-15 广东欧珀移动通信有限公司 Gesture recognition method and system based on gyroscope sensor and mobile terminal
CN104374363A (en) * 2014-10-29 2015-02-25 广东欧珀移动通信有限公司 Orientation method and device of mobile equipment
CN106648365A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Screen anti-shake method and device for three-dimensional image
CN106921796A (en) * 2017-02-13 2017-07-04 上海斐讯数据通信技术有限公司 A kind of method for controlling mobile terminal based on gyroscope

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android高德地图小图标跟随手机旋转实现;LInghai1223;《https://jingyan.baidu.com/article/75ab0bcbb7320cd6864db205.html》;20170118;全文 *

Also Published As

Publication number Publication date
CN108683807A (en) 2018-10-19

Similar Documents

Publication Publication Date Title
US10580388B2 (en) Screen display method, apparatus and mobile terminal
US10318135B2 (en) Method for adjusting window display position, and terminal
CN107976194B (en) Environment map adjusting method and device
US10725760B2 (en) Application program uninstallation method and apparatus
EP3618006B1 (en) Image processing method and apparatus
JP2022020672A (en) Method and apparatus for processing trajectory, roadside device, cloud control platform, and computer program
US20220413637A1 (en) Method and Device for Predicting Drawn Point of Stylus
CN111708033A (en) Coordinate system calibration method and device, electronic equipment and storage medium
CN106802664A (en) A kind of flight control method and unmanned plane of unmanned plane Headless mode
CN110780738A (en) Virtual reality simulation walking method, device, equipment and readable storage medium
CN114692425A (en) Welding robot simulation method, system, equipment and medium of digital twinning technology
CN108683807B (en) Radar animation display method, device and equipment based on mobile phone gyroscope
CN108236782B (en) External equipment positioning method and device, virtual reality equipment and system
CN114913549B (en) Image processing method, device, equipment and medium
CN109738860B (en) Positioning method and device of external equipment, virtual reality head-mounted equipment and system
EP3373250A1 (en) Method and portable electronic device for changing graphics processing resolution based on scenario
EP4177724A1 (en) Facial image display method and apparatus, and electronic device and storage medium
CN112337675B (en) Spraying control method and device for spraying robot and electronic equipment
CN114296843A (en) Latency determination for human interface devices
CN113643440A (en) Positioning method, device, equipment and storage medium
CN114954654B (en) Calculation method, control method and device for zero offset compensation angle of steering wheel of vehicle
CN115056847B (en) Calculation method, control method and device for zero offset compensation angle of steering wheel of vehicle
CN109271017B (en) Control method and device for gyroscope event in iOS system
CN113026828B (en) Underwater pile foundation flaw detection method, device, equipment, storage medium and program product
US20220341737A1 (en) Method and device for navigating

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant