The interconnection and digitization of the physical world has increased dramatically with the widespread deployment of network communication and the rapid development of the Internet of Things (IoT). Application scenarios and requirements in IoT are more complex and diverse than ever before. To successfully support the design and development of complex IoT systems, a realistic evaluation platform that can accurately simulate both the physical world and network communications is necessary. Yet, most existing simulation tools are limited, simulating only specific subsets of IoT environments, such as communication network simulation or mobility simulation, rather than complete IoT scenarios. Thus, in this paper, we propose a new framework, in which several modules can work together to achieve more realistic simulation of IoT environments. Specifically, we integrate three-dimensional object motion with the OMNET++ network simulator. In our framework, we can configure and direct object movement in 3D and compute the received power of transmitted signals using ray tracing techniques. Within the framework, OMNET++ simulates the communication process based on the received power and communication protocol. As a demonstration of our framework, we conduct several experiments on two classic Internet of Vehicles (IoV) scenarios. The results indicate that our proposed framework can accurately simulate both the physical and communication aspects of IoT systems.