React Code
Packager
WebVR & ThreeJS
npm install -g react-vr-cli
react-vr init WelcomeToVR
cd WelcomeToVR
npm start
AppRegistry.registerComponent('WelcomeToVR', () => WelcomeToVR);
export default class WelcomeToVR extends React.Component {
render() {
return (
<View>
<Pano source={asset('chess-world.jpg')}/>
<Text
style={{
backgroundColor: '#777879',
fontSize: 0.8,
fontWeight: '400',
layoutOrigin: [0.5, 0.5],
paddingLeft: 0.2,
paddingRight: 0.2,
textAlign: 'center',
textAlignVertical: 'center',
transform: [{translate: [0, 0, -3]}],
}}>
hello
</Text>
</View>
);
}
};
style={{
transform: [
{rotateZ : this.state.rotation},
{translate: [0, 2, 0]},
{scale : 0.01 },
],
}}
style={{
transform: [
{matrix : [0.01,0,0,0, 0,0.01,0,0, 0,0,0.01,0, 3,2,0,1]},
],
}}
<Model style={{
transform: [
{ translate: [10, -20, 5 ]},
{scale: 0.2 }
]}} source={{
obj:asset('castle.obj'),
mtl:asset('castle.mtl'),
}} lit={true} />
<AmbientLight intensity={ .5 } />