The LEGO MINDSTORMS(TM) toolkit can be used to help students learn basic programming and engineering concepts. The ROBOLAB(TM) software is widely used to program LEGO MINDSTORMS robotics in its icon-based programming environment. However, this software does not provide debug features for LEGO MINDSTORMS programs. Users cannot test the program before downloading it into LEGO robotics hardware. This book introduces a simulator to simulate the motions of LEGO robotics in a virtual 3D environment. The simulator uses ODE (Open Dynamic Engine) and OpenGL, combined with ROBOLAB. It can track and display program execution as the simulation runs. An introduction to the overall structure and architecture of the simulator is given and is followed by a detailed description of each component in the system. The discussions based on several test results are then given. This leads to the conclusion that the simulator is able to accurately represent the actions of robots under certain assumptionsand conditions. This work should help users to understand basic robotic simulation concepts, especially for those users who are working with LEGO MINDSTORMS.