內容簡介
輕鬆地在 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)以獲取有關與這些互動的見解。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
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
