- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 React VR 开发一个应用程序,并使用 blender 创建了一个 3D pokeball。我已将其导出为 Wavefront .obj
文件,并在我的 React VR 应用程序中使用它。
在控制台中我看到以下警告:
THREE.MeshBasicMaterial
:shininess
,emissive
andspecular
are not a property of this material.
您可以在下面找到我的代码:
import React from 'react';
import { AppRegistry, asset, StyleSheet, Pano, Text, View, Mesh } from 'react-vr';
class pokemongo extends React.Component {
render() {
return (
<View>
<Pano source={asset('sky.jpg')} />
<Mesh source={{ mesh: asset('pokeball.obj'), mtl: asset('pokeball.mtl') }}
style={{ height: 1 }}
transform={{ rotate: '0 90 0' }}></Mesh>
</View>
);
}
};
AppRegistry.registerComponent('pokemongo', () => pokemongo);
这是渲染的输出
然后this GitHub Gist您可以找到 obj
和 mtl
文件,并且可以下载 blend
文件。
在这里你可以在 Blender 中看到我的 Sprite 球。
我在互联网上搜索过,但没有找到与 React VR 相关的问题的解决方案或文档。
我做错了什么?
最佳答案
这在 react-vr > 0.2.1
中不再是一个问题,比如 Github issue州。
此外,如果您希望使用颜色和阴影渲染模型,则需要向场景应用一些灯光。这是通过在模型上启用 lit
属性并在您的模型中使用 AmbientLight
、SpotLight
或 DirectionalLight
组件来完成的。场景。
import React from "react";
import {
AppRegistry,
asset,
Pano,
View,
Model,
AmbientLight,
SpotLight
} from "react-vr";
class pokemongo extends React.Component {
render() {
return (
<View>
<Pano source={asset("chess-world.jpg")} />
<AmbientLight intensity={0.5} />
<SpotLight
intensity={1}
style={{ transform: [{ translate: [-5, 5, 0] }] }}
/>
<Model
source={{
obj: asset("pokeball.obj"),
mtl: asset("pokeball.mtl")
}}
style={{
layoutOrigin: [0.5, 0.5],
transform: [
{ translate: [0, 0, -10] }
]
}}
lit={true}
/>
</View>
);
}
}
AppRegistry.registerComponent("pokemongo", () => pokemongo);
对于旋转动画,您可以查看 ModelSample看看它是如何制作的。
关于blender - 在 React VR 中,光泽、自发光和镜面反射不是该 Material 的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42675253/
我想访问正在显示到窗口的像素数据,但我没有运气在光泽中找到这样的函数,也没有尝试在键盘事件回调中调用 OpenGL readPixels。看起来光泽度将图片渲染到窗口而不暴露渲染的位图。 如果这在光泽
我正在自定义UITabBar。我在 UITabBarItem 中使用了自定义图像。问题是元素上是否有渐变/光泽。我检查了苹果应用商店的 UITabBarItem 上没有任何这种光泽效果。如何从 UIT
以下是标准节标题 View 处理滚动/重叠的方式: 我试图用自定义节标题复制相同的行为,但我得到的只是: 似乎在默认行为中,底部标题 View 的顶部 1px 线与顶部标题 View 的底部 1px
我的应用程序日志中有此错误: sqlite3.OperationalError: database or disk is full 由于有足够的磁盘空间可用并且我的 SQLite 数据库似乎没有损坏(
我正在尝试将以下 JSON 发布到 api。以下是来自 Xcode 控制台的日志。 { address = ( { city = 1;
仅使用直接的 html 和 css 如何使背景网页颜色和图像看起来有光泽/光泽? 我不是谈论在两种不同颜色之间制作渐变而是向标准十六进制颜色和图像添加光泽(或发光)外观。 类似于透明涂层对车辆油漆工作
我正在使用 React VR 开发一个应用程序,并使用 blender 创建了一个 3D pokeball。我已将其导出为 Wavefront .obj 文件,并在我的 React VR 应用程序中使
我是一名优秀的程序员,十分优秀!