I can’t seem to get the depth camera working with textures (it only seems to work with sprite as a live feed). Here is a small example which should swap between both camera views - the depth one doesn’t seem to render. Anyone had any experience with this or can point to what I’m doing wrong
-- CAMERA_DEPTH test
displayMode(FULLSCREEN)
-- Use this function to perform your initial setup
function setup()
cameraSource(CAMERA_FRONT)
-- Create a mesh
m=mesh()
mode=1
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
text("Tap to switch between Normal and Depth camera",WIDTH/2,HEIGHT/2)
m:draw()
end
function touched(t)
if t.state==ENDED then
--create a rectangle
m.vertices = {vec3(0,0,0),vec3(WIDTH,0,0),vec3(WIDTH,HEIGHT,0),vec3(0,0,0),vec3(WIDTH,HEIGHT,0),vec3(0,HEIGHT,0)}
--add texture coordinates
m.texCoords={vec2(0,0),vec2(1,0),vec2(1,1),vec2(0,0),vec2(1,1),vec2(0,1)}
--set the texture to either the camera or depth camera
if mode==1 then
m.texture=CAMERA
else
m.texture=CAMERA_DEPTH
end
mode=mode*-1
end
end