Replies: 4 comments 8 replies
-
It is probably easier to do in JavaScript. For example, if you want your canvas to encompass the entire page, you can do something like the following. const handler = () => {
const dpr = window.devicePixelRatio;
const width = this.canvas.width = window.innerWidth * dpr;
const height = this.canvas.height = window.innerHeight * dpr;
myFilamentView.setViewport([0, 0, width, height]);
};
window.addEventListener('resize', handler); |
Beta Was this translation helpful? Give feedback.
-
@cx20 Thanks for your reply. canvas: (function() { I did this in the html file as generated by emscripten. But it is resized to the window size as created in my c++ application. |
Beta Was this translation helpful? Give feedback.
-
@cx20 Thanks much! |
Beta Was this translation helpful? Give feedback.
-
@cx20 , Suppose the triangle.glb is in cloud like a .tar.gz file, how do i decompress the contents and render it? I need a way to get a .gz file either through drag and drop or through URL and use browser api's to unzip with promise and then to transfer the Uint8Array to filament buffer Could you please help for this? |
Beta Was this translation helpful? Give feedback.
-
Could anyone help with resizing a canvas generated by emscripten?
I have a cpp file compiled using emscripten and it generates a html file with a canvas.
I do not know whether the resize needs to be done in javascript or in my main function using emscripten..
Can anyone help with this?
Beta Was this translation helpful? Give feedback.
All reactions