Notebook - Welcome to Notebook

Contact/Report Bugs
You can contact me at: bkenwright@xbdev.net












console log navigator xr let res await navigator xr isSessionSupported immersive vr console log res let res await navigator xr isSessionSupported immersive ar console log res let res await navigator xr isSessionSupported inline console log res for key in navigator xr console log key navigator xr key without await let session navigator xr requestSession inline console log Promise session instanceof Promise console log session with await let session await navigator xr requestSession inline console log Promise session instanceof Promise console log session Calling requestSession starts a request and returns a promise When the request completes the promise resolves to the response object From the response object you can extract data you need to proceed Because requestSession returns a promise you can simplify the code by using the async await syntax session await navigator xr requestSession The await waits until ready then returns the final object not the Promise let session await navigator xr requestSession inline console log session for key in session if key depthUsage continue if key depthDataFormat continue console log key session key navigator xr requestSession inline then session xrSession session continue to set up the session console log xrSession for key in xrSession console log key xrSession key let xrSession await navigator xr requestSession inline console log xrSession let res await xrSession requestAnimationFrame onXRFrame console log res function onXRFrame t frame console log frame document body style height 200px let xrSession await navigator xr requestSession inline console log xrSession function onXRFrame t frame console log frame frame xrSession requestAnimationFrame onXRFrame let glLayer xrSession renderState baseLayer gl clearColor 0 0 0 1 0 gl clearDepth 1 0 gl clear gl COLOR BUFFER BIT gl DEPTH BUFFER BIT let canvas document createElement canvas canvas style width 100px canvas style height 100px document body appendChild canvas console log canvas canvas let gl canvas getContext webgl xrCompatible true console log gl gl let glLayer new XRWebGLLayer xrSession gl console log glLayer glLayer let rs await xrSession updateRenderState baseLayer glLayer console log rs let refSpace await xrSession requestReferenceSpace viewer console log refSpace refSpace let res xrSession requestAnimationFrame onXRFrame console log res document body style height 200px Obtain XR object const XR navigator xr Request a new XRSession XR requestSession inline then xrSession xrSession requestAnimationFrame time xrFrame console log here let viewer xrFrame getViewerPose xrReferenceSpace gl bindFramebuffer xrWebGLLayer framebuffer for xrView of viewer views let xrViewport xrWebGLLayer getViewport xrView gl viewport xrViewport x xrViewport y xrViewport width xrViewport height WebGL draw calls will now be rendered into the appropriate viewport let count 0 let xrSession null document body style height 200px let canvas document createElement canvas canvas style width 100px canvas style height 100px document body appendChild canvas console log canvas canvas let gl canvas getContext webgl xrCompatible true console log gl gl function onWindowAnimationFrame time window requestAnimationFrame onWindowAnimationFrame count This may be called while an immersive session is running on some devices such as a desktop with a tethered headset To prevent two loops from rendering in parallel skip drawing in this one until the session ends if xrSession renderFrame time null if count 5 console log nonXRFrame The window animation loop can be started immediately upon the page loading window requestAnimationFrame onWindowAnimationFrame function onXRAnimationFrame time xrFrame xrSession requestAnimationFrame onXRAnimationFrame console log xrFrame xrFrame renderFrame time xrFrame function renderFrame time xrFrame gl clearColor 0 1 0 1 0 gl clearDepth 1 0 gl clear gl COLOR BUFFER BIT gl DEPTH BUFFER BIT if count 5 console log renderFrame count Assumed to be called by a user gesture event elsewhere in code function startXRSession console log startXRSession called navigator xr requestSession inline then session xrSession session console log xrSession xrSession xrSession addEventListener end onXRSessionEnded Do necessary session setup here Begin the sessions animation loop console log Begin the sessions animation loop count 0 xrSession requestAnimationFrame onXRAnimationFrame function onXRSessionEnded xrSession null let button document createElement button button innerHTML startXRSession button onclick function startXRSession document body appendChild button

ion requestAnimationFrame onXRFrame console log res document body style height 200px Obtain XR object const XR navigator xr Request a new XRSession XR requestSession inline then xrSession xrSession requestAnimationFrame time xrFrame console log here let viewer xrFrame getViewerPose xrReferenceSpace gl bindFramebuffer xrWebGLLayer framebuffer for xrView of viewer views let xrViewport xrWebGLLayer getViewport xrView gl viewport xrViewport x xrViewport y xrViewport width xrViewport height WebGL draw calls will now be rendered into the appropriate viewport let count 0 let xrSession null document body style height 200px let canvas document createElement canvas canvas style width 100px canvas style height 100px document body appendChild canvas console log canvas canvas let gl canvas getContext webgl xrCompatible true console log gl gl function onWindowAnimationFrame time window requestAnimationFrame onWindowAnimationFrame count This may be called while an immersive session is running on some devices such as a desktop with a tethered headset To prevent two loops from rendering in parallel skip drawing in this one until the session ends if xrSession renderFrame time null if count 5 console log nonXRFrame The window animation loop can be started immediately upon the page loading window requestAnimationFrame onWindowAnimationFrame function onXRAnimationFrame time xrFrame xrSession requestAnimationFrame onXRAnimationFrame console log xrFrame xrFrame renderFrame time xrFrame function renderFrame time xrFrame gl clearColor 0 1 0 1 0 gl clearDepth 1 0 gl clear gl COLOR BUFFER BIT gl DEPTH BUFFER BIT if count 5 console log renderFrame count Assumed to be called by a user gesture event elsewhere in code function startXRSession console log startXRSession called navigator xr requestSession inline then session xrSession session console log xrSession xrSession xrSession addEventListener end onXRSessionEnded Do necessary session setup here Begin the sessions animation loop console log Begin the sessions animation loop count 0 xrSession requestAnimationFrame onXRAnimationFrame function onXRSessionEnded xrSession null let button document createElement button button innerHTML startXRSession button onclick function startXRSession document body appendChild button

3dplot
about
acejs
acejs2
acejs3
aessecurity
angularjs
assert
backgrounds01
backgrounds02
backgrounds03
base26
base64
bib
binary
bodypix
bouncy
box2dweb
browserversion
buslanes
bvhreader
calendar
canvas
canvas2
canvas3
canvasmandelbrot
canvasmandelbrot2
canvaszoom
capsule
changingimages
checkboxtoggle
chinesetiles
classes
classfeatures
clonenode
codemirror
collada
colorpick
columnresizer
contextmenu
convnet
cookiebanner
countdown
countdown2
countdown3
crop
css3dbarchart
css3dbarchart2
css3dbook
css3dscene
csscube
csscube2
csscube3
csscubevideos
cssfilelist
csspulse
cssresizeaspect
cssspin
csszooming
csvtoarray
customcheckbox
d3datamap
d3js
d3js10
d3js11
d3js2
d3js3
d3js4
d3js5
d3js6
d3js7
d3js8
d3js9
d3jsanimatedgrid
d3jsarctransition
d3jsarctransition2
d3jsaxis
d3jsaxischanging
d3jsbars
d3jsbrushing
d3jsbuslanes
d3jsbuslanes2
d3jscalendar
d3jscheat
d3jsclock
d3jscloudmap
d3jscogs
d3jscolors
d3jscovid
d3jscovid2
d3jscovid3
d3jsdashboard
d3jsdashboard2
d3jsdashboard3
d3jsdatakeyfunction
d3jsdensity
d3jsdragresizing
d3jsdragresizing2
d3jseach
d3jsease
d3jsevents
d3jsflower
d3jsforcegroups
d3jsforces
d3jsforces2
d3jsfractaltree
d3jsgeo
d3jsgroupbars
d3jsgroups
d3jsheatmap
d3jshex
d3jshierarchies
d3jshierarchies2
d3jshistogram
d3jshistogram2
d3jshistogram3
d3jshistogram4
d3jsinterpolate
d3jsjoin
d3jskmean
d3jskmean2
d3jsline
d3jsline2
d3jsline3
d3jsline4
d3jslinetransition
d3jslinetransition0
d3jslinetransition2
d3jsmaps
d3jsmaps2
d3jsmaps3
d3jsmisc
d3jsmisc2
d3jsmodule
d3jsmodulecolor
d3jsmultistyles
d3jsnobel
d3jsoverlappinggraphs
d3jspanel
d3jspie
d3jspieinterpolate
d3jssankey
d3jssankey2
d3jsscatter
d3jsshapes
d3jsslider
d3jsspending
d3jsspending2
d3jsspiralplot
d3jsspirograph
d3jssquare
d3jsstack
d3jsstackedbar
d3jsstackedbar2
d3jssunburst
d3jssunmoon
d3jssvglines
d3jssymbols
d3jstimelines
d3jsuk
d3jsvoronoi
d3timeline
d3timeline2
datalist
datamuse
date
dblclickhighlight
deviceorientation
dictionaryapi
dockermenu
doodlepad
downloadgif
dragrotateresizediv
dragrotateresizediv2
dragrotateresizediv3
dragrotateresizediv4
dragselectbrush
drawlinesdiv
dropdown
dynamicgrid
easefunctions
easeinterpolate3dplots
echart
echart2
echart3
encapsulation
epubviewer
errorstack
expandable
faker
fetchplus
fileupload
fixedtopbar
fonts
fonts2
footerbar
fractals
fractals2
fractaltree
freesvg
fresnel
gantt
gifgiphyapi
gltffromscratch
gradients
griditems
griditems2
griditems3
griditems4
gridworms
heat
highlight
icons
icons2
iframes
ik
imagetracertosvg
imgur
inputfile
isbn13
isbn2
jquery
jqueryui
jqueryui2
jsdraganddrop
jslint
jsobfuscate
jsraytracer
jszip
keyframes
l2dwidget
lda
leftmenu
less
lineargradientimage
linenumbers
loadimagefromfile
makepdf
maps
markdown
markdown2
markdownalerts
mathjax
matrices
matsandvects
md2tex
metrotiles
metrowindows
milestones
misc
misc2
modules
myipdetails
neataptic
number
obj
objtojson
opencv
opencv2
opencv3
opencv4
opencv5
outline
p2
p5fractalleaf
p5fractalshape
p5js
p5js2
p5js3
p5mengercube
p5snowflakes
palindrome
panel
parallax
paste
paste2
pasteimgfromurl
pdfjs
pdfjs2
pdfkit
pdfkit2
pdfkit3
pdfkit4
pdfkit5
pdfkit6
pdfmake
pdfmake2
pdfmake3
pdfmake4
pdfmake5
pdfmake6
perlin
perlin2
perlin3
perspective
pexels
playground
plotly
plotlynoise
plotlyranddist
pngtxtencoder
pptxgenjs
prism
prn
problems
progress
python
quotes
racergame
random
randomprofilepatterns
randomstring
rating
rayambient
raymonte
raymonteprogressive
raymonteprogressive2
raymontewarmstart
reexpcross
reexpcross2
regex
regexbib
repeatwordsregexp
resizabletable
resizabletable2
revealjs
revealjs2
revealjsmulti
ritalanguage
ritalanguage2
ritalanguage3
rotateimg
rough
rsapublicprivatekeys
rss
rss2
scrappingsvg
scrolltext
scrolltext2
scrollwidth
setintervalexception
shareurl
shuffle
sidecomment
similarity
sinecanvas
sliderpopout
slides
smileys
snowman
sound
soundsignal
sphererayintersection
springs
sqljs
steganography
stringmatching
svg
svgdragresize
svgdragresize2
svgdragresize3
svgdragrotate
svgdrawing
svglines
svglines2
svglines3
svglines4
svglines5
svglinesmandelbrot
svgpathsdragrotate
svgpathsdragrotateresize
svgpie
svgpie2
svgpie3
svgpiepath
svgpiepath2
symbols
synaptic
synaptic2
synonyms
tablerotatecells
tablerotatecells2
tablerotatecells3
tablerotatecells3b
tablerotatecells4
tables
tablezebra
tagcanvas
tetris
textarea
textareadiv
textareadiv2
textmaskimage
theirorthere
thesaurus
threejs
threejs2
threejs3
threejs4
threejsgltf
threejstokyo
tiles
toaster
tooltip
transition
transitionexpandabledropdown
treeview
treeview2
tricks
tshirt
tshirt2
tshirt3
turningpages
unsplash
userdefinepoints
vector
videos
videos2
visualsort
vue
w2ui
w2uientertextdialog
webcam
webgl
webgl2
webgl3
webgl4
webgl5
webglbasic1
webglbasic2
webglcube
webglfov
webglfrustum
webgljson
webglleaves
webgllighting
webglorthographic
webglpoints1
webglpoints2
webglpoints3
webglsquare
webgltexture1
webgltexture2
webgltexture3
webgltransforms
webgltriangle
webgpu
webgpu10
webgpu11
webgpu12
webgpu13
webgpu14
webgpu15
webgpu16
webgpu17
webgpu2
webgpu3
webgpu4
webgpu5
webgpu6
webgpu7
webgpu8
webgpu9
webgpubars
webgpubuffers
webgpubuffers2
webgpucellnoise
webgpuclouds
webgpuclydescope
webgpucompute
webgpucubemap
webgpucubemap2
webgpudeferred
webgpudepth
webgpudof
webgpudrops
webgpuetha
webgpufire
webgpufractalcubes
webgpuglassrain
webgpugltf
webgpugltf2
webgpugrass
webgpugrid
webgpukernel
webgpukleinian
webgpulabupdates
webgpulighting
webgpumandelbrot
webgpumeta3d
webgpumetaballs
webgpumouse
webgpunoise
webgpunormalmapping
webgpuobj
webgpuparallax
webgpuparallax2
webgpuparallax3
webgpuparallaxshadow
webgpuparallaxshadow2
webgpupixel
webgpuquad
webgpuray1
webgpuraytracing
webgpuraytracing2
webgpushadowmaps
webgpushadowmaps2
webgpusierpinski2d
webgpusierpinski3d
webgpusinusoid
webgpussao
webgpustadiumobj
webgpuswirl
webgputestpipe3
webgputoon
webgputopology
webgputt
webgpuvolcloud
webgpuwater
webgpuwireframe
webgpuwireframe2
webpcanvas
webworkers
webxr
webxr2
wiggly
wikipedia