Direct numerical simulations (DNS) of Rayleigh-Bénard convection in a cube and a cylinder with equal diameter and height are performed to investigate the main responses of the system, namely heat flux and motion. Differences in the latter two quantities for the two geometries suggest a transition between different flow states in the cube, which is not observed in the cylinder due to its rotational symmetry. A method is introduced to analyse the flow dynamics in the cube, which relies on the temperature distribution at the lateral walls. It reveals that above a certain Rayleigh number the global flow structure in the cube is organized in a diagonal manner and not longer parallel to the walls, which leads to differences in the heat flux and the kinetic energy in the cylindrical and the cubic sample.