We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i'm trying to make a simple cube using Three but it dosen't show on the mobile scene
`import * as React from 'react'; import { View, StyleSheet } from 'react-native'; import { ExpoWebGLRenderingContext, GLView } from 'expo-gl'; import ExpoTHREE, { Renderer } from 'expo-three'; import { Screen, Mesh, MeshBasicMaterial, PerspectiveCamera, Scene, } from 'three'; import { THREE } from 'expo-three';
const ThreeD = (props) => { const onContextCreate = async (gl) => { const scene = new Scene(); const camera = new PerspectiveCamera( 45, gl.drawingBufferWidth / gl.drawingBufferHeight, 1, 1000 )
gl.canvas = { width: gl.drawingBufferWidth, height: gl.drawingBufferHeight } const renderer = new Renderer({ gl }) renderer.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight) const geometry = new BoxBufferGeometry(1, 1, 1) const material = new MeshBasicMaterial({ color: 'blue' }) const cube = new Mesh(geometry, material) scene.add(cube) const render = () => { requestAnimationFrame(render) renderer.render(scene, camera) gl.endFrameEXP() } render() return cube } return ( <GLView style={styles.GLView} onContextCreate={onContextCreate} /> );
}
const styles = StyleSheet.create({ GLView: { width: 500, height: 500, backgroundColor: "#90ff90" },
});
export default ThreeD; `
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i'm trying to make a simple cube using Three but it dosen't show on the mobile scene
`import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { ExpoWebGLRenderingContext, GLView } from 'expo-gl';
import ExpoTHREE, { Renderer } from 'expo-three';
import { Screen, Mesh, MeshBasicMaterial, PerspectiveCamera, Scene, } from 'three';
import { THREE } from 'expo-three';
const ThreeD = (props) => {
const onContextCreate = async (gl) => {
const scene = new Scene();
const camera = new PerspectiveCamera(
45,
gl.drawingBufferWidth / gl.drawingBufferHeight,
1,
1000
)
}
const styles = StyleSheet.create({
GLView: {
width: 500,
height: 500,
backgroundColor: "#90ff90"
},
});
export default ThreeD; `
The text was updated successfully, but these errors were encountered: