Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > Model
Filters

Class Model - extends Drawable

A Model drawable represents an ARObject as a 3D Model.

A Model file consist of a link to a zip file that is created using the Wikitude Model Generator, as well as certain control properties and triggers that fire on certain events.

On creation, setup parameters can be passed to customize the properties of the Model.

Example:
//create a new Model and pass some setup parameters
var model = new AR.Model("http://www.myserver.com", {
  onClick : function() {
    //something happens
  }
});

Constructor

Model ( uri , options )
Parameters:
uri <string> An URI pointing to the zip file including all model information/a>
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • enabled
  • rotate
    • roll
    • tilt
    • heading
  • scale
    • x
    • y
    • z
  • translate
    • x
    • y
    • z
  • onClick
  • onLoaded
  • onError

Properties

scale.x - float

The scale in x-direction. Must be non-negative.
Default Value: 1

scale.y - float

The scale in y-direction. Must be non-negative.
Default Value: 1

scale.z - float

The scale in z-direction. Must be non-negative.
Default Value: 1

translate.x - float

The horizontal offset to the calculated position of the Model, in SDUs. A positive x causes the Model to move right, a negative offsetX causes it to move left.
Default Value: 0

translate.y - float

The vertical offset to the calculated position of the Model, in SDUs. A positive y causes the Model to move up, a negative offsetX causes it to move down.
Default Value: 0

translate.z - float

The depth-offset to the calculated position of the Model, in SDUs. A positive z causes the Model to move towards the user, a negative offsetX causes it to move away.
Default Value: 0

uri - string

The uri pointing to the model file. This property is read-only and cannot be modified after creation.

Properties inherited from ARchitectObject:

Methods

isLoaded

boolean isLoaded ( )
Allows checking if the Model has already been loaded successfully.
Returns: boolean
  • true if the Model is already loaded.
  • false if the Model is not yet loaded.

onError

void onError ( )
The trigger will fire when the Model file cannot be loaded.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onLoaded.
Returns: void

onLoaded

void onLoaded ( )
The trigger will fire when the Model file is successfully loaded.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onLoaded.
Returns: void

Methods inherited from Drawable:

Methods inherited from ARchitectObject:


Copyright © 2013 Wikitude GmbH. All rights reserved.