Skip to content

Commit

Permalink
Fix webxr (#1674)
Browse files Browse the repository at this point in the history
* fix: flipY in webxr

* chore: commit changeset
  • Loading branch information
xiaoiver authored Apr 28, 2024
1 parent 5a09d9c commit 0a1855c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-years-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/g-plugin-device-renderer': patch
---

FlipY in webar.
4 changes: 3 additions & 1 deletion __tests__/demos/3d/webar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { ARButton, DeviceRenderer } from '../../../packages/g-webgl';
export async function ar(context) {
const { canvas, renderer, container } = context;

// renderer.getConfig().enableDirtyCheck = false;

// wait for canvas' initialization complete
await canvas.ready;

Expand Down Expand Up @@ -52,7 +54,7 @@ export async function ar(context) {
canvas.appendChild(cube);

canvas.addEventListener(CanvasEvent.AFTER_RENDER, () => {
cube.rotate(1, 0, 0);
cube.rotate(0, 0, 0);
});

canvas.getConfig().disableHitTesting = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/g-plugin-device-renderer/src/RenderGraphPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class RenderGraphPlugin implements RenderingPlugin {
// @ts-ignore
const cameraMatrix = mat4.fromValues(...view.transform.matrix);
cameraMatrix[12] *= width;
cameraMatrix[13] *= height;
cameraMatrix[13] *= -height;
cameraMatrix[14] *= 500;

cameraMatrix[12] += width / 2;
Expand Down

0 comments on commit 0a1855c

Please sign in to comment.