我不明白 a-frame 中的 "entity camera" 行代码

I do not understand the "entity camera" line of code in a-frame

我无法理解用户的摄像机如何参与 AR。js/a-frame 过程。具体来说,下面这一行:

<a-entity id="camera" camera></a-entity>

让我很困惑。它到底有什么作用?当我将其注释掉时,我的网络摄像头仍在填充场景,(这是因为场景标签中的“嵌入式 arjs”声明吗?)而且我的 3d 模型没有显示在标记之上(同样,当我评论时那条线)。 我只是想更好地了解事物。 完整代码如下:

<a-scene id="container" embedded arjs>
    <a-marker preset='custom' type='pattern' url='assets/pattern-gimmelogo2.patt'>
        <a-entity
                position="0 -1 0"
                scale="10 10 10"
                gltf-model="assets/gpaglb.glb"
                id="glb"
                animation="property: rotation; to: 0 360 0; loop: true; dur: 10000"
        ></a-entity>
    </a-marker>
    <a-entity id="camera" camera></a-entity>
</a-scene>

关于相机,这里的文档中解释了发生了什么:

https://aframe.io/docs/1.2.0/components/camera.html#default-camera

"如果没有指定摄像头,A-Frame会注入一个默认摄像头:

<a-entity camera="active: true" look-controls wasd-controls position="0 1.6 0" data-aframe-default-camera></a-entity>

如果指定了摄像头(例如我们自己的<a-camera><a-entity camera>),则不会添加默认摄像头。

我不太明白问题的第二部分。也许你可以 post 显示问题的故障?问题可能出在资产上,而不是您 posted.

的代码