aframevr / aframevr/aframe

Changing style of a-scene from none to block breaks raycaster

Open
#4,230 0 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:
Loading a-scene with display = "none" and then changing the display = "block" seems like messing up with the event onMouseMove in cursor component. The value of direction passed to raycaster is NaN.

However, entering VR fixes that problem. Or exiting VR.

Also after some testing, if the scene is loaded with display = "block" and then toggled to none and back to block doesn't affect raycaster.

This seems to be the problem only if the scene is loaded under the tag style display = "none"

Check out the link here : https://circular-forger.glitch.me/
I'm working on a project which loads the scene and later with user interaction the scene is made visible.

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 by reproducing the linked Glitch example in Firefox with the a-scene initially set to display none, then trace cursor's onMouseMove handling and the direction passed to raycaster. Done means changing display from none to block produces a valid ray direction without entering or exiting VR, with a regression test covering the initial hidden-scene case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
computer-graphics, frontend, web-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.