The invention discloses a cube rod mechanism achieving space three-freedom-degree class ball joint rotation through liner driving, and belongs to the technical field of robots. The cube rod mechanism comprises an X-axis first rigid body a1, an X-axis second rigid body a2, an X-axis third rigid body a3, an X-axis fourth rigid body a4, a Y-axis first rigid body c1, a Y-axis second rigid body c2, a Y-axis third rigid body c3, a Y-axis fourth rigid body c4, a Z-axis first rigid body b1, a Z-axis second rigid body b2, a Z-axis third rigid body b3, a Z-axis fourth rigid body b4, a first base d1, a second base d2, an auxiliary rigid body e1, a first telescopic rod La, a second telescopic rod Lb and a third telescopic rod Lc. The cube rod mechanism is simple in structure, strong in decoupling performance, and simple, clear and reliable in motion.