Skip to content

Commit

Permalink
Minor improvements to AR and Clipping & Blending (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeltalliv authored Apr 25, 2024
1 parent bca47b9 commit a6f5944
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docs/ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

## Requirements

- [ARCore](https://play.google.com/store/apps/details?id=com.google.ar.core)
- A mobile phone or tablet (augmented reality headsets are not supported yet)
- [ARCore](https://play.google.com/store/apps/details?id=com.google.ar.core) (if on Android)
- browser with [WebXR API and immersive-ar](https://immersive-web.github.io/webxr-samples/report/) session type support

At the moment of writing, only Chromium-based browsers support immersive-ar session type.
At the moment of writing, only Chromium-based browsers on Android support immersive-ar session type.

## Other information

Expand Down Expand Up @@ -91,7 +92,7 @@ This value will not change when entering AR.
(item [1] of [view v] matrix :: #d10000)
```

view matrix - is a matrix that can be used to transform points from the world space (relatively to the world origin) to the view space (with origin is at the camera). It includes rotation and translation of the camera.
view matrix - is a matrix that can be used to transform points from the view space (with origin is at the camera) to the world space (relatively to the world origin). It includes rotation and translation of the camera.

Also:

Expand All @@ -109,7 +110,8 @@ view[15] = position[z]

inverse view matrix = view matrix<sup>-1</sup>

Describes the opposite transformation to the view matrix.
Describes the opposite transformation to the view matrix: From the world space (relatively to the world origin) to the view space (with origin is at the camera).


---

Expand Down Expand Up @@ -186,6 +188,8 @@ screenY = y * negative_dist / z
```
combined matrix = projection matrix * inverse view matrix

Transforms positions from world space to view space, then to projected.

---

```scratch
Expand Down
2 changes: 1 addition & 1 deletion extensions/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
if (!supported) {
console.error(
(arFail =
"WebXR exists in the browser you are using, but 'immersive-ar' session type is not supported")
"WebXR exists in the browser you are using, but 'immersive-ar' session type is not supported (it can only work on mobile)")
);
} else {
arFail = null;
Expand Down
Binary file modified samples/Additive Fire.sb3
Binary file not shown.

0 comments on commit a6f5944

Please sign in to comment.