A digital instrument animation control method
By generating preset curves and calculating track points, the problem of unsmooth digital instrument animation is solved, the delicate animation effect is achieved, and the display quality is improved.
Patent Information
- Application Number
- CN202210095165.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-01-26
AI Technical Summary
The pointer animation effect of existing digital instruments is not as smooth and delicate as that of mechanical instruments, affecting the display effect and product level.
By generating a preset curve that controls digital instrument animation, obtaining playback parameters, determining the number of track points and unit vectors, calculating the y-coordinate value, and drawing the instrument animation sequence diagram to achieve delicate and smooth animation effects.
It realizes the delicate and smooth digital instrument animation, improves the display effect, and reflects the grade of the product.
Smart Images

Figure CN114549705B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital instruments, and in particular to a digital instrument animation control method. Background Art
[0002] With the continuous advancement of automotive electronics, digital instruments will gradually replace traditional mechanical instruments and become the mainstream of future automotive instrumentation. Digital instruments offer a wide variety of dial shapes, can be customized by customers or users, and can be changed to different themes, making them highly appealing to young people who value individuality. However, due to differences in the implementation principles of digital instruments compared to mechanical instruments, the pointer animation effects of existing digital instruments are often not as smooth and detailed as those of mechanical instruments. Excellent instrument animations should have delicate and smooth curves.
[0003] Therefore, the animation of the digital instrument dial is a very important display effect, which reflects the grade of the product. Summary of the Invention
[0004] The present invention provides a digital instrument animation control method, which aims to solve the defects in the prior art and achieve delicate and smooth movement of the digital instrument and good display effect.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] The present invention provides a digital instrument animation control method, comprising:
[0007] Step 1: Generate a preset curve for controlling the animation of a digital instrument;
[0008] Step 2: Get the playback parameters of the instrument animation;
[0009] Step 3: determining the number of track points of the instrument animation according to the playback parameters;
[0010] Step 4: Determine the unit vector of each trajectory point according to the number of trajectory points;
[0011] Step 5: Calculate the y-coordinate value of each trajectory point on the preset curve using a second preset formula based on the unit vector of each trajectory point and the coefficient of each control point;
[0012] Step 6: Determine the drawing parameters of the instrument animation sequence diagram;
[0013] Step 7: Read the instrument animation sequence diagram according to the drawing parameters and draw the instrument animation trajectory.
[0014] Specifically, the step 1 includes:
[0015] Step 101: Initialize the parameters of each control point of the preset curve;
[0016] Step 102: Determine the coefficient of each control point;
[0017] Step 103: Generate the preset curve according to the parameters and coefficients of each control point.
[0018] Specifically, the step 101 includes: initializing each control point by calling the preset curve initialization function.
[0019] Specifically, step 102 includes: calculating the coefficient of each control point using a first preset formula, where the first preset formula is:
[0020]
[0021] Wherein, C(k) represents the coefficient of each control point, n represents the number of control points, and k represents the sequence number of each control point.
[0022] Specifically, the step 2 includes: obtaining instrument animation playback parameters by calling a parameter setting function.
[0023] Specifically, m=T / Δt, where m represents the number of trajectory points, T represents the total duration of the animation, and Δt represents the animation frame interval.
[0024] Specifically, u(i)=i / m, where u(i) represents the unit vector of each trajectory point, and i=1, 2, 3…m represents the sequence number of each trajectory point.
[0025] Specifically, the second preset formula is:
[0026]
[0027] Among them, y[i] represents the y coordinate value of each trajectory point on the preset curve, y k represents the y-coordinate value of the kth control point, u(i) represents the unit vector of each trajectory point, and C(k) represents the coefficient of each control point.
[0028] Specifically, step 6 includes: calculating the drawing parameters of the instrument animation sequence diagram according to a third preset formula, and the third preset formula is:
[0029] y(i)=y_0+(y_1-y_0)*y[i]
[0030] Among them, y(i) represents the drawing parameters of the instrument animation sequence diagram; y_0 represents the starting point of the animation, and y_1 represents the end point of the animation.
[0031] The beneficial effects of the present invention are as follows: the present invention generates a preset curve for controlling the animation of a digital instrument, obtains the playback parameters of the instrument animation, and determines the unit vector of each trajectory point, thereby calculating the y-coordinate value of each trajectory point on the preset curve, and then calculating the drawing parameters of the instrument animation sequence diagram, and finally drawing the animated instrument animation sequence diagram according to the time driving parameters, thereby achieving delicate and smooth digital instrument movements and good display effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flow chart of the digital instrument animation control method of the present invention;
[0033] Figure 2 It is a schematic diagram of the preset curve of the present invention. DETAILED DESCRIPTION
[0034] The following describes the embodiments of the present invention in detail with reference to the accompanying drawings, which are for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention.
[0035] like Figure 1 As shown, this embodiment provides a digital instrument animation control method, including:
[0036] Step 1: Generate a preset curve for controlling the animation of the digital instrument.
[0037] In this embodiment, step 1 includes:
[0038] Step 101: Initialize the parameters of each control point of the preset curve.
[0039] like Figure 2 As shown, in the embodiment, the digital instrument animation song starts from the starting control point P0 and ends at the ending control point Pn-1, and the shape of the curve is determined by each control point Pk (k=0, 2, 3...n-1).
[0040] In this embodiment, step 101 includes initializing each control point by calling the preset curve initialization function.
[0041] Step 102: Determine the coefficient of each control point.
[0042] In this embodiment, step 102 includes: calculating the coefficient of each control point using a first preset formula, where the first preset formula is:
[0043]
[0044] Wherein, C(k) represents the coefficient of each control point, n represents the number of control points, and k represents the sequence number of each control point.
[0045] Step 103: Generate the preset curve according to the parameters and coefficients of each control point.
[0046] In this embodiment, the preset curve includes but is not limited to a Bezier curve.
[0047] Step 2: Get the playback parameters of the instrument animation.
[0048] In this embodiment, the playback parameters include: animation start point y_0, animation end point y_1, animation total duration T, and animation frame interval Δt.
[0049] In this embodiment, step 2 includes: obtaining instrument animation playback parameters by calling a parameter setting function.
[0050] Step 3: Determine the number of track points of the instrument animation according to the playback parameters.
[0051] In this embodiment, m=T / Δt, where m represents the number of trajectory points, T represents the total duration of the animation, and Δt represents the animation frame interval.
[0052] For example, if the total animation duration T = 1 second and the frame interval Δt = 10 ms, the number of trajectory points of the animation m = 100. In other words, the preset curve generated in step 1 is approximated by these 100 trajectory points.
[0053] Step 4: Determine the unit vector of each trajectory point according to the number of trajectory points.
[0054] In this embodiment, u(i)=i / m, where u(i) represents the unit vector of each trajectory point, and i=1, 2, 3...m represents the sequence number of each trajectory point.
[0055] Step 5: Calculate the y-coordinate value of each trajectory point on the preset curve using a second preset formula based on the unit vector of each trajectory point and the coefficient of each control point.
[0056] In this embodiment, the second preset formula is:
[0057]
[0058] Among them, y[i] represents the y coordinate value of each trajectory point on the preset curve, y k represents the y-coordinate value of the kth control point, u(i) represents the unit vector of each trajectory point, and C(k) represents the coefficient of each control point.
[0059] Step 6: Determine the drawing parameters of the instrument animation sequence diagram.
[0060] In this embodiment, step 6 includes: calculating the drawing parameters of the instrument animation sequence diagram according to a third preset formula, and the third preset formula is:
[0061] y(i)=y_0+(y_1-y_0)*y[i]
[0062] Among them, y(i) represents the drawing parameters of the instrument animation sequence diagram; y_0 represents the starting point of the animation, and y_1 represents the end point of the animation.
[0063] Step 7: Read the instrument animation sequence diagram according to the drawing parameters and draw the instrument animation trajectory.
[0064] In this embodiment, the drawing of the instrument animation sequence diagram (ie, the trajectory) is achieved by calling a drawing callback and executing the drawing action in the drawing callback.
[0065] The above instrument animation solution can be used in scenes such as the rotation of the pointer of a digital instrument.
[0066] The above disclosure is only a preferred embodiment of the present invention and cannot be used to limit the scope of protection of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.
Claims
1. A digital instrument animation control method, characterized in that: include: Step 1: Generate a preset curve for controlling the animation of a digital instrument; Step 2: Get the playback parameters of the digital instrument animation; Step 3: determining the number of trajectory points of the digital instrument animation according to the playback parameters; Step 4: Determine the unit vector of each trajectory point according to the number of trajectory points; Step 5: Calculate the y-coordinate value of each trajectory point on the preset curve using a second preset formula based on the unit vector of each trajectory point and the coefficient of each control point; Step 6: Determine the drawing parameters of the digital instrument animation sequence diagram; Step 7: Read the digital instrument animation sequence diagram according to the drawing parameters and draw the digital instrument animation trajectory; The step 1 comprises: Step 101: Initialize the parameters of each control point of a preset curve, where the preset curve is a Bezier curve; Step 102: Determine the coefficient of each control point; Step 103: Generate the preset curve according to the parameters and coefficients of each control point; The second preset formula is: Wherein, y[i] represents the y coordinate value of each trajectory point on the preset curve, y k represents the y-coordinate value of the k-th control point, u(i) represents the unit vector of each trajectory point, and C(k) represents the coefficient of each control point; The step 6 includes: calculating the drawing parameters of the digital instrument animation sequence diagram according to a third preset formula, wherein the third preset formula is: Where y(i) represents the drawing parameters of the digital instrument animation sequence diagram; y_0 represents the starting point of the animation, and y_1 represents the end point of the animation.
2. The digital instrument animation control method according to claim 1, characterized in that: The step 101 includes: initializing each control point by calling the preset curve initialization function.
3. The digital instrument animation control method according to claim 1, characterized in that: The step 102 includes: calculating the coefficients of each control point using a first preset formula, wherein the first preset formula is: Wherein, C(k) represents the coefficient of each control point, n represents the number of control points, and k represents the sequence number of each control point.
4. The digital instrument animation control method according to claim 1, characterized in that: The step 2 includes: obtaining instrument animation playback parameters by calling a parameter setting function.
5. The digital instrument animation control method according to claim 1, characterized in that: m=T / Δt, where m represents the number of trajectory points, T represents the total animation duration, and Δt represents the animation frame interval.
6. The digital instrument animation control method according to claim 5, characterized in that: u(i)=i / m, where u(i) represents the unit vector of each trajectory point, and i=1,2,3…m represents the sequence number of each trajectory point.
Citation Information
Patent Citations
Vehicle state presenting method and device
CN110239437A
Construction method and detection method for deep learning network of pointer instrument and system thereof
CN110866440A