Numerous cosmological simulations have been performed to study the formation of the first objects. We present the results of high-resolution 3D cosmological simulations of the formation of primordial objects using the adaptive mesh refinement code flash by including in an approximate manner the radiative transfer effects of Lyman α photons. We compare the results of a Lyman α trapping case inside gas clouds with atomic and molecular hydrogen cooling cases. The principal objective of this research is to follow the collapse of a zero metallicity halo with an effective equation of state (that accounts for the trapping) and to explore the fate of a halo in each of the three cases, specifically the impact of thermodynamics on the fragmentation of haloes. Our results show that in the case of Lyman α trapping, fragmentation is halted and a massive object is formed at the centre of a halo. The temperature of the gas remains well above 104 K and the halo is not able to fragment to stellar masses. In the atomic cooling case, gas collapses into one or two massive clumps in contrast to the Lyman α trapping case. For the molecular hydrogen cooling case, gas cools efficiently and fragments. The formation of massive primordial objects is thus strongly dependent on the thermodynamics of the gas. A salient feature of our results is that for the formation of massive objects, e.g. intermediate-mass black holes, feedback effects are not required to suppress H2 cooling, as molecular hydrogen is collisionally dissociated at temperatures higher than 104 K as a consequence of Lyman α trapping.