# Input/Output files

Input files define the content of the [scene](#scene), the [animation](#animation), the [environment ](#environment)setup, and the app [configuration](#undefined). All input files can be specified using URL parameters. If not explicitly specified, VEB.js will try to load the animation, environment and configuration files of a scene according to the following convention. Given a scene file named `scene.json`, the convention is that the corresponding animation file is named `scene_anim.json`, the environment file `scene_env.json`, and the configuration file `scene_config.json`.&#x20;

[Examples of input files ](https://virtualfactory.gitbook.io/vlft/use-cases/assets-and-animations)are provided in the Use Case section.

## Scene

Scenes can be imported/exported from/to a **.json** file according to a [specific schema](https://virtualfactory.gitbook.io/vlft/kb/instantiation/assets/json).&#x20;

## Animation

The animation of the scene can be defined in a [**.json** file](https://virtualfactory.gitbook.io/vlft/kb/instantiation/animations) together with additional data (e.g. reusable animation sequences) stored as [**.txt** files](https://virtualfactory.gitbook.io/vlft/kb/instantiation/animations#animation-sequence).

## Environment

The environment setup is defined in a .json file according to a schema with the following root properties:

* "**cameras**": an array defining cameras to navigate the scene. Each camera can be characterized by "id", "type" (e.g. "FlyCamera", "FreeCamera", "ArcRotateCamera", etc.), "position", "rotation", "speed".
* "**lights**": an array defining sources of light in the scene. Each light can be characterized by "id", "type" (e.g. "HemisphericLight", "PointLight", etc.), "position" or "direction", "intensity".
* "**shadows**": an object specifying how shadows are generated with properties "darkness", "bias", "environmentIntensity".
* "**datagen**": definition of parameters for the generation of data, in particular screenshots. The poperty "**cam**" defines the movements of the ArcRotateCamera that points the selected mesh in terms of alpha, beta and radius. Alpha and beta are degrees (angles) with a starting value ("alphaMin", "betaMin"), a final value ("alphaMax", "betaMax") and an incremental step ("alphaStep", "betaStep"). The radius is calculated multiplying the diagonal of the selected asset bounding box by a factor that is specified with an initial value ("radiusFactorMin"), a final value ("radiusFactorMax") and an incremental step ("radiusFactorStep").
* "**env**":&#x20;
  * &#x20;"**skyboxTexture**": texture to be used for a skybox environment (default "textures/studio.env")
  * "**backgroundColor**": color of the background defined as an array of floats representing the RGB values (default \[0.2,0.2,0.3]
  * "**groundTexture**": texture to be used for the ground (absent by default)
  * "**groundSize**": array of integer values defining the width, height, and subdivision of the ground

## Configuration

The app configuration is defined in a .json file according to a schema with the following root properties:

* "**endpoint**": definition of the SPARQL endpoint to query/update an ontology. Its properties are:
  * "**server**": address of the server&#x20;
  * "**database**": name of the database
  * "**user**": user
  * "**psw**": password
* "**repo**": definition of the repositories that are relevant to load a VR scene
  * "**model3d**": repository of the 3D models&#x20;
  * "**animation**": repository of the animation sequences
  * "**sparqlDir**": repository of the SPARQL query/update templates
* "**MQTT**": definition of MQTT communication settings
  * "**broker**": URL of the broker
  * "**sub\_base\_topics**": array of base topics (that are customized with the addition of the scene name) for MQTT subscriptions
  * "**pub\_base\_topics**": array of base topics (that are customized with the addition of the scene name) for MQTT publishing
  * "**QoS**": quality of service (0, 1, 2)
