Init
Initializes Unlimited3D library.
Name | Required | Type | Description |
---|---|---|---|
options: | yes | object | Following options object fields are required. You can find them on platform, in publish menu, after solution was published. |
distID: | yes | string | ID of distribution. |
solution3DName: | yes | string | Name of campaign(solution). |
projectName: | yes | string | Name of project that campaign belongs to. |
solution3DName: | yes | string | ID of campaign(solution). |
containerID: | yes | string | ID of html element to which canvas will be attached The rest of the fields are not required, but can be passed to customize behaviour. |
collectAnalytics: | no | bool | Determines whether or not analytics will be collected. NOTE: Impression and load time analytics are always collected, regardless of this option |
onPointerClick: | no | function | Called whenever user clicks on the scene First and only parameter is an array of objects in format. |
onPointerMove: | no | functionfunction | Called whenever user moves mouse around the scene First and only parameter is an array of objects in format. |
onLoadingChanged: | no | function | Called when loading of models and textures has changed First and only parameter is an object contain information about loading status. |
onCameraInteraction: | no | function | Called when user moves camera using mouse or touch. |
render: | no | bool | Should 3d scene be rendered immediately or not. |
configuration: | no | object | Cofiguration object is used for loading custom(saved) options before scene is loaded. |
camera: | no | string | Camera Name. |
viewport: | no | string | Viewport Name. |
renderer: | no | string | Renderer Name. |
lights: | no | object | Lights with three child- show:, hide:, override:. |
show: | no | array | Light names, add to scene. |
hide: | no | array | Light names, remove from scene. |
override: | no | array | Light names, only these will be in scene. |
annotations: | no | object | Annotations with three child- show:, hide:, override:. |
show: | no | array | Annotation names, add to scene. |
hide: | no | array | Annotation names, remove from scene. |
override: | no | array | Annotation names, only these will be in scene.. |
materials: | no | object | Materials of annotations. |
MaterialName: | no | array | Set material to annotations. |
parts: | no | object | Change parts. |
show: | no | array | Part names, add to scene. |
hide: | no | array | Part names, remove from scene. |
override: | no | array | Part names, only these will be in scene. |
materials: | no | object | Materials of parts. |
MaterialName: | no | object | set material to parts. |
cameraControl: | no | object | should auto rotate be enabled. |
onTrigger: | no | function | onTrigger callback is general callback for events happening in 3d scene. Parameted passed to onTrigger callback is object with type and data fields. Supported types are: ‘PointerClicked’, ‘PointerMoved’ |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
var options = {
distID: '1',
solution3DName: 'My_solution',
projectName: 'My_project',
solution3DID: '1',
containerID: 'container3d_replace',
onLoadingChanged: function (loading) {};
Unlimited3D.init(options,{},function(e))};
// With configuration
var configuration = {
camera: 'CameraName',
cameraControl: { autoRotate: true},
viewport: 'ViewportName',
renderer: 'RendererName',
lights: {
show: ['LightName'],
hide: ['LightName'],
override: ['LightName'],
},
annotations: {
show: ['AnnotationName'],
hide: ['AnnotationName'],
override: ['AnnotationName'],
materials: {
'MaterialName': ['AnnotationName'],
},
},
parts: {
show: ['PartName', 'model_name_1.fbx:RootNode'],
hide: ['PartName', 'model_name_2.fbx:RootNode'],
override: ['PartName'],
materials: {
'MaterialName': ['PartName'],
},
},
materials: {
'MaterialName': {
color: '#ffffff',
},
},
switchMaterials: {
'MaterialToHide': 'MaterialToShow',
},
};
Unlimited3D.init(options, configuration, function(e) {});
Example
var options = {
distID: '1',
solution3DName: 'My_solution',
projectName: 'My_project',
solution3DID: '1',
containerID: 'container3d_replace',
onLoadingChanged: function(loading) {
loadingBar.style.width = loading.progress + "%";
},
onTrigger: (e) => {
if (e.type === 'PointerClicked') {
const objectData = e.data[0];
if (objectData) {
Unlimited3D.isFeedbackMarker({ name: objectData.name }, (r) => {
if (r) {
Unlimited3D.removeFeedbackMarker({ name: objectData.name }, (r1) => { console.log(r1); });
} else {
Unlimited3D.createFeedbackMarker({
name: 'Feedback',
targetName: objectData.name,
targetType: objectData.type,
material: null,
position: [...objectData.position],
radius: 2,
radiusMode: 'Relative',
color: '#00af00',
}, (r2) => { console.log(r2); });
}
});
}
}
}
};
Unlimited3D.init(options, {},function(error, status){
if (error || !status) {
console.log(error);
return;
}
});
Material
Change Material
Sets passed material to specified parts.
Name | Required | Type | Description |
---|---|---|---|
parts: | yes | array | Names of parts. |
material: | yes | string | Name of material. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeMaterial({parts:['PartName'],material:'MaterialName'} );
Get material
Get active material for the provided part.
Name | Required | Type | Description |
---|---|---|---|
part: | yes | string | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getMaterial({ part:'partName' }, function(e,r){console.log(e,r)});
Get available materials
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableMaterials(function(error, result) { console.log(result); });
Change materials
Name | Required | Type | Description |
---|---|---|---|
partObjects: | yes | array | Set specified material on provided parts. |
parts: | yes | array | |
material: | yes | string | |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeMaterials({ partObjects: [ {parts:
['Part1','Part2'], material: 'Mat1'} ] });
Apply material to all parts
Apply specified material to all parts.
Name | Required | Type | Description |
---|---|---|---|
material: | yes | string | Material name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.applyMaterialToAllParts({ material: 'MaterialName'});
Switch materials
Switch material by name.
Name | Required | Type | Description |
---|---|---|---|
oldMaterial: | yes | string | Old material name. |
newMaterial: | yes | string | New material name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.switchMaterials({ oldMaterial: 'OldMaterialName', newMaterial: 'NMaterialName' });
Change material color
Change material color.
Name | Required | Type | Description |
---|---|---|---|
material: | yes | string | Material name. |
color: | yes | string | Color name in hex. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeMaterialColor({material : "material_name", color: '#ffffff' });
Change material options
Changes material options.
Name | Required | Type | Description |
---|---|---|---|
material: | yes | string | Material name. |
options: | yes | object | Options Object. |
color: | no | string | Color name. |
metalness: | no | float | Metalness level. |
roughness: | no | float | Roughness level. |
opacity: | no | float | Opacity leve. |
transparent: | no | bool | Transparency. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeMaterialOptions({ material: 'material_name', options : {
color: '#ffffff',
metalness: 1.3,
roughness: 1.1,
opacity: 0.8,
transparent: 0.5,
} });
Get Parts with Material
Get parts with the specified material.
Name | Required | Type | Description |
---|---|---|---|
material: | yes | string | Name of material. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getPartsWithMaterial({material:'MaterialName'}, function(e,r){console.log(e,r)} );
Get Annotations with Material
Get annotations with the specified material.
Name | Required | Type | Description |
---|---|---|---|
material: | yes | string | Name of material. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAnnotationsWithMaterial({material:'MaterialName'}, function(e,r){console.log(e,r)} );
Part
Hide parts
Hides specified model parts from scene.
Name | Required | Type | Description |
---|---|---|---|
parts: | yes | array | Names of parts to hide. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.hideParts({parts:['PartName']});
Show parts
Shows specified parts on scene.
Name | Required | Type | Description |
---|---|---|---|
partObjects: | yes | array | If material is not specified parts in that group will use their default material. |
name ['PartName']: | yes | array | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showParts({partObjects:[{parts:['PartName']}]});
Show all parts
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Show only parts
Display specified parts and hide all other parts in the scene.
Name | Required | Type | Description |
---|---|---|---|
partObjects: | yes | array | Shows specified parts on scene. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showOnlyParts({
partObjects:[
{
parts: ["PartName3", "PartName4"],
}
]
});
Get available parts
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableParts(function(error, result) { console.log(result); });
Get visible parts
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getVisibleParts(function(error, result) { console.log(result); });
Get hidden parts
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getHiddenParts(function(error, result) { console.log(result); });
Is part visible
Check if a part is visible.
Name | Required | Type | Description |
---|---|---|---|
part: | yes | string | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.isPartVisible({ part: "part_name"}, function(error,result){console.log(result)} );
Select parts
Name | Required | Type | Description |
---|---|---|---|
parts: | yes | array | |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.selectParts(['PartName'])
Select all parts except
Selects all parts in the scene except the ones listed in the array.
Name | Required | Type | Description |
---|---|---|---|
parts: | yes | array | Array of parts name |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.selectAllPartsExcept( {parts: ['part_name1','part_name2' ]} );
Get selected parts
Get selected parts.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getSelectableParts(function(error, result) { console.log(result); });
Is part selected
Check if a part is selected.
Name | Required | Type | Description |
---|---|---|---|
part: | yes | string | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.isPartSelected({ part: "part_name"}, function(error,result){console.log(result)} );
Get selectable parts
Get selectable parts.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getSelectableParts(function(error, result) { console.log(result); });
Get part position
Get part position.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getPartPosition({ name: 'part_name'},function(error, result) { console.log(result); } );
Get part center
Get part center.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getPartCenter({ name: 'part_name'},function(error, result) { console.log(result); } );
Show custom parts
Shows specified custom parts on scene.
Name | Required | Type | Description |
---|---|---|---|
customPartObjects: | yes | array | Names of parts to show |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. Hide annotations |
Example
Unlimited3D.showCustomParts({
customPartObjects :[{ customParts:["CustomPartName"] }]
});
Hide custom parts
Hides specified custom parts from scene.
Name | Required | Type | Description |
---|---|---|---|
customParts: | yes | array | Names of parts to hide |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. Hide annotations |
Example
Unlimited3D.hideCustomParts({
customParts:["CustomPartName"]
});
Show only custom parts
Shows only specified custom parts on scene.
Name | Required | Type | Description |
---|---|---|---|
customPartObjects: | yes | array | Names of part to show |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. Hide annotations |
Example
Unlimited3D.showOnlyCustomParts({
showCustomParts:[{customParts:["CustomPartName"]}]
});
Get available custom parts
Returns names of custom parts available
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. Hide annotations |
Example
Unlimited3D.getAvailableCustomParts( function(error, results ){ console.log(results) });
set part transformation properties
Changes position and scale of part
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | name of the part |
position: | no | array | array for new position. It must be of length 3 and contain only numbers([1, 1, 1]) |
scale: | no | array | array for new scale. It must be of length 3 and contain only numbers([1, 1, 1]) |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. Hide annotations |
Example
Unlimited3D.setPartTransformationProperties({
name: "PartName",
position: [1.2, 1, 1],
scale: [1, 1, 2]
});
Light
Show lights
Adds specified lights to scene.
Name | Required | Type | Description |
---|---|---|---|
lights: | yes | array | Names of lights to show. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showLights({ lights:['Light1', 'Light2'] });
Hide lights
Removes specified lights from scene.
Name | Required | Type | Description |
---|---|---|---|
lights: | yes | array | Names of lights to hide. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.hideLights({ lights:['Light1', 'Light2'] });
Is visible light
Check if a light is visible.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Light name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.isVisibleLight({ name : "Light_name"}, function(error,result){console.log(result)} );
Show only lights
Show only the lights listed in the array and hide all other lights.
Name | Required | Type | Description |
---|---|---|---|
lights: | yes | array | Names of lights to show. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showOnlyLights( { lights: ['light_name1','light_name2'] } );
Annotation
Show annotations
Adds specified annotations to scene.
Name | Required | Type | Description |
---|---|---|---|
annotationObjects: | yes | array | If material is not specified annotations in that group will use their default. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showAnnotations({
annotationObjects:[
{
annotations: ["Anno3"],
"MaterialName"
}
]
})
Hide annotations
Removes specified annotations from scene.
Name | Required | Type | Description |
---|---|---|---|
annotations: | yes | array | Names of annotations to hide. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.hideAnnotations({
annotations: ["Anno1", "Anno2"],
});
Change annotation material
Sets passed material to specified annotation.
Name | Required | Type | Description |
---|---|---|---|
annotations: | yes | array | Names of annotations to change material. |
material: | yes | string | Name of material. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeAnnotationMaterial({
annotations: ["Anno1", "Anno2"],
material : "MaterialName"
});
Get selected annotations
Get Selected annotations
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getSelectedAnnotations( function(error, results ){ console.log(results) });
Show only annotations
Shows specified annotations to scene.
Name | Required | Type | Description |
---|---|---|---|
annotationObjects: | yes | array | If material is not specified annotations in that group will use their default. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showOnlyAnnotations({
annotationObjects:[
{
annotations: ["Anno3"],
material : "MaterialName"
}
]
});
Get available annotations
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableAnnotations(function(error, result) { console.log(result); });
Set annotation transformation properties
Changes position, scale and rotation of annotation.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of annotation. |
position: | no | array | Array for new position. It must be of length 3 and contain only numbers([1, 1, 1]). |
scale: | no | array | Array for new scale. It must be of length 3 and contain only numbers([1, 1, 1]). |
rotation: | no | array | array for new rotation. It must be of length 3 and contain only numbers([90, 90, 90]). |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setAnnotationTransformationProperties({
name: 'annotation_name',
position: [10, 10, 5],
scale: [14, 13, 7],
rotation: [90, 45, 45]
});
Camera
Enable auto rotate
Enables current camera’s auto rotation around target.
Name | Required | Type | Description |
---|---|---|---|
enable: | yes | bool | should auto rotate be enabled. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.enableAutoRotate({enable:true});
Set auto rotate speed
Changes speed of current camera auto rotation.
Name | Required | Type | Description |
---|---|---|---|
speed: | yes | float | Set speed of ratation |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setAutoRotateSpeed({ speed : 5 });
Activate camera control
Set specified camera as active on scene
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of camera to activate |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.activateCameraControl({ name:'camera_name' });
Is active camera
Check if specified camera is active
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of camera to activate |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.isActiveCamera({ name:'camera_name' }, (e,r)=>{ console.log(e,r) } );
Is active camera control
Check if specified camera control is active.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of camera to activate. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.isActiveCameraControl({ name:'Camera Mobile control' }, (e,r)=>{ console.log(e,r) } );
Get camera position
Return camera position.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getCameraPosition(function(error, result) { console.log(result); });
Set camera position
Changes camera position.
Name | Required | Type | Description |
---|---|---|---|
position: | yes | array | Array for new position. It must be of length 3 and contain only numbers ( [ 1, 1, 1 ] ). |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setCameraPosition({ position : [1, 2, 1] });
Get camera target
Returns camera target.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getCameraTarget(function(error, result) { console.log(result); });
Set camera target
Choose camera target
Name | Required | Type | Description |
---|---|---|---|
target: | yes | array | Array for new camera target. It must be of length 3 and contain only numbers ( [ 1, 1, 1 ] ). |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setCameraTarget({ target : [0, 3, 0] });
Reset camera position
Resets camera position.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of camera to activate. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
resetCameraPosition({ name:'camera_name' });
Reset camera target
Resets camera target.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.resetCameraTarget( (e,r)=>{console.log(e,r) });
Enable camera controls
Enables camera controls.
Name | Required | Type | Description |
---|---|---|---|
enable: | yes | bool | should camera controls be enabled. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.enableCameraControls({ enable : true });
Activate camera
Set specified camera as active on scene
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of camera to activate |
preventDefault: | no | bool | Prevents camera from jumping to default position when activated |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.activateCamera({ name:'Camera_1' });
Update camera control
Updates camera control.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of camera control. |
minAzimuthAngle: | no | float | Minimum azimuth angle. |
maxAzimuthAngle: | no | float | Maximum azimuth angle. |
minPolarAngle: | no | float | Minimum polar angle. |
maxPolarAngle: | no | float | Maximum polar angle. |
panSpeed: | no | float | Set pan speed. |
minDistance: | no | float | Minimum distance |
maxDistance: | no | float | Maximum distance |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.updateCameraControl({
name: 'Contol_name',
minAzimuthAngle : 1.1,
maxAzimuthAngle : 1.5,
minPolarAngle : 1.0,
maxPolarAngle : 2.0,
panSpeed : 5.5,
minDistance: 1.1,
maxDistance: 1.5
});
Get available cameras
Returns names of camera.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableCameras(function(error, result) { console.log(result); });
Get snapshot
Get snapshot of selected area.
Name | Required | Type | Description |
---|---|---|---|
width: | yes | int | Resolution of the snapshot (px). |
height: | yes | init | Height of the snapshot (px). |
result: | no | string | Changes the way snapshot result is returned. Possible values: 'url', 'blob', 'base64'. Default is 'url' |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getSnapshot({ width : 1280, height : 720 });
Example
Unlimited3D.getSnapshot({ width : 1280, height : 720, result: "base64" });
Viewport
Set viewport transparent
Set viewport to be transparent.
Name | Required | Type | Description |
---|---|---|---|
viewport: | yes | string | Viewport name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setViewportTransparent({ viewport: 'viewport_name' });
Change background color
Changes background color and background opacity of scene
Name | Required | Type | Description |
---|---|---|---|
viewport: | yes | string | Name of viewport |
color: | no | string | Change background color |
opacity: | no | float | Change background opacity |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeBackgroundColor({
viewport: "Viewer", color : "#CCCCCC", opacity : 0.5
})
Renderer
Activate renderer
Sets specified renderer as active.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of renderer. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.activateRenderer({ name: 'renderer_name' });
Is active renderer
Check if specified renderer is active.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of renderer. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.activateRenderer({
name:'renderer_name'
}, function(error,response){
console.log(response)
});
Groups
Change group material
Changes group material.
Name | Required | Type | Description |
---|---|---|---|
groupObjects: | yes | array | Array of parts. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.changeGroupMaterial({
groupObjects : ['name1','name2','name2']
});
Model
Enable object control
Enables object control.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of object. |
enable: | yes | bool | Should object control be enabled. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.enableObjectControl({
name:'object_name',
enable : true
});
Get model position
Returns model position.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of model. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getModelPosition({
name: 'model_name'
}, function(error, response){
console.log(response);
});
Show models
Shows models.
Name | Required | Type | Description |
---|---|---|---|
models: | yes | array | Array of models. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showModels({ models : ['Model_name1', 'Model_name2'] });
Hide models
Hides models.
Name | Required | Type | Description |
---|---|---|---|
models: | yes | array | Array of models. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.hideModels({ models : ['Model_name1', 'Model_name2'] });
Show only models
Shows models only.
Name | Required | Type | Description |
---|---|---|---|
models: | yes | array | Array of models. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.showOnlyModels({ models : ['Model_name1', 'Model_name2'] });
Update Object Controls
Updates Object Controls
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of object. |
mode: | no | string | Mode can have String "Translate" or "Rotate" |
maxDistance: | no | float | Maximum distance. |
minDistance: | no | float | Minimum distance. |
zoomEnabled: | no | bool | Should zoom be enabled. |
rotationSpeed: | no | float | Speed of rotation. |
rotationSpeedTouch: | no | float | Rotation speed touch. |
horizontalRotationEnabled: | no | bool | Should horizontal rotation be enabled. |
verticalRotationEnabled: | no | bool | Should vertical rotation be enabled. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.updateObjectControls({
name: 'object_name',
mode: 'Rotate',
maxDistance : 10.2,
minDistance : 2.6,
zoomEnabled : true,
zoomSpeed : 5.1,
rotationSpeed : 10.6,
rotationSpeedTouch : 1.1,
horizontalRotationEnabled : false,
verticalRotationEnabled : true,
});
Enable analitycs collection
Enable/disable collection of analytics.
Name | Required | Type | Description |
---|---|---|---|
enable: | yes | bool | escription: Enable/disable collection of analytics. NOTE: Impression and load time analytics are always collected, regardless of this option. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.enableAnalitycsCollection({enable : true});
Selectable
Get selected
Returns selected part.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getSelected(function(error, response){ console.log(response) });
Get selectable
Returns selectable position.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getSelectable(function(error, response){ console.log(response) });
Add selectable
Adds selectable parts.
Name | Required | Type | Description |
---|---|---|---|
partNames: | yes | array | Array of parts. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.addSelectable({ partNames : ['name1','name2','name3'] });
Set selectable
Sets selectable.
Name | Required | Type | Description |
---|---|---|---|
partNames: | yes | array | Array of parts. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setSelectable({ partNames : ['name1','name2','name3'] });
Set all selectable
Sets all selectable.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setAllSelectable(function(error, response){ console.log(response) });
Actions
Get available transitions
Returns names of modifiers transitions.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableTransitions(function(error, result) { console.log(result); });
Activate transition
Activates specified transition
Name | Required | Type | Description |
---|---|---|---|
transition: | yes | string | Name of transition to activate |
target: | no | string | Name of transitions target. If not specified transition will use target set in Unlimited3D designer |
duration: | no | float | Duration of transition in ms |
config: | no | object | Object containg properties of transition to change. Example: position, scale |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
onPointerClick: function(objectsClick) {
if(objectsClick.length>0 && objectsClick[0].type == 'annotation') {
if( objectsClick[0].shortName == 'AnnotationName' ){
Unlimited3D.activateTransition({transition: 'NameOfTransition'});
}
}
}
Get available modifiers
Returns names of modifiers available.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableModifiers(function(error, result) { console.log(result); });
Activate modifier
Activates specified modifier
Name | Required | Type | Description |
---|---|---|---|
modifier: | yes | string | Name of modifier to activate |
Example
Unlimited3D.activateModifier({modifier: "NameOfModifier"});
Distribution Info
Get distribution info
Get distribution information for solution
Name | Required | Type | Description |
---|---|---|---|
solution3DID: | yes | Int | ID of solution. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3d.getDistributionInfo({ solution3DID: 1 }, (e, info) => console.log(info));
Get latest distribution info
Get latest distribution information for solution.
Name | Required | Type | Description |
---|---|---|---|
solution3DID: | yes | Int | ID of solution. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3d.getLatestDistributionInfo({ solution3DID: 1 }, (e, info) => console.log(info));
Rendering
Render
Render 3d scene. If scene is already rendered, it will be destroyed and rendered again.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.render(function(error, result) { console.log(result); });
Overlay
Get Available Overlays
Get Available Overlays.
Name | Required | Type | Description |
---|---|---|---|
callback: | yes | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getAvailableOverlays((error, result) => console.log(result));
Get Part Overlays
Get active overlay for the provided part.
Name | Required | Type | Description |
---|---|---|---|
part: | yes | string | Part name. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.getPartOverlays({ part: 'PartName' }, (error, result) => console.log(result));
Set Overlay To Part
Sets passed overlay to specified part.
Name | Required | Type | Description |
---|---|---|---|
overlay: | yes | string | Name of overlay to set |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.setOverlayToPart({ overlay: 'OverlayName, part: 'PartName' }, (error) => console.log(error));
Remove Overlay From Part
Removes overlay from specified part.
Name | Required | Type | Description |
---|---|---|---|
overlay: | yes | string | Name of overlay to remove |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.removeOverlayFromPart({ overlay: 'OverlayName, part: 'PartName' }, (error) => console.log(error));
Update overlay
Updates options of overlay.
Name | Required | Type | Description |
---|---|---|---|
overlay: | yes | string | Name of overlay to update. |
overlayEntry: | yes | string | Name of overlay item to update. |
fontUrl: | no | string | Url to font to use for overlay text. |
imageUrl: | no | string | Url to use as image for overlay. |
text: | no | string | Text to display in overlay. |
fontColor: | no | string | Color of text in hex. |
fontScale: | no | float | Scale of the font. Minimum value 0.0. |
fontWeight: | no | string | Font Weight. Possible values: 'normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'. |
fontSpacing: | no | float | Font Spacing. Minimum value 1.0 |
fontStyle: | no | string | Font style. Possible values: 'normal' 'italic', 'oblique'. |
enabled: | no | bool | Is overlay item enabled. |
opacity: | no | float | Opacity of overlay item. Possible values [0.0, 1.0] |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.updateOverlay({
overlay: 'Overlay',
overlayEntry: 'Image',
options: { imageUrl: 'url-to-image' }
});
Example
Unlimited3D.updateOverlay({
overlay: 'Material',
overlayEntry: 'Text',
options: {
text: 'Hello',
fontUrl: 'url-to-font',
fontColor: '#000000',
fontScale: 0.2,
fontWeight: 'normal',
fontSpacing: 0.0
}
});
Add entry to overlay
Add entry to overlay. If index is not specified entry will be added to end.
Name | Required | Type | Description |
---|---|---|---|
overlay: | yes | string | Name of overlay to which entry should be added |
overlayEntry: | yes | string | Name of overlay entry to add |
index: | no | intiger | Index of the overlay entry |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.addEntryToOverlay({ overlay: 'overlay_name', overlayEntry: 'overlayEntry_name', index : 5 });
Remove entry from overlay
Remove entry from overlay.
Name | Required | Type | Description |
---|---|---|---|
overlay: | yes | string | Name of overlay from which entry should be removed. |
overlayEntry: | no | string | Name of overlay entry to remove. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.removeEntryFromOverlay({ overlay: 'overlay_name', overlayEntry: 'overlayEntry_name' });
Decoration
Activates decoration on parts
If decoration is not specified, current decoration from scene will be used.
Name | Required | Type | Description |
---|---|---|---|
parts: | yes | array | Parts on which to apply decoration. |
decoration: | no | string | Decoration to use. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.activateDecorationOnParts({ parts : ['part_name'], decoration : 'decoration _name' });
Deactivates decoration from parts
Deactivates decoration from parts.
Name | Required | Type | Description |
---|---|---|---|
parts: | yes | array | Parts from which to remove decoration. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.deactivateDecorationFromParts({ parts : ['part_name1', 'part_name2'] });
Feedback
Create feedback marker
Returns object with data about created object, including correct object name etc.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | Name of feedback marker, if it is not unique, it will add suffix with numeration. |
targetName: | no | string | Name of the object on top of which feedback should be created, it can be used to calculate marker size. |
targetType: | no | string | Type of the object on top of which feedback should be created, it can be used to calculate marker size. |
material: | no | string | Custom material that will be user instead of single color material. |
position: | no | array | Position where marker will be created. |
radius: | no | float | Radius of marker, how value will be applied depends on radiusMode |
radiusMode: | no | string | Mode to determine the size of marker. |
color: | no | string | Color of marker material |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.createFeedbackMarker({ name: 'Marker', targetName: 'Part Name, targetType: 'part', material: 'Material', position: [0, 0, 0], radius: 1.0, radiusMode: 'Absolute', color: '#ffffff', }, (e, marker) => console.log(marker))
Remove feedback marker
Remove feedback marker.
Name | Required | Type | Description |
---|---|---|---|
name: | yes | string | name of the marker, it should be name returned in the result object of createFeedbackMarker call. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.removeFeedbackMarker({ name:"name_marker" });
Is feedback marker
Returns true if object with given name is marker.
Name | Required | Type | Description |
---|---|---|---|
name: | no | string | name of the object. |
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
Unlimited3D.isFeedbackMarker({ name:"name_marker" });
Get all feedback markers
Returns array of all marker names created in the scene.
Name | Required | Type | Description |
---|---|---|---|
callback: | no | function | Callback function called after action is completed first parameter returned is error, which is set to null in case of success. |
Example
getAllFeedbackMarkers((error ,response) => { console.log(erorr ,response) });