Input/Output files

Input files define the content of the scene, the animation, the environment setup, and the app configuration. 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.

Examples of input files are provided in the Use Case section.

Scene

Scenes can be imported/exported from/to a .json file according to a specific schema.

Animation

The animation of the scene can be defined in a .json file together with additional data (e.g. reusable animation sequences) stored as .txt files.

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":

    • "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

    • "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

    • "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)

Last updated