[WordPress] 外掛分享: Threepress

首頁外掛目錄 › Threepress
200+
安裝啟用
★★★★
4.8/5 分(5 則評價)
156 天前
最後更新
問題解決
WordPress 4.0+ PHP 5.6+ v1.8.5 上架:2021-05-19

內容簡介

輕鬆地在 WordPress 中嵌入 three.js

您可以做什麼:
在任何地方創建 three.js 圖庫

使用 Threepress 管理員中的短代碼生成器創建圖庫,然後將短代碼貼到您想要的任何位置 – 渲染短代碼的 JavaScript 會載入所有公共頁面。

一個圖庫渲染一個 three.js 場景。

要自定義圖庫的佈局或尺寸,請使用 CSS。一個類似 #threepress-gallery- 的 ID 標籤會放置在 <canvas> 元素的包裝器上,或使用 .threepress-gallery / .threepress-gallery canvas 類來定位所有的圖庫。

圖庫渲染程序(three.js 物件)應自動調整以匹配您給定的尺寸,以防止扭曲或模糊。

如果您想要自定義編碼您自己的圖庫,請向下滾動到「JavaScript 開發人員」。

注意事項

所有模型必須採用「.glb」格式 – 大多數 3D 程序可以導出此格式。

它們與其他所有內容一樣存儲在媒體庫中,但可以通過簡單過濾「.glb」擴展名的 Threepress 库輕鬆找到。

對於 JavaScript 開發人員:

在給定頁面上的所有圖庫都可以在全局變數 THREEPRESS 的 galleries 屬性中使用。請參閱 Gallery 類(static/js/ThreepressGallery.js)以獲取有關與這些互動的見解。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.8.5) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Threepress」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Easily embed three.js in WordPress
What you can do:
Create three.js galleries anywhere
Create galleries using the shortcode generator in the Threepress admin, and then paste the shortcode wherever you want – the javascript that renders the shortcodes is loaded on all public pages.
A gallery renders one three.js Scene.
To customize the layout or dimensions of your gallery, use CSS. An id tag of form #threepress-gallery- is put on the wrapper of the element, or use class .threepress-gallery / .threepress-gallery canvas to target all galleries.
The gallery renderer (three.js object) should adjust to match your given dimensions automatically to prevent skewing or blurring.
If you want to custom code your own gallery, scroll down to ‘javascript devs’.
Notes
All models must be in “.glb” format – most 3d programs can export to this.
They are stored in the Media Library like everything else, but can be found easily through the Threepress library, which simply filters for “.glb” extensions.
For javascript devs:
All the galleries on a given page will be available in the global variable THREEPRESS, in the galleries property. See the Gallery class (static/js/ThreepressGallery.js) for insight on interacting with these.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon