lythreeframe 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.cjs.js
CHANGED
|
@@ -1664,9 +1664,16 @@ class Viewport {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
this.isRenderStateDirty = false;
|
|
1666
1666
|
}
|
|
1667
|
-
renderAsImage() {
|
|
1667
|
+
renderAsImage(width = 1024, height = 1024) {
|
|
1668
1668
|
this.render();
|
|
1669
|
-
|
|
1669
|
+
const offscreenCanvas = document.createElement('canvas');
|
|
1670
|
+
offscreenCanvas.width = width;
|
|
1671
|
+
offscreenCanvas.height = height;
|
|
1672
|
+
const context = offscreenCanvas.getContext('2d');
|
|
1673
|
+
if (context) {
|
|
1674
|
+
context.drawImage(this.renderer.domElement, 0, 0, width, height);
|
|
1675
|
+
}
|
|
1676
|
+
return offscreenCanvas.toDataURL('image/jpeg');
|
|
1670
1677
|
}
|
|
1671
1678
|
destroy() {
|
|
1672
1679
|
var _a;
|
|
@@ -2155,8 +2162,8 @@ class ThreeJsApp {
|
|
|
2155
2162
|
// }
|
|
2156
2163
|
this.camera.updateProjectionMatrix();
|
|
2157
2164
|
}
|
|
2158
|
-
renderAsImage() {
|
|
2159
|
-
return this.viewport.renderAsImage();
|
|
2165
|
+
renderAsImage(width = 1024, height = 1024) {
|
|
2166
|
+
return this.viewport.renderAsImage(width, height);
|
|
2160
2167
|
}
|
|
2161
2168
|
}
|
|
2162
2169
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1662,9 +1662,16 @@ class Viewport {
|
|
|
1662
1662
|
}
|
|
1663
1663
|
this.isRenderStateDirty = false;
|
|
1664
1664
|
}
|
|
1665
|
-
renderAsImage() {
|
|
1665
|
+
renderAsImage(width = 1024, height = 1024) {
|
|
1666
1666
|
this.render();
|
|
1667
|
-
|
|
1667
|
+
const offscreenCanvas = document.createElement('canvas');
|
|
1668
|
+
offscreenCanvas.width = width;
|
|
1669
|
+
offscreenCanvas.height = height;
|
|
1670
|
+
const context = offscreenCanvas.getContext('2d');
|
|
1671
|
+
if (context) {
|
|
1672
|
+
context.drawImage(this.renderer.domElement, 0, 0, width, height);
|
|
1673
|
+
}
|
|
1674
|
+
return offscreenCanvas.toDataURL('image/jpeg');
|
|
1668
1675
|
}
|
|
1669
1676
|
destroy() {
|
|
1670
1677
|
var _a;
|
|
@@ -2153,8 +2160,8 @@ class ThreeJsApp {
|
|
|
2153
2160
|
// }
|
|
2154
2161
|
this.camera.updateProjectionMatrix();
|
|
2155
2162
|
}
|
|
2156
|
-
renderAsImage() {
|
|
2157
|
-
return this.viewport.renderAsImage();
|
|
2163
|
+
renderAsImage(width = 1024, height = 1024) {
|
|
2164
|
+
return this.viewport.renderAsImage(width, height);
|
|
2158
2165
|
}
|
|
2159
2166
|
}
|
|
2160
2167
|
|