Three Macro
Last modified by wiki.ROBOT.ru on 2026/02/15 16:28
Contents
Description
A macro for loading and displaying 3D objects in XWiki.
Usage
A file with custom background
{{three ref="http://example.com/path/to/file.gltf" background="#ffffff" /}}
Result
A file with custom height and width
{{three ref="http://example.com/path/to/file.gltf" width="100%" height="600px" /}}
Result
Using the current page's attachment
{{three attachmentRef="bar.gltf" /}}
Result
Using a different page's attachment
This will look for an attachment named "file.obj" in the specified page.
{{three attachmentRef="Space.Page@file.obj" /}}
{{three attachmentRef="wiki:Space.Page@file.obj" /}}
{{three attachmentRef="wiki:Space.Page@file.obj" /}}
Auto rotate the camera
This will auto rotate the camera around the object. A custom (optional) auto rotate speed can also be set.
{{three attachmentRef="bar.gltf" autoRotate="true" autoRotateSpeed="20" /}}
Result
Disable controls with custom zoom out
This will disable the controls and will not allow users to move around in the scene.
It will also set a custom initial distance from the object.
{{three attachmentRef="Macros.ThreeMacro.WebHome@bar.gltf" disableControls="true" type="gltf" defaultZoomOut="5" /}}
Result
Loading multiple files
This will load multiple objects on the same canvas.
{{three attachmentRef="file1.obj, file2.gltf, Space.Page@file3.gltf" ref="http://url.com/file1.gltf, http://url.com/file2.gltf" /}}
Parameters
| Name | Mandatory | Values | Default | Description |
|---|---|---|---|---|
| ref | No | * | Reference to 3D object files to load from URL separated by comma. Supported formats are .obj, .gltf. | |
| attachmentRef | No | * | Reference to 3D object files to load from attachments separated by comma. Supported formats are .obj, .gltf. Syntax: wiki:Space.Page@attachment.gltf, Space.Page@attachment.gltf, attachment.gltf | |
| type | No | obj/gltf | Type of the object. Supported types are .obj, .gltf. | |
| width | No | [0-9]+px or % | 100% | Width of the canvas. |
| height | No | [0-9]+px or % | 400px | Height of the canvas. |
| defaultZoomOut | No | [0-9]+ | 10 | Default value of how zoomed out (far) the camera initially is from the object. |
| disableControls | No | true/false | false | If the orbit controls used to move camera around the object should be disabled or not. |
| autoRotate | No | true/false | false | If the camera should auto rotate around the object or not. |
| autoRotateSpeed | No | [0-9]+ | Speed of the auto rotate. | |
| background | No | #000000 | Background color of the canvas. |