Ontologies are widely used as a tool for representing knowledge in Artificial Intelligence more specifically in qualitatively knowledge representation and reasoning, for example, to represent concepts and their relationships. On the other hand, virtual reality has several applications in different fields: such as in medical systems, computer-aided design and education as a virtual learning environment. In both cases, qualitative representations are necessary to perform any qualitative reasoning task. In this paper, we see VRML and Java 3D. Which are formal languages are used to describe objects in 3D. We analyze the similarities between them to define an application ontology with the aim to represent virtual reality environments, independently of the programming language. Then a spatial ontology is defined to describe topological, directional and metric relation which can be used to describe the basic operations in a 3D scene to build a complex environment. Finally, these two ontologies are seen that can be constructed independently but integrated together whether needed.