iamnick

Multi View Screenshots?

Recommended Posts

Me again!

I needed a solution to create a screen capture of multiple sides of an object, and I felt like multi view would have been perfect for this.  Except, the screen capture functions only take input from a single camera when in multi view situations you end up with an array of cameras w/ different viewport rects.  I've created a playground with the setup of what I'd like to do.

One thing to note, the GUI seems to display on all 4 views, and the only active button is the one in the upper right view.

Is there a better solution that i'm not seeing, or something that I can improve to make this work?

https://www.babylonjs-playground.com/#9DHWBU

Thanks!

Share this post


Link to post
Share on other sites

Hi @iamnick.  Are you wanting to make a screenshot from your whole canvas?  You can try converting it to a dataurl:

let dataURL = engine.getRenderingCanvas().toDataURL();
console.log(dataURL);

I believe the issue you are hitting is because the top right field may be the last activeCamera set, so is treated as the scene active camera.

Share this post


Link to post
Share on other sites
1 hour ago, kcoley said:

Hi @iamnick.  Are you wanting to make a screenshot from your whole canvas?  You can try converting it to a dataurl:


let dataURL = engine.getRenderingCanvas().toDataURL();
console.log(dataURL);

I believe the issue you are hitting is because the top right field may be the last activeCamera set, so is treated as the scene active camera.

@kcoley Indeed I would like to take a screenshot of the canvas as a whole but, similar to the CreateScreenshot method, I was hoping for the screenshot to be different dimensions than the canvas.

Updated my playground to include the DataURL screenshot button and logged some information about the cameras.

activeCamera is actually 'Camera0' which should be the top-left camera.  Still unsure why GUI is behaving the way it is.

https://www.babylonjs-playground.com/#9DHWBU#1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.