我正在尝试在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);结果,我在浏览器中看不到任何东西,除了背景图像。我做错了什么?
发布于 2019-09-16 17:44:15
React360 docs Entity page缺少导入部分。像在this blog中一样导入实体解决了这个问题。
import React from 'react';
import {
AppRegistry,
asset,
} from 'react-360';
import Entity from 'Entity';
...https://stackoverflow.com/questions/57953891
复制相似问题