# Flat AR Expanding capacity

# Definition of method

6DoF - Flat AR Capabilities The ability of a variety of expansion capabilities, different capabilities can be combined.

  1. marker Recognition ability, that is, the recognition of multiple different recognition targets in plane space.
  2. (Not recommended for use, to be optimized) The ability of virtual occlusion, that is, the ability of interactive occlusion between virtual objects and the real world.

Need in V2 Open on a flat basis.

# marker Recognition ability

By configuring VKSession to hit the target marker Field enabled. Then consistent with the flow of use of ordinary markers, by session.addMarker, adding different recognition targets for identification. Sample code:

const session = wx.createVKSession({
  track: {
    plane: {
        mode: 1
    },
    marker: true,
  },
  version: 'v2'
})

// ... Initial session related process

// Add marker targets dynamically, using the same flow as normal Marker Consistent 
session.addMarker(filePath )

In this mode, marker After recognition, it will be placed in the world space of plane recognition. Allows the identification of multiple different identification targets at the same time. In the current version, the mode is suitable for static objects, and the frequency of object recognition updates is relatively slow. each 3s, not significantly moving will update the position, each 7s Will be re-tested.

# False occlusion Initialization on, does not support multi-extension mixing

Enabled by configuring the depth field in VKSession, Sample code:

const session = wx.createVKSession({
  track: {
    depth: { mode: 1 }
  },
  version: 'v2'
})

# False occlusion Dynamic opening and closing, support multi-extension mixing

let depthOpenFlag = true 
session.setDepthSwitch(depthOpenFlag) // Change Deep On State

// After the deep open state, it can be accessed by VKFrame Acquisition buffer
const frame = session.getVKFrame(this.canvas.width, this.canvas.height)
const depthBufferRes = frame.getDepthBuffer ()
// The specific depth of use can refer to the Mini Program example

# Application Scenario Examples

In plane mode, many marker Distinguish

plane+marker

# Program Examples

The above example can be found in [Horizontal plane + horizontal plane + Additional capacity Example](https://github.com/WeChat mini-program /miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/plane-ar-v2-options) Page to view the sample code.