Intelligent magic cube three-dimensional rendering method, device and equipment and storage medium

By integrating orientation detection and a gyroscope into the Rubik's Cube charging box, the problems of independent operation and high-precision attitude estimation of the smart Rubik's Cube are solved, enabling real-time teaching feedback and multi-angle observation, thus improving the user experience.

CN120782932BActive Publication Date: 2026-02-27GUANGZHOU GANYUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510951236.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2026-02-27
Estimated Expiration
2045-07-10

AI Technical Summary

Technical Problem

Existing intelligent cube rendering technology relies on mobile device performance and network environment, cannot run independently, has low pose estimation accuracy, lacks real-time teaching feedback, has a fixed rendering perspective, and results in a poor user experience.

Method used

The Rubik's Cube charging box integrates a direction detection circuit and a gyroscope. It obtains the initial state by detecting voltage signals, calculates the attitude matrix using gyroscope data, and performs high-precision attitude tracking using a quaternion algorithm to achieve 3D rendering. It also provides real-time teaching prompts and viewpoint adjustments.

Benefits of technology

It enables independent 3D visualization of the smart Rubik's Cube, improves the accuracy of posture estimation, provides real-time teaching feedback and multi-angle observation, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782932B_ABST
    Figure CN120782932B_ABST
Patent Text Reader

Abstract

The application provides a smart magic cube three-dimensional rendering method, device, equipment and storage medium, the initial state of the smart magic cube is acquired; when the magic cube rotates, gyro data is acquired; the rotation attitude matrix of the smart magic cube is determined according to the gyro data; then, the three-dimensional model of the smart magic cube is graphically rendered according to the initial state and the rotation attitude matrix, so that the current state of the smart magic cube is visually displayed. The three-dimensional attitude calculation and the graphic rendering are integrated in the magic cube charging box, and the dependence on the external App is eliminated, so that the three-dimensional visual effect of the magic cube rotation process can be directly presented on the hardware end, and the system independence and practicability are improved. Furthermore, the integral operation is carried out by using the gyro data, the attitude change is represented by combining the quaternion, and the rotation attitude matrix is further converted, so that the gimbal lock and the error accumulation problem existing in the traditional Euler angle mode are avoided, and the high-precision continuous tracking of the attitude is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent magic cube, and particularly to an intelligent magic cube three-dimensional rendering method, device, equipment and storage medium. BACKGROUND

[0002] Magic cube is a classic space logic puzzle toy, which is widely used in entertainment, competition and education training. With the development of intelligent hardware, intelligent magic cube emerges as the times require. Through the built-in sensor (such as gyroscope, accelerometer) and communication module, the posture and operation steps of the magic cube during rotation can be recorded and analyzed in real time. At present, some intelligent magic cube supporting App can realize the display and action playback of three-dimensional model, which assists users to restore and learn.

[0003] However, the existing technology has the following problems: most of the intelligent magic cubes rely on mobile devices for rendering and interaction processing tasks, which is highly dependent on device performance and network environment, is not conducive to independent operation, and cannot obtain the initial state of the intelligent magic cube, resulting in alignment with the three-dimensional model; the Euler angle method is often used for attitude estimation, which has the problems of low precision, attitude drift and universal lock, affecting the authenticity and continuity of three-dimensional rendering; in the teaching mode, there is a lack of real-time prompt and judgment mechanism for operation steps, resulting in delayed teaching feedback and poor user experience; the rendering function is limited to a fixed perspective, and the user cannot actively switch the observation angle, affecting the understanding and immersion of operation.

[0004] Therefore, the problems in the prior art need to be solved. SUMMARY

[0005] The present application provides an intelligent magic cube three-dimensional rendering method, device, equipment and storage medium to solve the defects in the prior art, which can present the three-dimensional visualization effect of the magic cube rotation process directly on the hardware side without relying on external App.

[0006] The present application provides an intelligent magic cube three-dimensional rendering method applied to a magic cube charging box, comprising:

[0007] In response to the connection with the intelligent magic cube, the initial state of the magic cube is obtained.

[0008] When the magic cube rotates, the gyroscope data is obtained.

[0009] According to the gyroscope data, the rotation attitude matrix of the intelligent magic cube is determined.

[0010] According to the initial state of the magic cube and the rotation attitude matrix, the three-dimensional model of the intelligent magic cube is graphically rendered to visually display the current state of the intelligent magic cube.

[0011] According to the intelligent magic cube three-dimensional rendering method provided by the application, the step of obtaining the initial state of the intelligent magic cube in response to the connection with the intelligent magic cube specifically comprises:

[0012] By setting the direction detection circuit inside the magic cube charging box, the conduction state of multiple contact channels is controlled in sequence, the connection combination of the physical contact of the intelligent magic cube and the contact of the charging box is judged by detecting the voltage signal of the corresponding channel, and the overall orientation information of the magic cube is determined.

[0013] According to the intelligent magic cube three-dimensional rendering method provided by the application, the step of determining the rotation attitude matrix of the intelligent magic cube according to the gyroscope data specifically comprises:

[0014] According to the gyroscope data, the initial state of the magic cube of the intelligent magic cube is integrated and updated to obtain the current attitude quaternion;

[0015] The current attitude quaternion is converted into the rotation attitude matrix of the intelligent magic cube, and the rotation attitude matrix is used to represent the spatial attitude change of the magic cube relative to the initial state.

[0016] According to the intelligent magic cube three-dimensional rendering method provided by the application, the step of performing graphic rendering on the three-dimensional model of the intelligent magic cube according to the initial state of the magic cube and the rotation attitude matrix specifically comprises:

[0017] According to the initial state of the magic cube and the rotation attitude matrix, the three-dimensional coordinates and attitude information of each magic cube in the three-dimensional space are determined;

[0018] The three-dimensional coordinates of each magic cube are converted into two-dimensional display coordinates through perspective projection;

[0019] According to the two-dimensional display coordinates and attitude information of each magic cube, the corresponding color and boundary of the magic cube are drawn.

[0020] According to the intelligent magic cube three-dimensional rendering method provided by the application, after the step of performing graphic rendering on the three-dimensional model of the intelligent magic cube according to the initial state of the magic cube and the rotation attitude matrix, the method further comprises:

[0021] In response to the first key input of the magic cube charging box, the magic solution data is determined according to the current state of the intelligent magic cube;

[0022] According to the magic solution data, the three-dimensional model is rendered step by step, and prompt information is generated, which is used to prompt the user to rotate the intelligent magic cube from the current state to the target state.

[0023] According to the intelligent magic cube three-dimensional rendering method provided by the application, after the step of rendering the three-dimensional model according to the magic cube solution data and generating prompt information, the method further comprises:

[0024] In each teaching step, the current state of the intelligent magic cube is compared with the target state.

[0025] When the current state is consistent with the target state, the prompt information of the next teaching step is rendered.

[0026] When the current state is inconsistent with the target state, the correction prompt of the current teaching step is rendered.

[0027] According to the intelligent magic cube three-dimensional rendering method provided by the application, after the step of rendering the three-dimensional model according to the magic cube initial state and the rotation attitude matrix, the method further comprises:

[0028] In response to the second key input of the magic cube charging box, the display angle of the three-dimensional model is adjusted.

[0029] The application also provides an intelligent magic cube three-dimensional rendering device, comprising:

[0030] A state acquisition module is configured to acquire the magic cube initial state of the intelligent magic cube in response to the connection with the intelligent magic cube.

[0031] A data acquisition module is configured to acquire gyroscope data when the magic cube rotates.

[0032] A matrix determination module is configured to determine the rotation attitude matrix of the intelligent magic cube according to the gyroscope data.

[0033] A graphic rendering module is configured to perform graphic rendering on the three-dimensional model of the intelligent magic cube according to the magic cube initial state and the rotation attitude matrix, so as to visually display the current state of the intelligent magic cube.

[0034] The application also provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the intelligent magic cube three-dimensional rendering method according to any of the above when executing the program.

[0035] The application also provides a non-transitory computer readable storage medium, which stores a computer program executable by a processor, and the computer program implements the intelligent magic cube three-dimensional rendering method according to any of the above when executed by the processor.

[0036] The application also provides a computer program product, which comprises a computer program, and the computer program implements the intelligent magic cube three-dimensional rendering method according to any of the above when executed by a processor.

[0037] The application provides a smart Rubik's cube three-dimensional rendering method, device, equipment and storage medium, which comprises the following steps: obtaining an initial state of the smart Rubik's cube; obtaining gyroscope data when the Rubik's cube rotates; determining a rotation attitude matrix of the smart Rubik's cube according to the gyroscope data; and performing graphic rendering on a three-dimensional model of the smart Rubik's cube according to the initial state and the rotation attitude matrix, so as to visually display the current state of the smart Rubik's cube. The application integrates three-dimensional attitude calculation and graphic rendering in a Rubik's cube charging box, and is independent of external App, so that the three-dimensional visual effect of the Rubik's cube rotation process can be directly presented on the hardware end, and the system independence and practicability are improved. In addition, the integral operation is performed by using the gyroscope data, the attitude change is represented by combining the quaternion, and the rotation attitude matrix is further converted, so that the gimbal lock and error accumulation problems in the traditional Euler angle mode are avoided, and high-precision continuous tracking of the attitude is realized. BRIEF DESCRIPTION OF DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort.

[0039] Figure 1 It is a flowchart of the smart Rubik's cube three-dimensional rendering method provided by the application;

[0040] Figure 2 It is a Rubik's cube direction detection circuit on the Rubik's cube charging box provided by the application;

[0041] Figure 3 It is a Rubik's cube charging box interface circuit diagram of the smart Rubik's cube provided by the application;

[0042] Figure 4 It is a structural schematic diagram of the smart Rubik's cube three-dimensional rendering device provided by the application;

[0043] Figure 5 It is a structural schematic diagram of the electronic device provided by the application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical scheme and advantages of the application more clear, the technical scheme in the application will be clearly and completely described below in combination with the drawings in the application. Obviously, the described embodiments are some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative effort belong to the protection scope of the application.

[0045] To solve the problems in the prior art, the present application proposes a smart Rubik's cube three-dimensional rendering method to present the three-dimensional visualization effect of the Rubik's cube rotation process directly on the hardware side without relying on external App. The smart Rubik's cube three-dimensional rendering method is described as follows, including but not limited to the following steps: Figure 1

[0046] Step 110, in response to the connection with the smart Rubik's cube, the initial state of the smart Rubik's cube is acquired.

[0047] In this step, when the smart Rubik's cube is placed in the Rubik's cube charging box and the connection is completed, the system enters the initialization stage to determine the initial state of the Rubik's cube.

[0048] Specifically, the system starts the initial state acquisition process in response to the physical connection event with the smart Rubik's cube. At this time, the direction detection circuit inside the charging box starts to work to identify the placement orientation of the Rubik's cube as a whole. The direction detection circuit determines the specific contact combination connected by the two contacts at the bottom of the Rubik's cube by controlling the conduction state of multiple contact channels in turn, in combination with the voltage signals collected by the analog signal channels (such as CHG_ADC1 and CHG_ADC2), to determine the overall orientation of the Rubik's cube relative to the charging box.

[0049] The initial state of the Rubik's cube includes but is not limited to the posture of the Rubik's cube as a whole in space (i.e. which side is facing up, facing forward), and the coordinate system reference for subsequent rotation posture calculation. The initial state will serve as a reference basis for subsequent posture estimation and be used in cooperation with the real-time collected gyroscope data to realize dynamic tracking and three-dimensional rendering of the current state of the Rubik's cube.

[0050] Preferably, as shown in Figure 2 , Figure 3 Figure 2 is the charging box circuit, Figure 3 is the Rubik's cube internal circuit. Both of them constitute a PLC (Power Line Communication) circuit. The principle is as follows:

[0051] There are four spring needles on the charging box, as shown by J8 in Figure 2 There are two contacts on the Rubik's cube, as shown by J9 in Figure 3 ​​The four contacts on J8 will have two adjacent ones conductive if the Rubik's Cube is placed in the charging case. The direction of the Rubik's Cube can be known through the conductive contacts. The specific method is as follows: in the detection stage, the mos tube of Q2 is opened, and whether there is voltage on R15 and R19 is detected through CHG_ADC1 and CHG_ADC2. If there is voltage, it indicates that the Rubik's Cube has been placed in the charging case. For example, if there is voltage on CHG_ADC1, the 1st pin and the 2nd pin of J8 have the contacts of the Rubik's Cube, and the direction of the Rubik's Cube is known accordingly. If there is no voltage, Q2 is closed, and Q4 is opened to detect CHG_ADC1 and CHG_ADC2 in the same way.

[0052] After the direction of the Rubik's Cube is known, the Rubik's Cube can be charged, and data PLC communication can be performed during the charging process. The Rubik's Cube and the charging case support Bluetooth wireless connection, and data can be sent from the charging case to the smart Rubik's Cube. The data can be a Bluetooth MAC address or a product serial number or other unique identification code. Through Figure 1 CHG_UART1 or CHG_UART2, the power supply of the power supply is modulated. The smart Rubik's Cube receives the MAC address of the charging case, and can directly connect with the charging case or send a broadcast containing the MAC address of the charging case and wait for the charging case to connect. This method is much faster and more convenient than manually pairing Bluetooth and connecting.

[0053] Step 120, acquiring gyroscope data when the Rubik's Cube rotates.

[0054] During the user rotation operation, the gyroscope continuously outputs data reflecting the change in angular velocity (generally X, Y, Z three-axis angular velocity values). The gyroscope data can be transmitted in real time to the charging case processing unit through Bluetooth for subsequent attitude calculation and update.

[0055] Step 130, determining the rotation attitude matrix of the smart Rubik's Cube according to the gyroscope data.

[0056] In this step, the charging case processing unit uses integral method to accumulate and calculate the angular velocity based on the continuously received angular velocity data, and updates the current state of the Rubik's Cube based on the quaternion algorithm. Specifically, a unit quaternion is used as the initial value of the attitude, and the current attitude quaternion is derived according to the angular velocity; then, the quaternion is converted into a rotation attitude matrix in three-dimensional space, which can be used to describe the rotation transformation of the Rubik's Cube from the initial state to the current state.

[0057] Step 140, performing graphic rendering on the three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation attitude matrix, to visually display the current state of the smart Rubik's Cube.

[0058] In this step, the display module of the charging box or the external display device uses a rendering engine to perform graphic rendering on the three-dimensional model of the Rubik's Cube. During the rendering process, first, the initial three-dimensional position and orientation of each Rubik's Cube block is determined based on the initial state of the Rubik's Cube, then the rotation pose matrix is applied to each Rubik's Cube block to obtain its current three-dimensional coordinate transformation result. Next, the three-dimensional coordinates are mapped to two-dimensional pixel coordinates, and the block face color, edge contour, and other visual elements are drawn in combination with the current orientation information to generate a complete three-dimensional view of the Rubik's Cube, thereby realizing dynamic visual display of the current rotation state of the Rubik's Cube.

[0059] Through the above technical solution, the user can intuitively observe the rotation process and current state of the Rubik's Cube on the Rubik's Cube charging box without additional equipment, greatly improving the user experience, and being particularly suitable for application scenarios such as teaching mode, solution recording and restoration demonstration.

[0060] As a further optional embodiment, the step of obtaining the initial state of the smart Rubik's Cube in response to the connection with the smart Rubik's Cube specifically includes:

[0061] By setting a direction detection circuit inside the Rubik's Cube charging box, the conduction state of multiple contact channels is controlled in sequence, and by detecting the voltage signal of the corresponding channel, the connection combination of the physical contacts of the smart Rubik's Cube and the contacts of the charging box is determined to determine the overall orientation information of the Rubik's Cube.

[0062] In this embodiment, in order to determine the overall placement orientation of the smart Rubik's Cube in the charging box, a direction detection circuit is provided inside the Rubik's Cube charging box, which judges the overall orientation information of the Rubik's Cube by making conduction contact with the physical contacts on the smart Rubik's Cube.

[0063] As shown in the figure, four electrical contact springs are provided on the Rubik's Cube charging box to form a contact array; two metal conductive pads are provided at the bottom of the smart Rubik's Cube. When the smart Rubik's Cube is placed in the charging box, the two pads will form an electrical connection with two adjacent springs in the contact array.

[0064] During the detection process, the direction detection circuit controls the conduction state of multiple contact channels in sequence. Specifically, the MOS tube is polled to be turned on, for example, MOS tube Q2 is first turned on, and the voltage values corresponding to the respective detection resistors (such as R15, R19) are collected through analog signal channels CHG_ADC1 and CHG_ADC2. If the voltage is detected to exist, it indicates that a certain pair of specific contacts has been conduction with the pads of the Rubik's Cube, thereby determining the placement direction of the current Rubik's Cube.

[0065] If no voltage signal is detected in the channel, the MOS tube (such as Q2) of the current channel is closed, and the MOS tube (such as Q4) of the next channel is opened, and the signal is continuously collected through CHG_ADC1 and CHG_ADC2 for the next round of conduction detection.

[0066] Through the above polling detection process, the system can identify the specific contact combination connected by the two contacts at the bottom of the magic cube, so as to infer the overall orientation of the magic cube relative to the charging box. For example, if the conduction contacts are 1 and 2, it indicates that a certain face of the magic cube is oriented forward; if the conduction contacts are 2 and 3, it indicates another orientation.

[0067] The direction detection circuit does not need to rely on the state of the internal corner pieces or edge pieces of the magic cube, but can reliably determine the placement direction of the magic cube only through the contact combination of the fixed structure at the bottom of the intelligent magic cube and the charging box, thereby providing an accurate reference direction for the initialization of the subsequent rotation posture.

[0068] As a further optional embodiment, the step of determining the rotation posture matrix of the intelligent magic cube according to the gyroscope data specifically comprises:

[0069] integrating and updating the initial state of the magic cube according to the gyroscope data to obtain a current attitude quaternion;

[0070] converting the current attitude quaternion into a rotation posture matrix of the intelligent magic cube, and the rotation posture matrix is used to represent the spatial attitude change of the magic cube relative to the initial state.

[0071] In this embodiment, a gyroscope module is arranged in the intelligent magic cube, which is used to collect the angular velocity data of the magic cube in the rotation process in real time. The angular velocity data is a three-axis angular velocity vector (ωx, ωy, ωz) with a unit of rad / s.

[0072] The control unit performs time integration on the angular velocity data to estimate the angular displacement per unit time. On this basis, the Euler method, the improved Euler method or the fourth-order Runge-Kutta (RK4) method is used to recursively update the quaternion Q = [w, x, y, z] representing the attitude to obtain the attitude quaternion at the current time. The quaternion updating process ensures the numerical stability and spatial consistency in the continuous rotation state, effectively avoiding the "gimbal lock" problem of traditional Euler angles in large-angle rotation.

[0073] Then, the updated current attitude quaternion is converted into a rotation posture matrix R, which is a 3x3 direction cosine matrix representing the overall spatial rotation relationship of the current magic cube relative to the initial state. The rotation posture matrix is used for subsequent three-dimensional graphic rendering, ensuring that the visual posture of the magic cube model on the screen accurately reflects its real physical state.

[0074] As a further optional embodiment, the step of rendering a three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation pose matrix specifically comprises:

[0075] According to the initial state of the Rubik's Cube and the rotation pose matrix, the three-dimensional coordinates and pose information of each Rubik's Cube block in three-dimensional space are determined;

[0076] The three-dimensional coordinates of each Rubik's Cube block are converted into two-dimensional display coordinates through perspective projection;

[0077] According to the two-dimensional display coordinates and pose information of each Rubik's Cube block, the corresponding color and boundary of the Rubik's Cube block are drawn.

[0078] In this embodiment, according to the relative positions and orientations of each Rubik's Cube block (including corner blocks, edge blocks and center blocks) recorded in the initial state of the Rubik's Cube, combined with the rotation pose matrix calculated in step 130, the spatial transformation of each Rubik's Cube block is performed to obtain the real-time three-dimensional coordinates and pose information of the Rubik's Cube block in the three-dimensional world coordinate system. The pose information includes the orientation and position relationship of the Rubik's Cube block face, which is used to accurately restore the real Rubik's Cube movement.

[0079] Then, a three-dimensional perspective projection algorithm is used to convert the above three-dimensional space coordinates into two-dimensional screen coordinates. The projection process can be based on the screen resolution and viewing angle parameters (such as FOV, near and far clipping planes, etc.) of the current display device to construct a projection matrix, realize the mapping conversion from 3D to 2D, and combine the viewport transformation to position the conversion result on the graphical interface.

[0080] Finally, according to the two-dimensional display coordinates and pose information of each Rubik's Cube block, the corresponding color map and boundary contour of the block are drawn. Among them, the color is determined according to the initial state and the current orientation of the Rubik's Cube; the boundary drawing is used to enhance the visual structure and user recognition. Anti-aliasing and double buffering mechanism can be used in the rendering process to improve the display quality and frame rate stability, and realize high real-time three-dimensional rendering effect.

[0081] In the process of rendering a three-dimensional model of the smart Rubik's Cube, the method further comprises performing adaptive perspective projection, specifically comprising the following steps:

[0082] Adaptive field of view calculation:

[0083] According to the actual size and resolution of the LCD display area, the appropriate field of view (Field of View, FOV) is dynamically calculated to maintain the stability of the model display ratio and the accuracy of spatial perception.

[0084] Z-buffer depth optimization:

[0085] In the establishment of perspective projection matrix, combined with the three-dimensional depth information (Z axis direction distance) of the magic cube, the parameters of the near plane and the far plane are adjusted, so as to optimize the occlusion relationship and the near-far level of each part of the model, and avoid visual errors.

[0086] Viewport transformation and screen mapping:

[0087] The vertex coordinates in the projected three-dimensional coordinate system are converted into physical pixel points on the LCD screen through viewport transformation, realizing accurate mapping of three-dimensional data to two-dimensional display.

[0088] Double buffering mechanism display refresh:

[0089] The projection engine adopts a double buffering mechanism to complete the switching of the frame buffer during vertical blanking (V-Sync), ensuring that the image rendering process is tear-free and flicker-free, and improving visual stability and user experience.

[0090] As a further optional embodiment, after the step of rendering the three-dimensional model of the smart Rubik's cube according to the initial state of the Rubik's cube and the rotation attitude matrix, the method further comprises:

[0091] In response to the first key input of the Rubik's cube charging box, the Rubik's cube solution data is determined according to the current state of the smart Rubik's cube;

[0092] According to the Rubik's cube solution data, the three-dimensional model is rendered step by step, and a prompt information is generated, which is used to prompt the user to rotate the smart Rubik's cube from the current state to the target state.

[0093] When the first key input signal is detected on the Rubik's cube charging box, the system triggers the teaching mode logic. In response to the input, the processor calls a solving module from a preset Rubik's cube solution algorithm library according to the current rendered smart Rubik's cube attitude, and calculates a set of solution step sequence with the current Rubik's cube state as input. The solution data is used to restore the Rubik's cube from the current disordered state to the standard state.

[0094] Subsequently, the three-dimensional Rubik's cube model is dynamically rendered according to the Rubik's cube solution data. Each rendering corresponds to a Rubik's cube rotation operation, such as "U'", "R", "F2" and other standard actions, which are demonstrated in the form of animation in the three-dimensional interface.

[0095] At the same time, the system generates corresponding graphical prompt information for guiding the user how to operate the real Rubik's cube. The prompt information can include arrow direction, face color identification, action number, etc., and can also prompt the user with specific operations such as "please rotate the upper layer clockwise by one step" through text or voice, to realize interactive teaching guidance.

[0096] The embodiment significantly improves the learning experience of the user, and is particularly suitable for beginners to understand the Rubik's Cube restoration logic, and has good teaching auxiliary effect and user guiding ability.

[0097] As a further optional embodiment, after the step of rendering the three-dimensional model according to the Rubik's Cube solution data and generating prompt information according to the steps, the method further comprises:

[0098] In each teaching step, the current state of the smart Rubik's Cube is compared with the target state.

[0099] When the current state is consistent with the target state, the prompt information of the next teaching step is rendered.

[0100] When the current state is inconsistent with the target state, the correction prompt of the current teaching step is rendered.

[0101] In each teaching step, the system monitors the actual rotation of the smart Rubik's Cube in real time, obtains the current state matrix, and compares the pose with the target state corresponding to the teaching step. The comparison operation includes accurate matching of the overall direction of the Rubik's Cube and the face block state involved in the current teaching step.

[0102] When it is detected that the current state is consistent with the target state, it indicates that the user has completed the teaching action, and the system automatically enters the next teaching step and updates the prompt information and the three-dimensional model state to continue guiding the user to perform the next operation.

[0103] Conversely, when there is a deviation between the current state and the target state, the system remains in the current teaching step, and generates correction prompt information according to the difference between the current state and the target state. The correction prompt information can include suggested rotation direction, angle correction, and error operation reminder, etc., for guiding the user to return the physical Rubik's Cube to the expected state, so as to keep the teaching rhythm accurate.

[0104] Through the embodiment, the system realizes dynamic error correction and rhythm control of user operation behavior, improves the accuracy and intelligence of teaching interaction, enhances the feedback and correction ability of the user in the learning process, and further improves the auxiliary teaching effect of the smart Rubik's Cube.

[0105] As a further optional embodiment, after the step of rendering the three-dimensional model according to the Rubik's Cube initial state and the rotation pose matrix, the method further comprises:

[0106] In response to a second button input of the Rubik's Cube charging box, the display perspective of the three-dimensional model is adjusted.

[0107] In this embodiment, in response to a second key input of the magic cube charging box, the display angle of the three-dimensional model is adjusted according to the control instruction of the key, so that the user can observe the current three-dimensional posture of the smart magic cube from different angles.

[0108] Specifically, the second key can include a plurality of preset keys, each key corresponding to a view angle adjustment mode, such as rotating around the X, Y, and Z axes by a certain angle, or switching to a top view, a front view, an oblique side view, and the like. The system adjusts the virtual camera viewpoint or projection parameters according to the key code, thereby changing the presentation of the three-dimensional model on the screen.

[0109] This embodiment allows the user to actively adjust the observation angle, thereby more intuitively understanding the magic cube state and spatial rotation logic during teaching, demonstration, or restoration, and improving the interactive experience and spatial perception ability.

[0110] The smart magic cube three-dimensional rendering device provided by the present application is described below, as shown in Figure 4 The smart magic cube three-dimensional rendering device described below can be correspondingly referred to the smart magic cube three-dimensional rendering method described above.

[0111] A smart magic cube three-dimensional rendering device comprises:

[0112] A state acquisition module 410 is configured to acquire an initial state of a magic cube of the smart magic cube in response to a connection with the smart magic cube;

[0113] A data acquisition module 420 is configured to acquire gyroscope data when the magic cube rotates;

[0114] A matrix determination module 430 is configured to determine a rotation posture matrix of the smart magic cube according to the gyroscope data;

[0115] A graphics rendering module 440 is configured to perform graphics rendering on a three-dimensional model of the smart magic cube according to the initial state of the magic cube and the rotation posture matrix, so as to visually display the current state of the smart magic cube.

[0116] Figure 5 An example of an electronic device is shown in Figure 5 The electronic device can include a processor 510, a communications interface 520, a memory 530, and a communications bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communications bus 540. The processor 510 can invoke the logic instructions in the memory 530 to execute the smart magic cube three-dimensional rendering method, which comprises:

[0117] in response to the connection with the smart Rubik's Cube, obtaining an initial state of the smart Rubik's Cube;

[0118] when the Rubik's Cube is rotated, obtaining gyroscope data;

[0119] determining a rotation attitude matrix of the smart Rubik's Cube according to the gyroscope data;

[0120] performing graphic rendering on a three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation attitude matrix, to visually display a current state of the smart Rubik's Cube.

[0121] In addition, the logic instructions in the memory 530 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0122] On the other hand, the present application also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, the computer can execute the smart Rubik's Cube three-dimensional rendering method provided by the above-mentioned method, the method includes:

[0123] in response to the connection with the smart Rubik's Cube, obtaining an initial state of the smart Rubik's Cube;

[0124] when the Rubik's Cube is rotated, obtaining gyroscope data;

[0125] determining a rotation attitude matrix of the smart Rubik's Cube according to the gyroscope data;

[0126] performing graphic rendering on a three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation attitude matrix, to visually display a current state of the smart Rubik's Cube.

[0127] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the intelligent Rubik's Cube three-dimensional rendering method provided by the above method, the method comprising:

[0128] In response to the connection with the intelligent Rubik's Cube, obtaining an initial state of the intelligent Rubik's Cube;

[0129] When the Rubik's Cube is rotated, obtaining gyroscope data;

[0130] According to the gyroscope data, determining a rotation attitude matrix of the intelligent Rubik's Cube;

[0131] According to the initial state of the Rubik's Cube and the rotation attitude matrix, performing graphic rendering on a three-dimensional model of the intelligent Rubik's Cube to visually display the current state of the intelligent Rubik's Cube.

[0132] The device embodiments described above are only schematic, wherein the units illustrated as separate components can or can not be physically separate, and the components illustrated as units can or can not be physical units, i.e., can be located in one place or distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement without creative labor.

[0133] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software plus necessary universal hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0134] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A smart Rubik's cube three-dimensional rendering method, characterized in that, The method applied to the Rubik's Cube charging box comprises the following steps: In response to the connection with the smart Rubik's Cube, the initial state of the smart Rubik's Cube is acquired; When the Rubik's Cube rotates, the gyroscope data is acquired; According to the gyroscope data, the rotation attitude matrix of the smart Rubik's Cube is determined; According to the initial state of the Rubik's Cube and the rotation attitude matrix, the three-dimensional model of the smart Rubik's Cube is graphically rendered to visually display the current state of the smart Rubik's Cube; The step of acquiring the initial state of the smart Rubik's Cube in response to the connection with the smart Rubik's Cube specifically comprises: Through the direction detection circuit arranged inside the Rubik's Cube charging box, the conduction state of multiple contact channels is controlled in sequence, the connection combination of the physical contact of the smart Rubik's Cube and the contact of the charging box is judged by detecting the voltage signal of the corresponding channel, and the overall orientation information of the Rubik's Cube is determined.

2. The smart Rubik's cube three-dimensional rendering method according to claim 1, wherein, The step of determining the rotation attitude matrix of the smart Rubik's Cube according to the gyroscope data specifically comprises: According to the gyroscope data, the initial state of the smart Rubik's Cube is integrated and updated to obtain the current attitude quaternion; The current attitude quaternion is converted into the rotation attitude matrix of the smart Rubik's Cube, and the rotation attitude matrix is used to represent the spatial attitude change of the Rubik's Cube relative to the initial state.

3. The smart Rubik's cube three-dimensional rendering method of claim 1, wherein, The step of graphically rendering the three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation attitude matrix specifically comprises: According to the initial state of the Rubik's Cube and the rotation attitude matrix, the three-dimensional coordinates and attitude information of the smart Rubik's Cube in the three-dimensional space are determined; The three-dimensional coordinates of each Rubik's Cube block are converted into two-dimensional display coordinates through perspective projection; According to the two-dimensional display coordinates and attitude information of each Rubik's Cube block, the corresponding color and boundary of the Rubik's Cube block are drawn.

4. The smart Rubik's cube three-dimensional rendering method of claim 1, wherein, After the step of graphically rendering the three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation attitude matrix, the method further comprises: In response to the first key input of the Rubik's Cube charging box, the solution data of the smart Rubik's Cube is determined according to the current state of the smart Rubik's Cube; According to the solution data of the Rubik's Cube, the three-dimensional model is rendered step by step, and prompt information is generated, which is used to prompt the user to rotate the smart Rubik's Cube from the current state to the target state.

5. The smart Rubik's cube three-dimensional rendering method according to claim 4, wherein, After the step of rendering the three-dimensional model step by step according to the solution data of the Rubik's Cube and generating prompt information, the method further comprises: In each teaching step, the current state of the smart Rubik's Cube is compared with the target state; When the current state is consistent with the target state, the prompt information of the next teaching step is rendered; When the current state is inconsistent with the target state, the correction prompt of the current teaching step is rendered.

6. The smart Rubik's cube three-dimensional rendering method of claim 1, wherein, After the step of graphically rendering the three-dimensional model of the smart Rubik's Cube according to the initial state of the Rubik's Cube and the rotation attitude matrix, the method further comprises: In response to the second key input of the Rubik's Cube charging box, the display perspective of the three-dimensional model is adjusted.

7. An intelligent Rubik's cube three-dimensional rendering device, characterized in that, The method applied to the Rubik's Cube charging box comprises the following steps: A state acquisition module is configured to acquire the initial state of the smart Rubik's Cube in response to the connection with the smart Rubik's Cube; The data acquisition module is configured to acquire the gyroscope data when the magic cube rotates. The matrix determination module is configured to determine a rotation attitude matrix of the smart magic cube according to the gyroscope data. The graphic rendering module is configured to perform graphic rendering on a three-dimensional model of the smart magic cube according to the initial state of the magic cube and the rotation attitude matrix, and to visually display the current state of the smart magic cube. The step of acquiring the initial state of the smart magic cube in response to the connection with the smart magic cube specifically includes: The direction detection circuit arranged inside the magic cube charging box is configured to sequentially control the conduction states of multiple contact channels, and to determine the overall orientation information of the magic cube by detecting the connection combination of the physical contacts of the smart magic cube and the contacts of the charging box through the detection of the voltage signals of the corresponding channels.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the smart magic cube three-dimensional rendering method according to any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the smart magic cube three-dimensional rendering method according to any one of claims 1 to 6.