PHPackages                             muqsit/gltfhandler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. muqsit/gltfhandler

ActiveMediawiki-extension[Image &amp; Media](/categories/media)

muqsit/gltfhandler
==================

Embed 3D GLTF models (.glb and .gltf files) on MediaWiki

v0.0.7(1y ago)21[1 issues](https://github.com/Muqsit/mediawiki-extensions-GLTFHandler/issues)GPL-2.0-or-laterPHP

Since Mar 21Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Muqsit/mediawiki-extensions-GLTFHandler)[ Packagist](https://packagist.org/packages/muqsit/gltfhandler)[ Docs](https://www.mediawiki.org/wiki/Extension:GLTFHandler)[ RSS](/packages/muqsit-gltfhandler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

GLTFHandler
===========

[](#gltfhandler)

GLTFHandler lets you upload and interact with GLTF models on MediaWiki. It uses [google/model-viewer](https://github.com/google/model-viewer) library to display the 3D models and optionally view them in your environment using augmented reality (on supported devices).

For developers, a documentation for the glTF parser can be found [here](src/Parser/README.md).

Motive
------

[](#motive)

Existing 3D extensions in the MediaWiki ecosphere do not support the glTF format which has become a standard for scenes and models. glTF libraries in PHP are lacking if not non-existent, requiring wiki maintainers to install third party libraries in addition to the extension for validating 3D assets. This makes the installation process inconvenient, and at times sufficiently challenging.

Features
--------

[](#features)

- Work out of the box—no dependency installation needed
- Support .gltf and .glb files
- Validate structure of .gltf and .glb files
- Bounding box calculation to properly size the output canvas
- Use [google/model-viewer](https://github.com/google/model-viewer) library to render 3D models, which supports all evergreen desktop and mobile browsers—Chrome, Firefox, Safari, and Edge.
- Allow custom output options for model-viewer (see [usage](#Usage))

Installation
------------

[](#installation)

Requires **MediaWiki 1.42.0** or later.

1. Download GLTFHandler extension. You can get the extension via Git (specifying GLTFHandler as the destination directory):

    ```
    git clone https://github.com/Muqsit/mediawiki-extensions-GLTFHandler.git GLTFHandler

    ```

    Or [download it as zip archive](https://github.com/Muqsit/mediawiki-extensions-GLTFHandler/archive/master.zip).

    In either case, the "GLTFHandler" extension should end up in the "extensions" directory of your MediaWiki installation. If you got the zip archive, you will need to put it into a directory called GLTFHandler.
2. Add the following code at the bottom of your LocalSettings.php:

    ```
    wfLoadExtension( 'GLTFHandler' );
    ```
3. ✔️**Done**—Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage
-----

[](#usage)

GLTFHandler uses the exact syntax as your ordinary media files:

```
[[File:MyModel.glb]]
[[File:MyModel.gltf]]
[[File:MyModel.glb|thumb|400px]]

```

At the moment, the following file parameters are supported. See [model-viewer documentataion](https://modelviewer.dev/docs/index.html) for live examples. All parameters are optional.

  Camera Properties   Parameter Description   `camera-orbit`  Set the starting and/or subsequent orbital position of the camera. You can control the azimuthal, theta, and polar, phi, angles (phi is measured down from the top), and the radius from the center of the model. Accepts values of the form "`$theta $phi $radius`", like `camera-orbit="-10deg 75deg 1.5m"`. Also supports units in radians (`rad`) for angles and centimeters (`cm`) or millimeters (`mm`) for camera distance. Camera distance can also be set as a percentage (`%`), where 100% gives the model tight framing within any window based on all possible theta and phi values.
 *Pertains to model-viewer's `camera-orbit` attribute.*    `max-camera-orbit`  Set the maximum orbital values of the camera. Takes values in the same form as `camera-orbit`.
 *Pertains to model-viewer's `max-camera-orbit` attribute.*    Skybox Properties   Parameter Description   `environment`  A .hdr or .jpg file. Controls the environmental reflection of the model.
 *Pertains to model-viewer's `environment-image` attribute.*    `skybox`  An equirectangular projection image (.png, .hdr, .jpg). Sets the background image of the scene.
 *Pertains to model-viewer's `skybox-image` attribute.*    `skybox-height`  Causes the skybox to be projected onto the ground plane. The height indicates the camera's distance above the ground and acts to scale the image at ground level to the correct size. Accepts units in meters (`m`), centimeters (`cm`), or millimeters (`mm`). The default value of `0m` disables ground projection.
 *Pertains to model-viewer's `skybox-height` attribute.*    Animation Properties   Parameter Description   `animation-name`  Selects an animation to play by name. If not specified, the first animation is implicitly selected.
 *Pertains to model-viewer's `animation-name` attribute.*    `autoplay`  If the model has animations, the selected animation will automatically begin to play.
 *Pertains to model-viewer's `autoplay` attribute.*    Other Properties   Parameter Description   `ar`  Enable the ability to launch AR experiences on supported devices.
 *Pertains to model-viewer's `ar` attribute.*    `poster`  An image file. Displays an image instead of the model, useful for showing the user something before a model is loaded and ready to render.
 *Pertains to model-viewer's `poster` attribute.*  Example usage of optional parameters:

```
[[File:MyModel.glb|ar|autoplay|environment=SomeEnvironment.png|poster=SomePoster.png]]
[[File:MyModel.glb|camera-orbit=-30deg 90deg 22|skybox=SomeSkybox.jpg|skybox-height=1.5m]]
[[File:MyModel.glb|autoplay|animation-name=Running]]

```

Limitations
-----------

[](#limitations)

- A glTF file containing a local or a remote URI is disallowed. This is both a safety mechanism (in case a local URI does not exist) and a security mechanism (to avoid loading unsafe assets at the user and the server's end).
- No thumbnail generation at its current stage. In short, by thumbnail we mean generating a preview image (e.g., a PNG) for the glTF model. Supporting this will most likely break portability of this extension. But this is much needed for 1) broader site accessibility, and 2) for OpenGraph tags as they do not support 3D assets in embeds.
- Limitations imposed by the [parser](src/Parser/README.md#Limitations).

Gallery
-------

[](#gallery)

 [![](https://private-user-images.githubusercontent.com/15074389/426179910-fcb849c2-d892-41cc-98aa-2fcb8af32877.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NjI3NDYsIm5iZiI6MTc3NTQ2MjQ0NiwicGF0aCI6Ii8xNTA3NDM4OS80MjYxNzk5MTAtZmNiODQ5YzItZDg5Mi00MWNjLTk4YWEtMmZjYjhhZjMyODc3LmdpZj9YLUFtei1BbGdvc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nbmVkSGVhZGVycz1ob3N0In0.kvIc63oklMcgvKy--wfPcRVw_LQRsSPNVDb2tjKjTpE) [![](https://private-user-images.githubusercontent.com/15074389/426177137-3235b111-cf74-433c-b5fd-d13177bcb9c5.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NjI3NDYsIm5iZiI6MTc3NTQ2MjQ0NiwicGF0aCI6Ii8xNTA3NDM4OS80MjYxNzcxMzctMzIzNWIxMTEtY2Y3NC00MzNjLWI1ZmQtZDEzMTc3YmNiOWM1LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDA4MDA0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZiYjBmMDFjZWY2ZWMwYjEyZDlmNGFjMjJjYzhhYjdmMWJkNTdjOTM3Y2M2OGEwMDVlZDE1YjBmNjRmYjUyMDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5-lP4VDrFcQ9HyRP7RZ9pjwa5ApWvGG0BRmwCQDCddw)](https://private-user-images.githubusercontent.com/15074389/426177137-3235b111-cf74-433c-b5fd-d13177bcb9c5.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NjI3NDYsIm5iZiI6MTc3NTQ2MjQ0NiwicGF0aCI6Ii8xNTA3NDM4OS80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zY5NDQ0ZTJjZDQ0MzQ1MjdhNDFkOTdiOGQxNjdlZTllMTFlOTA3ZjEzYmY2ZTVkNDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lkHYl4F01k10QnVHqCDU6pvRFPbGWeXiloKIpbAXpeA)](https://private-user-images.githubusercontent.com/15074389/426180676-7f9b2dcf-63bd-4279-bf03-1e227a58cd3c.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0NjI3NDYsIm5iZiI6MTc3NTQ2MjQ0NiwicGF0aCI6Ii8xNTA3NDM4OS80MjYxODA2NzYtN2Y5YjJkY2YtNjNiZC00Mjc5LWJmMDMtMWUyMjdhNThjZDNjLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDA4MDA0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ5MmU1NmNkYTIyMmEyMzY5NDQ0ZTJjZDQ0MzQ1MjdhNDFkOTdiOGQxNjdlZTllMTFlOTA3ZjEzYmY2ZTVkNDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lkHYl4F01k10QnVHqCDU6pvRFPbGWeXiloKIpbAXpeA)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

415d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/247134f60bf8c5c7c8a2f06b0ecea431a052614283aac5093b57bde51039e34a?d=identicon)[muqsit](/maintainers/muqsit)

---

Top Contributors

[![Muqsit](https://avatars.githubusercontent.com/u/15074389?v=4)](https://github.com/Muqsit "Muqsit (72 commits)")

---

Tags

3dextensionglbgltfmediamediawikiphpwikimediawikipediamediawikiextensiongltfglb

### Embed Badge

![Health badge](/badges/muqsit-gltfhandler/health.svg)

```
[![Health](https://phpackages.com/badges/muqsit-gltfhandler/health.svg)](https://phpackages.com/packages/muqsit-gltfhandler)
```

###  Alternatives

[christophlehmann/imageoptimizer

Optimize uploaded/processed images with binaries of your choice

46501.8k](/packages/christophlehmann-imageoptimizer)[laravel-admin-ext/media-player

Intergrates mediaelement into laravel-admin

3253.7k](/packages/laravel-admin-ext-media-player)[maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

1020.8k](/packages/maxmirazh33-yii2-uploadable-cropable-image)[abovesky/dcat-media-player

Dcat Admin 音视频预览扩展

202.3k](/packages/abovesky-dcat-media-player)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
