【发布时间】:2020-01-17 02:47:32
【问题描述】:
我正在尝试在 react360 项目中使用 3d 对象。我按照setup docs 中的步骤操作。使用react-360 init Hello360 命令创建了一个项目,并使用npm start 启动了服务器。
另外,下载this obj model,放入static_assets文件夹。然后,将Entity 标签放入index.js 以显示对象。整个index.js如下。
import React from 'react';
import {
AppRegistry,
Entity,
asset
} from 'react-360';
export default class Hello360 extends React.Component {
render() {
return (
<Entity source={{ obj: asset('stickman.obj') }} />
);
}
};
AppRegistry.registerComponent('Hello360', () => Hello360);
因此,我在浏览器中除了背景图像之外什么都看不到。我做错了什么?
【问题讨论】: