This paper presents a new method for public and blind watermarking of 3D objects and hiding information of various types in virtual reality and augmented reality environments. In particular, the virtual scene is transformed to a tree-based model using constructive solid geometry (CSG). The tree of the virtual 3D objects is composed of nodes and leafs. Each tree node contains a set operator (union, intersection or difference) whereas the tree leafs consist of geometric primitives such as spheres, cylinders and cubes. The proposed method allows embedding invisible watermarks that can hide different security information types. The proposed method ensures unlimited capacity and absolute invisibility of the hidden information with robustness to affine transformations. Thanks to these unique properties, it is possible to implement all the security infrastructures needed for a virtual and augmented reality system. Finally, the performances of the proposed method are shown using 3D models of different types and scenes.