Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

CAMERA_DEPTH not working with mesh textures

in Questions Posts: 752

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


  • SimeonSimeon Admin Mod
    Posts: 5,202

    Ah it looks like CAMERA_DEPTH isn't supported on mesh

    However it is supported by sprite and craft.texture(CAMERA_DEPTH). Might need to ask @john for an example of how it can be used in Craft

  • Posts: 752
    Ok - that’s a shame
Sign In or Register to comment.