Skip to content

Commit

Permalink
add keyboard positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
cabanier committed Nov 11, 2022
1 parent 4ff94eb commit 7f95862
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system-keyboard.html
Original file line number Diff line number Diff line change
@@ -62,6 +62,7 @@
let xrRefSpace = null;
let xrGLFactory = null;
let xrFramebuffer = null;
let counter = 0;

// WebGL scene globals.
let gl = null;
@@ -162,7 +163,7 @@
currentFillStyle = fillStyles[Math.floor(Math.random() * fillStyles.length)];
};
document.body.appendChild(textField);

canvas = document.createElement('canvas');
canvas.width = cyldTextureWidth;
canvas.height = cyldTextureHeight;
@@ -198,6 +199,10 @@
let pose = frame.getViewerPose(xrRefSpace);
xrSession.requestAnimationFrame(onXRFrame);

if (xrSession.positionKeyboard) {
xrSession.positionKeyboard(counter++/100, 1);
}

renderingContext = canvas.getContext('2d');
renderingContext.font = '48px serif';
renderingContext.fillStyle = currentFillStyle;

0 comments on commit 7f95862

Please sign in to comment.