From MediaWiki.org
Jump to navigation Jump to search

Other languages:
English • ‎Nederlands • ‎dansk • ‎français • ‎русский • ‎中文 • ‎日本語
MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation Parser function , Tag , ContentHandler , Link markup
Description Adds support of 3D files viewing at your MediaWiki
Author(s) Dolfinus
Latest version 1.0 (2017-02-05)
MediaWiki 1.25+
Database changes No
License MIT License
Download Download snapshot
Example Example of 3D Viewer at file page
Translate the 3DAlloy extension if it is available at translatewiki.net
Check usage and version matrix.


MediaWiki extension which allows to add 3D models viewer to site pages. Based on THREE.js, renders image with CanvasRenderer. There you can see example 3D model page.

Supported file extensions[edit]

THREE.js model format:

  • .json
  • .3djson
  • .3dj * .three

THREE.js model buffer geometry format:

  • .buff
  • .buffjson

OBJ file format:

  • .obj

STL (binary) file format:

  • .stl
  • .stlb


Download the latest snapshot and extract it to your extensions directory. Then include it in your LocalSettings.php file as in the following example:

wfLoadExtension( '3DAlloy' );

$wgFileExtensions = array_merge(
  $wgFileExtensions, array(
      'json', '3dj', '3djson', 'three',
      'buff', 'buffjson',
      'stl', 'stlb'

Then add these lines to the end of your MediaWiki includes/mime.types file:

application/json json 3djson 3dj three buff buffjson
application/obj obj
application/stl stl stlb

And then to includes/mime.info file:

application/json [TEXT]
application/obj       [TEXT]
application/stl       [TEXT]


As Image Handler[edit]


As Parser function[edit]


Instead of uploaded filename you can use an url for file located in external site.

As Parser tag[edit]

<3d file="Model.json" width="" height="" ... ></3d>
<3d width="" height="" ... >Model.json</3d>

You also can use url instead of short filename.


Name Description Default value
width Canvas width in pixels 300
height Canvas height in pixels 300
color Model RGB color as hex 0xff00ff
opacity Model opacity as decimal between 0...1 0.8
norotate If true or 1, model does not rotate false
scale Model scale, in percent 100
z Model z coordinate 75
style Additional canvas CSS style
class Additional canvas HTML class

Width and height can be set to 0 value, so size of viewer will be set according to user screen dimensions.


All default values can be changed in your LocalSettings.php file:

$wg3DAlloy["width"]  = 500;
$wg3DAlloy["height"] = 400;
$wg3DAlloy["class"]  = 'someclass';

Controls and hotkeys[edit]

Action Controls
Camera rotate Swipe, left mouse key hold and move
Camera pan Right key hold and move
Camera zoom Mouse wheel, hold wheel and move, pinch
Model rotate ←↑→↓ keys
Model rotation reset Home key
Model rotation play/pause Double click, double tap
Model rotation play/pause all models at page Enter, Space keys
Model rotation speed - and + keys

Hotkeys automatically disables while you edit or submit wiki page.