Erweiterung:3DAlloy

From mediawiki.org
This page is a translated version of the page Extension:3DAlloy and the translation is 57% complete.
MediaWiki-Erweiterungen
3DAlloy
Freigabestatus: stabil
Einbindung Parser-Funktion , Tag , ContentHandler , Link-Markup
Beschreibung Fügt Unterstützung für die Anzeige von 3D-Dateien in deinem MediaWiki hinzu
Autor(en) Dolfinus
Letzte Version 1.7 (2023-10-17)
MediaWiki 1.25+
Datenbankänderungen Nein
Lizenz MIT-Lizenz
Herunterladen (for MW 1.33 and below use mw-1.33 branch)
README
Beispiel Example of 3D Viewer at file page
$wg3DAlloy
‎<3d>

Beschreibung

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.

Unterstützte Dateierweiterungen

THREE.js-Modellformat:

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

THREE.js-Modellpuffer-Geometrieformat:

  • .buff
  • .buffjson

OBJ-Dateiformat:

  • .obj

STL-(Binär-)Dateiformat:

  • .stl
  • .stlb

Installation

$wgFileExtensions = array_merge(
  $wgFileExtensions, array(
      'json', '3dj', '3djson', 'three',
      'buff', 'buffjson',
      'obj',
      'stl', 'stlb'
  )
);
  • Yes Erledigt – Zu Special:Version in dem Wiki (bei Einstellung auf deutsch nach Spezial:Version) navigieren, um die erfolgreiche Installierung der Erweiterung zu überprüfen.

Verwendung

As Image Handler

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

Als Parser-Funktion

{{#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 an url for file located in external site.

Als Parser-Tag

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

or

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

Du kannst auch url statt eines kurzen Dateinamens verwenden.

Parameter

Name Beschreibung Default value
width Canvasbreite in Pixel 300
height Canvashöhe in Pixel 300
color Modell-RGB-Farbe in hex 0xff00ff
opacity Modelldeckkraft als Dezimalzahl zwischen 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 Modell-Z-Koordinate 75
style Additional canvas CSS style
class Weitere Canvas-HTML-Klasse

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

Konfigurieren

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

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

Steuerung und Hotkeys

Action Controls
Kameradrehung Swipe, left mouse key hold and move
Kamerazoom (falls der Zoom aktiviert ist) Mouse wheel, hold wheel and move, pinch
Camera pan (if pan enabled) Right key hold and move
Model rotate ←↑→↓-Tasten
Model rotation reset Home key
Model rotation play/pause Doppelklick, doppelt tippen
Model rotation play/pause all models at page Enter-, Leerzeichen-Tasten
Model rotation speed - und +-Tasten

Hotkeys automatically disables while you edit or submit wiki page.