A driving simulator is a combination of hardware and software that enables the user to navigate through a real-time computer-generated virtual driving environment. Driving simulators are very valuable for conducting driving studies that are infeasible or unethical to conduct on the road. For studies that can be conducted in the real world, driving simulators provide a more cost effective solution and allow a much higher degree of flexibility in terms of changing the conditions of the environment for experimental purposes. The corner stone when conducting any study on the driving simulator is the construction of a virtual driving environment that serves the purposes of this study. Even though driving environments can considerably vary between different studies, they all share the presence of common components that exist throughout the environment like roads, traffic signs and other components. The objective of this paper is to present the design of an object-oriented library that facilitates the construction of virtual driving environments when conducting studies on a driving simulator. The proposed library uses object orientation to hide implementation details from the designer of the environment which results in making the construction of such environments easier and more productive as well as their modification later if needed. The proposed library is based on the Java programming language and on Java 3D technology which makes it portable and usable on any platform that has an implementation of these two technologies.