Three Macro
A macro for loading and displaying 3D objects in XWiki. |
Type | XAR |
Category | Macro |
Developed by | |
Active Installs | 0 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Description
A macro for loading and displaying 3D objects in XWiki.
Usage
A file with custom background
Result
A file with custom height and width
Using the current page's attachment
Result
Using a different page's attachment
This will look for an attachment named "file.obj" in the specified page.
Auto rotate the camera
This will auto rotate the camera around the object. A custom (optional) auto rotate speed can also be set.
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.
Loading multiple files
This will load multiple objects on the same canvas.
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:[email protected], [email protected], 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. |
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Release Notes
v1.3.1
v1.3
v1.2
v1.1
v1.0
Dependencies
Dependencies for this extension (org.xwiki.contrib:macro-three 1.3.1):
- org.webjars.npm:three 0.121.1