aframevr / aframevr/aframe

Screenshot size in VR Mode broken (?)

Open
#4,117 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description:

I'm currently trying to create programmatically a screenshot from a mobile device (in this case an Android device w/ Google Crome). Following the documentation I tried using the following code in html

<a-scene screenshot="width: 480; height: 360">

to set the desired dimension and then

var canvas = document.querySelector('a-scene').components.screenshot.getCanvas('perspective');
console.log(canvas.toDataURL("image/jpeg", 0.5))

While this works perfectly fine on desktop and mobile (not VR), in the VR mode the screenshot function actually captures the screen from the bottom left point of the canvas (0,0) to the size I specified (height: 360, width: 480)

Is this a desired behaviour? If so, how can I change my code to capture the canvas focusing the center of it?

  • A-Frame Version: 0.9.0
  • Platform / Device: Android

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the a-scene screenshot component and the getCanvas('perspective') entry point described in the report. Reproduce the configured 480x360 capture on Android in VR mode and compare its canvas origin with desktop and non-VR behavior. Done means the requested dimensions capture the centered view rather than the canvas's bottom-left region.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
ar-vr-xr, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.