Aller au contenu

3D Objects

When we talk about a 3D object, we are talking about an entity with, at least, a position, an orientation and a size, in space. The 3D object is not necessarily visible and is not necessarily a volumetric representation. Indeed the 3D object can take very diverse forms: light, empty object, mesh object, group of objects, complete scene, point cloud etc.

Unity GameObject

The 3D object will create an Unity GameObject and be linked to it. The GameObject will be destroyed when the 3D object is destroyed.

Properties of an object

In addition to positions, rotations and scale, a 3D object has 3 optional parameters that can be modified depending on the type:

  • Receive shadows
  • Project shadows
  • Use a collision

Properties and type of 3D object

Depending on the type of 3D object other parameters are available.

Empty objects

Empty objects are objects that have no representation in 3D space. However, even without a visual these objects are very important. Indeed, they allow to organize the structure of the tree and are essential for the hierarchical structuring of a scene.

Object hierarchy

Most 3D objects in VRmaze have a list of children of 3D objects. It is thus possible to structure the 3D scene hierarchically. The interests are multiple, the first concerns object transformations: a transformation, such as a change in position, on a 3D object will produce by a cascade effect the same change on the entire hierarchical structure descending. What is valid in terms of transformation is also valid for animations. A property animation on one object will have a similar consequence on all child objects.

Don't neglect hierarchy

Hierarchy is an essential concept in the field of 3D computer graphics, structuring a scene allows to simplify enormously its modification.

Meshes

!

A loaded .Fbx file.

File format

Three exchange formats can be used in VRmaze: the .Obj format, the .Fbx format and the Gltf format (and its variations). For these three formats, two types of objects are integrated:

  • Geometry File Container - for the .Fbx format or the Gltf format (and its variations)
  • 3D Object' - for the .Obj format

Textures and loading time

For a .Fbx file, the textures must be in the same folder. Concerning the .Obj format, the associated .Mtl file indicates the folder path where to find the textures. This path can be relative. When using textures, the file is longer to load in the editor as in pass.

File content

This kind of files can contain one object or several. When importing, the whole file is imported.

Materials

It is possible to change the appearance of the loaded object by applying a material to it. The material will give properties of reaction to light and it is possible to apply a texture to it as an image file, present on the hard disk.

Apply multiple materials?

The faces of mesh objects have a material identification information, a numerical value. It is possible to specify an identifier to a material so that this material applies only to faces with the same identifier. With this method, it is possible to have several materials on an object, each one applying to certain faces only. However, this requires that the base mesh is assigned material identifiers on each of the faces, if this is not the case, the material with identifier 0 will be applied everywhere.

Without material With material + texture
! !

The material has several properties necessary for its application:

  • The material id - allows you to specify the group of faces on which to apply the material
  • A color - which will multiply the color data of the loaded image
  • An image file path
  • Repeats - Having a UV coordinate system.

Regarding texture repeats, the property allows you to set the display size of the texture on the object. This allows you to apply a more realistic texture size depending on the object and the image itself.

Applicable values

To get a larger image, just specify a value between 0 and 1, beyond that the texture will appear smaller and smaller. A negative value reverses the direction of the texture on one axis, or both at the same time.

Object bigger than the texture ?

The texture is repeated on the object when the object itself is larger than the size of an image projection.

Material types

VRmaze offers several types of materials. Two main families are available: light-reactive materials (Standard Materials, useful in conventional cases) and light-insensitive materials (Unlit Materials, useful when you want to create light-insensitive objects, like TV screens for example). Other types specific to certain experiments are also available.

Asset bundles

Asset Bundles have their own documentation section.

Reference objects

Reference objects are specific objects that do not have representation capabilities. These objects are useful to refer to an object loaded by another system. For example, it is possible that a .Fbx file or an Asset Bundle loads a whole set of objects at once; it may be necessary to find a specific object in the loaded structure in order to apply a behavior script to it. The reference object allows to find an object from its name and when it is found, the script is applied to it.

Deleting the object

When the VRmaze reference object is destroyed, the found Unity object is not deleted.