我在react-three-fiber中阅读了Canvas的官方文档。
official document of Canvas in react-three-fiber
画布的属性很少。我看到了一个人的项目。他在代码中使用了更多的属性,比如:
<Canvas
concurrent
noEvents={false}
pixelRatio={window.devicePixelRatio}
camera={{ position: [0, 0, 2.5], fov: 69 }}
gl={{ antialias: true }}
onCreated={({ gl, scene }) => {
gl.toneMapping = THREE.ACESFilmicToneMapping
gl.outputEncoding = THREE.sRGBEncoding
//scene.background = new THREE.Color('#373740')
}}>...</Canvas>那么,我如何才能知道react-three-fiber中关于Canvas的完整介绍呢?
发布于 2020-09-02 23:54:27
当您无法访问文档或源文件时,只需尝试使用console.log()将JavaScript对象输出到控制台。例如:
var c = <Canvas>...</Canvas>
console.log(c);然后打开您的开发人员控制台,您将看到一个对象,其中包含所有可用的属性、公共方法以及您可以访问的任何其他内容。
发布于 2021-01-09 20:50:12
请看一下GitHub上的文档。这里有一个专门用于Canvas组件的链接。
https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#canvas
本页介绍了react-three-fiber接口。
https://stackoverflow.com/questions/63691965
复制相似问题