Skip to content

Added CSS3D + WebGL example. #31572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Added CSS3D + WebGL example. #31572

wants to merge 2 commits into from

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Aug 5, 2025

Description

Added an example mixing CSS3D and WebGL. Not sure if it's the simplest approach though...

https://raw.githack.com/mrdoob/three.js/128860b66f0c250af933714fc7f77a03ef0b06d7/examples/css3d_mixed.html

Screenshot 2025-08-05 at 9 37 22 PM

@mrdoob mrdoob added this to the r180 milestone Aug 5, 2025
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 6, 2025

I have noticed the following errors in the browser console:

[Violation] Potential permissions policy violation: fullscreen is not allowed in this document.
[Violation] Potential permissions policy violation: xr-spatial-tracking is not allowed in this document.

They appear not just with rawgit but also when running the demo locally (with HTTPS). It seems it's possible to prevent them locally by adding this line when creating the iFrame.

iframe.allow = 'fullscreen;xr-spatial-tracking';

I wonder why they appear in the first place. Does the browser analyze the JS and realize the engine could make use of WebXR?

@mrxz
Copy link
Contributor

mrxz commented Aug 6, 2025

I wonder why they appear in the first place. Does the browser analyze the JS and realize the engine could make use of WebXR?

I believe it's caused by the fact that the Three.js examples page tries to allow the inner iframe both fullscreen and xr-spatial-tracking (examples/index.html#L41). But in this example, it itself is in an iframe that isn't allowed these permissions, so it can't pass these on or grant them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants