ARKIT ARCamera zFar -
anyone know how change zfar or arkit arcamera? or current value of it.
i have large model thats being clipped. think. in blender had same issue , fixed setting far value on frustum.
i can create projection matrix each camera frame cant set it.
func session(_ session: arsession, cameradidchangetrackingstate camera: arcamera) { textmanager.showtrackingqualityinfo(for: camera.trackingstate, autohide: true) let projectionmatrix: matrix_float4x4 = camera.projectionmatrix(withviewportsize: camera.viewport.size, orientation: .portrait, znear: 0.1, zfar: 5000) //error - readonly camera.projectionmatrix = matrix_float4x4 ...
arcamera
has nothing rendering 3d virtual content. docs say, it's "information camera position , imaging characteristics captured video frame in ar session." is, provides data helps set whatever technology you're using render (be scenekit, custom renderer using metal, etc).
the camera.projectionmatrix(...)
method part of information-providing role — uses arkit knows orientation of physical device camera, plus znear , zfar values provide, construct matrix can use in renderer.
if you're using scenekit, can pass matrix scncamera
. (you need convert simd_float4x4
scnmatrix4
.) if you're using other renderer, can use matrix there.
Comments
Post a Comment