Javascript React-360摄像头在视图中的位置
与渲染视图相比,我希望将摄影机视图设置得更高。但我不知道在渲染视图时在哪里可以设置初始摄影机位置 我的组件是这样安装的:Javascript React-360摄像头在视图中的位置,javascript,css,reactjs,react-native,react-360,Javascript,Css,Reactjs,React Native,React 360,与渲染视图相比,我希望将摄影机视图设置得更高。但我不知道在渲染视图时在哪里可以设置初始摄影机位置 我的组件是这样安装的: import {ReactInstance} from 'react-360-web'; function init(bundle, parent, options = {}) { const r360 = new ReactInstance(bundle, parent, { // Add custom options here fullScreen:
import {ReactInstance} from 'react-360-web';
function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
...options,
});
// Render your app content to the default cylinder surface
r360.renderToSurface(
r360.createRoot('Hello360', { /* initial props */ }),
r360.getDefaultSurface()
);
}
window.React360 = {init};
export default class Hello360 extends React.Component {
// Our component will keep track of this state
state = {
count: 0,
};
render() {
return (
<View style={styles.panel}>
<View style={styles.greetingBox}>
<Text style={styles.greeting}>
Hello React
</Text>
<Text style={styles.greeting}>
{`Count: ${this.state.count}`}
</Text>
</View>
</View>
);
}
};
const styles = StyleSheet.create({
panel: {
// Fill the entire surface
width: 1000,
height: 600,
backgroundColor: 'rgba(255, 255, 255, 0.4)',
alignItems: 'center',
justifyContent: 'center'
}
});
AppRegistry.registerComponent('Hello360', () => Hello360);
组件如下所示:
import {ReactInstance} from 'react-360-web';
function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
...options,
});
// Render your app content to the default cylinder surface
r360.renderToSurface(
r360.createRoot('Hello360', { /* initial props */ }),
r360.getDefaultSurface()
);
}
window.React360 = {init};
export default class Hello360 extends React.Component {
// Our component will keep track of this state
state = {
count: 0,
};
render() {
return (
<View style={styles.panel}>
<View style={styles.greetingBox}>
<Text style={styles.greeting}>
Hello React
</Text>
<Text style={styles.greeting}>
{`Count: ${this.state.count}`}
</Text>
</View>
</View>
);
}
};
const styles = StyleSheet.create({
panel: {
// Fill the entire surface
width: 1000,
height: 600,
backgroundColor: 'rgba(255, 255, 255, 0.4)',
alignItems: 'center',
justifyContent: 'center'
}
});
AppRegistry.registerComponent('Hello360', () => Hello360);
导出默认类Hello360扩展React.Component{
//我们的组件将跟踪此状态
状态={
计数:0,
};
render(){
返回(
你好,反应
{`Count:${this.state.Count}`}
);
}
};
const styles=StyleSheet.create({
专家组:{
//填满整个表面
宽度:1000,
身高:600,
背景颜色:“rgba(255,255,255,0.4)”,
对齐项目:“居中”,
为内容辩护:“中心”
}
});
AppRegistry.registerComponent('Hello360',()=>Hello360);
我尝试将transform属性添加到styles元素,但这不起作用。在本例中,如何更改相对于已安装Hello360组件的相机位置?您可以像这样将相机位置设置得更高(在client.js的init中):
如何从组件中调用此功能?