Skip to main content

Image Target Events

Types

ImagePropertiesObject

ImagePropertiesObject is an object with the following properties:

PropertyTypeDescription
widthNumberWidth of the image target.
heightNumberHeight of the image target.
originalWidthNumberWidth of the uploaded image.
originalHeightNumberHeight of the uploaded image.
isRotatedbooleanWhether the image target has been rotated.

Events

imagefound

This event is emitted when an image target is first found.

Properties

PropertyTypeDescription
nameStringThe image's name.
typeStringOne of FLAT, CYLINDRICAL, CONICAL.
position{x, y, z}The 3d position of the located image.
rotation{w, x, y, z}The 3d local orientation of the located image.
scaleNumberA scale factor that should be applied to object attached to this image.
propertiesImagePropertiesObjectAdditional image target properties.
scaledWidthNumberOnly applicable to FLAT. The width of the image in the scene, when multiplied by scale.
scaledHeightNumberOnly applicable to FLAT. The height of the image in the scene, when multiplied by scale.
heightNumberOnly applicable to CYLINDRICAL or CONICAL. Height of the curved target.
radiusTopNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the top.
radiusBottomNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the bottom.
arcStartRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Starting angle in radians.
arcLengthRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Central angle in radians.

Example

world.events.addListener(world.events.globalId, 'reality.imagefound', (e) => {
console.log(e)
})

imageloading

This event is emitted when detection image loading begins.

Properties

PropertyTypeDescription
nameStringThe image's name.
typeStringOne of FLAT, CYLINDRICAL, CONICAL.
metadataObjectUser metadata.

Example

world.events.addListener(world.events.globalId, 'reality.imageloading', (e) => {
console.log(e)
})

imagelost

This event is emitted when an image target is no longer being tracked.

Properties

PropertyTypeDescription
nameStringThe image's name.
typeStringOne of FLAT, CYLINDRICAL, CONICAL.
position{x, y, z}The 3d position of the located image.
rotation{w, x, y, z}The 3d local orientation of the located image.
scaleNumberA scale factor that should be applied to object attached to this image.
propertiesImagePropertiesObjectAdditional image target properties.
scaledWidthNumberOnly applicable to FLAT. The width of the image in the scene, when multiplied by scale.
scaledHeightNumberOnly applicable to FLAT. The height of the image in the scene, when multiplied by scale.
heightNumberOnly applicable to CYLINDRICAL or CONICAL. Height of the curved target.
radiusTopNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the top.
radiusBottomNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the bottom.
arcStartRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Starting angle in radians.
arcLengthRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Central angle in radians.

Example

world.events.addListener(world.events.globalId, 'reality.imagelost', (e) => {
console.log(e)
})

imagescanning

This event is emitted when all detection images have been loaded and scanning has begun.

Properties

PropertyTypeDescription
nameStringThe image's name.
typeStringOne of FLAT, CYLINDRICAL, CONICAL.
metadataObjectUser metadata.
geometryObjectObject containing geometry data. If type=FLAT: {scaledWidth, scaledHeight}, else if type=CYLINDRICAL or type=CONICAL: {height, radiusTop, radiusBottom, arcStartRadians, arcLengthRadians}
scaledWidthNumberOnly applicable to FLAT. The width of the image in the scene, when multiplied by scale.
scaledHeightNumberOnly applicable to FLAT. The height of the image in the scene, when multiplied by scale.
heightNumberOnly applicable to CYLINDRICAL or CONICAL. Height of the curved target.
radiusTopNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the top.
radiusBottomNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the bottom.
arcStartRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Starting angle in radians.
arcLengthRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Central angle in radians.

Example

world.events.addListener(world.events.globalId, 'reality.imagescanning', (e) => {
console.log(e)
})

imageupdated

This event is emitted when an image target changes position, rotation or scale.

Properties

PropertyTypeDescription
nameStringThe image's name.
typeStringOne of FLAT, CYLINDRICAL, CONICAL.
position{x, y, z}The 3d position of the located image.
rotation{w, x, y, z}The 3d local orientation of the located image.
scaleNumberA scale factor that should be applied to object attached to this image.
propertiesImagePropertiesObjectAdditional image target properties.
scaledWidthNumberOnly applicable to FLAT. The width of the image in the scene, when multiplied by scale.
scaledHeightNumberOnly applicable to FLAT. The height of the image in the scene, when multiplied by scale.
heightNumberOnly applicable to CYLINDRICAL or CONICAL. Height of the curved target.
radiusTopNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the top.
radiusBottomNumberOnly applicable to CYLINDRICAL or CONICAL. Radius of the curved target at the bottom.
arcStartRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Starting angle in radians.
arcLengthRadiansNumberOnly applicable to CYLINDRICAL or CONICAL. Central angle in radians.

Example

world.events.addListener(world.events.globalId, 'reality.imageupdated', (e) => {
console.log(e)
})