Extension:3DAlloy/cs

Category:MIT licensed extensions/cs
Příručka k rozšířením MediaWiki
3DAlloy
Stav rozšíření: stabilníCategory:Stable extensions/cs
Implementace Funkce analyzátoru Category:Parser function extensions/cs, Značka Category:Tag extensions/cs, ContentHandler Category:ContentHandler extensions/cs, Označení odkazu Category:Link markup extensions/cs
Popis Adds support of 3D files viewing at your MediaWiki
Autoři Dolfinus
Nejnovější verze 1.7 (2023-10-17)
MediaWiki 1.25+Category:Extensions with manual MediaWiki version
Změny v databázi Ne
Licence Licence MIT
Stáhnout Category:Extensions in GitHub version control/cs (for MW 1.33 and below use mw-1.33 branch)
README
Příklad Příklad 3D prohlížeče na stránce souboru
$wg3DAlloy
<3d>
Category:All extensions/cs

Description

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

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

Install

  • Download soubor/y a vložte je do adresáře pojmenovaného 3DAlloy ve vaší složce extensions/.
  • Na konec vašeho souboru LocalSettings.php přidejte následující kód:
    wfLoadExtension( '3DAlloy' );
    
  • Modify $wgFileExtensions parameter:
$wgFileExtensions = array_merge(
  $wgFileExtensions, array(
      'json', '3dj', '3djson', 'three',
      'buff', 'buffjson',
      'obj',
      'stl', 'stlb'
  )
);
  • Yes Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.

Usage

As Image Handler

[[File:Model.json|300x300px|color=,opacity=,...]]

As Parser function

{{#3d:Model.json}}
{{#3d:Model.json|width}}
{{#3d:Model.json|width|height}}
...
{{#3d:Model.json|width|height|color|opacity|zoom|pan|norotate|scale|z|style|class}}

Instead of uploaded filename you can use a URL for file located in external site.

As Parser tag

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

or

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

You also can use url instead of short filename.

Parameters

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
zoom If true or 1, canvas can be zoomed false
pan If true or 1, canvas can be panned false
norotate If true or 1, model does not rotate false
scale Model scale as decimal between 0...1 1
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.

Configure

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

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

Controls and hotkeys

Action Controls
Camera rotate Swipe, left mouse key hold and move
Camera zoom (if zoom enabled) Mouse wheel, hold wheel and move, pinch
Camera pan (if pan enabled) Right key hold and move
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.

Category:3D extensions/cs
Category:3D extensions/cs Category:All extensions/cs Category:BeforePageDisplayMobile extensions/cs Category:BeforePageDisplay extensions/cs Category:ContentHandler extensions/cs Category:Extensions in GitHub version control/cs Category:Extensions with manual MediaWiki version Category:ImageBeforeProduceHTML extensions/cs Category:ImageOpenShowImageInlineBefore extensions/cs Category:Link markup extensions/cs Category:MIT licensed extensions/cs Category:ParserFirstCallInit extensions/cs Category:ParserMakeImageParams extensions/cs Category:Parser function extensions/cs Category:Stable extensions/cs Category:Tag extensions/cs