Defining AR Scenes

  • iPad

The AR_configuration.json file defines the scene and all models used by the presentation. Every scene has an ID, name, and an array of models:

Copy

Sample scene code

"scenes" : [
  {
    "id" : "scene.L001",
    "name" : "Veeva Codesign",
    "models" : [...]
  }
]

To view a full example, including a configuration JSON file and a 3D model, download Veeva's sample AR zip file.

Each model contains a series of metadata tags defining the model's appearance and behavior. The following metadata tags are available:

Tag Name

Example

Description

id

scene.L001

 

name

Veeva Codesign

The title of the scene displays at the top of the screen.

debug_mode

Copy
"debug_mode": "false"

If true, displays the debugging overlay for testing the models and colored X, Y, and Z axes.

 

Veeva recommends setting this to false before deploying to production.

edit_mode_animation

Copy
"edit_mode_animation": "false"

Determines if the edit mode animation is enabled. Can be true or false. Defaults to true.

models

Copy
"models":[
   {
      "id":"LogosCodesignVeeva",
      "name":"LogosCodesignVeeva",
      "path":"Models",
      "assets":"Logos",
      "file_extension":"dae"
   }
]

The list of models available for selection in the scene. Specify the following parameters for each model:

 

  • Id
  • Name
  • Path
  • Assets
  • File_extension – Must be either dae or obj

id

LogosCodesignVeeva

The unique id of each model. This needs to be specified when placing more than one model on the scene.

path

Models

The path to the Models file. Each model within a scene can have its own path.

assets

Logos

The path to the assets used by the model. This path is within the path metadata tag. In this example, the location is ./Models/Logos/

file_extension

.dae or .obj

Allows different kinds of AR compatible files.

normal_maps

Copy
"obj_name": "file3",
"texture_name" : "CodesignStudio.tga"

More than one normal map can be associated with a model. Specify both the texture name and the ID of the associated object.

scale

0.025,

0.025,

0.025

The X, Y, and Z values of the object’s initial scale.

logo

logo.png

The name of the overlay image. This image can contain company logos, instructions, safety information, etc. This image is always centered and will scale down to fit a screen resolution, but not up.

 

Veeva recommends this image have a transparent background and is tested to ensure the image does not obscure actions.

animation_
control_panel

Copy
"animation_control_panel":{
   "type":"control_panel",
   "id":"control_panel.interactions",
   "buttons":[
      "..."
   ],
   "slider":{
      "type":"slider",
      "id":"slider.main",
      "animations":[
         "..."
      ]
   }
}

Defines the actions when selecting the Next and Previous buttons. Each button can have multiple associated actions.

touch_triggers

Copy
"touch_triggers":[
   {
      "type":"trigger",
      "id":"trigger.pupil",
      "obj_name":"Pupil",
      "fade_object":true,
      "fade_object_duration":1.0,
      "actions":[
         "..."
      ]
   }
]

Defines actions initiated by selecting specific objects of the model. Set the ID parameter to the ID of the associated object.

 

Fades and duration of fades, in seconds, are also controlled by this metadata tag.

anchors

Copy
"anchors":[
   {
      "type":"anchor",
      "id":"anchor.eyeball",
      "obj_name":"II__Eyeball",
      "position":[
         0,
         0,
         0
      ],
      "distance":0.4,
      "actions":[
         {
            "type":"label",
            "id":"label.eyeball"
         }
      ]
   }
]

The reference points for proximity triggers. When the camera is closer to the object than the distance specified, the actions initiate. The following parameters must be defined for each anchor:

 

  • Type – Is always anchor
  • Id
  • Obj_name – The id of the appropriate object
  • Position – Specifies an offset distance from the center of the object. This enables the activation point to be outside of the model rather than all around it.
  • Distance – Radius, in meters, of the activation point
  • Actions – Multiple actions can be associated

animations

Copy
"animations":[
   {
      "type":"animation",
      "id":"Codesign-anim",
      "autoplay":true,
      "repeat_count":1
   }
]

Defines all animations in the model.

 

Set the autoplay parameter to true to begin the animation when the model loads.

 

A repeat count of 0 (zero) endlessly loops the animation.

audios

Copy
"audios":[
   {
      "type":"audio",
      "id":"audio.shot",
      "file_name":"ArrowHit02.wav"
   }
]

Defines any audio files played when initiating actions.

labels

Copy
"labels":[
   {
      "type":"label",
      "id":"label.eyeball",
      "text":"The Eyeball"
   }
]

Defines labels or descriptions displayed using actions.

 

Formatting cannot be applied to this text block. Labels always displays in the same location at the bottom center of the screen.

 

reference_images

Copy
"reference_images":[
   {
      "name":"eyeball_marker.png",
      "width":0.08
   }
]

The name of the image used to trigger the image-recognition software when placing a model.

reference_objects

Copy
"reference_objects":[
   {
      "name":"eyeball_marker_rounded_small.arobject"
   },
   {
      "name":"eyeball_marker_dark.arobject"
   }
]

The name of the object used to trigger the object recognition software when placing a model.

mask

Copy
"portal":{
   "type":"portal",
   "id":"portal.demo",
   "interior_name":"Entire_Scene",
   "mask_name":"Mask"
}

Enables hiding all or a portion of a model when viewed from a certain angle. The interior_name parameter defines the ID of the model being hidden. The mask_name parameter defines the ID of the masking object.

Example Scene

Copy

Sample scene code

{
   "scenes":[
      {
         "id":"scene.L001",
         "name":"Veeva Codesign",
         "debug_mode":false,
         "models":[
            {
               "id":"LogosCodesignVeeva",
               "name":"LogosCodesignVeeva",
               "path":"Models",
               "assets":"Logos",
               "file_extention":"dae",
               "scale":[
                  0.025,
                  0.025,
                  0.025
               ],
               "normal_maps":[
                  {
                     "obj_name":"file3",
                     "texture_name":"CodesignStudio.tga"
                  },
                  {
                     "obj_name":"file4",
                     "texture_name":"site.tga"
                  }
               ],
               "logo":"logo.png",
               "animation_control_panel":{
                  "type":"control_panel",
                  "id":"control_panel.interactions",
                  "buttons":[
                     "..."
                  ]
               }
            }
         ]
      }
   ]
}

Interaction triggers cause certain changes in the model to occur, for example, starting an animation, displaying a label, or playing an audio file.

Three kinds of interaction triggers initiate actions:

  • Touch triggers
  • Proximity triggers
  • Animation Control Panel - Controlled in one of two ways:
  • Slider control bar
  • Forward and Previous buttons

Each interaction trigger can cause one or several actions. These triggers are set up in an array within the JSON file. Always specify the following information for all interaction triggers:

  • Type
  • ID of the associated object
  • Name of the associated object
  • Type of action
  • ID of individual action

Touch Trigger Example

Copy

Sample touch trigger code

"touch_triggers":[
   {
      "type":"trigger",
      "id":"trigger.left.door",
      "obj_name":"NovaSeq_2_a_Left_Door",
      "actions":[
         {
            "type":"animation",
            "id":"NovaSeq_2_a_Right_Door-anim"
         },
         {
            "type":"audio",
            "id":"audio.right.door.start"
         }
      ]
   }
]

Proximity Trigger Example

Copy

Sample proximity trigger code

"anchors":[
   {
      "type":"anchor",
      "id":"anchor.lens",
      "obj_name":"Retina_front",
      "position":[
         0,
         0,
         0
      ],
      "distance":0.4,
      "actions":[
         {
            "type":"animation",
            "id":"Back-anim"
         },
         {
            "type":"label",
            "id":"label.eyeball"
         }
      ]
   }
]

Control Panel Example

Each set of animations can also be controlled by the animation slider rather than playing from beginning to end automatically:

Copy

Sample animation control panel code

"animation_control_panel":{
   "type":"control_panel",
   "id":"control_panel.interactions",
   "slider":{
      "type":"slider",
      "id":"slider.main",
      "animations":[
         {
            "type":"animation",
            "id":"Codesign-anim"
         },
         {
            "type":"animation",
            "id":"group1-anim"
         }
      ]
   },
   "buttons":[
      {
         "actions":[
            {
               "type":"animation",
               "id":"Codesign-anim"
            },
            {
               "type":"animation",
               "id":"group1-anim"
            }
         ]
      }
   ]
},
//Animations that play when triggering the associated action
"animations":[
   {
      "type":"animation",
      "id":"NovaSeq_2_a_Left_Door-anim",
      "autoplay":false,
      "repeat_count":1
   }
],
//Audio files the play when triggering the associated action
"audios":[
   {
      "type":"audio",
      "id":"audio.fgfr",
      "file_name":"Pipeline.mp3"
   }
],
//Labels that display depending on the triggered action.
"labels":[
   {
      "type":"label",
      "id":"label.monitor",
      "text":"This is the MONITOR"
   }
]