Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
setupScene = arSession => {
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// scene
this.scene = new THREE.Scene();
if (this.AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0x999999);
this.scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
innerHeight: height,
devicePixelRatio: scale,
} = window;
// renderer
this.renderer = ExpoTHREE.createRenderer({ gl, antialias: false });
this.renderer.setPixelRatio(scale);
this.renderer.setSize(width, height);
this.renderer.setClearColor(0x000000, 1.0);
// scene
this.scene = new THREE.Scene();
if (AR) {
// AR Background Texture
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
/// AR Camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
} else {
// Standard Background
this.scene.background = new THREE.Color(0xcccccc);
this.scene.fog = new THREE.FogExp2(0x222222, 0.0001);
const {
innerWidth: width,
innerHeight: height,
devicePixelRatio: scale,
} = window;
// renderer
this.renderer = ExpoTHREE.createRenderer({ gl });
this.renderer.setPixelRatio(scale);
this.renderer.setSize(width, height);
// this.renderer.setClearColor(0x000000, 1.0);
// scene
this.scene = new THREE.Scene();
this.scene.background = ExpoTHREE.createARBackgroundTexture(
arSession,
this.renderer
);
// camera
this.camera = ExpoTHREE.createARCamera(
arSession,
width,
height,
0.01,
1000
);
// this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
var material = new THREE.MeshLambertMaterial({ color: 0xffccff });
for(let i = 0; i < 100; i++){
let sphere = new THREE.Mesh(geometry, material);
sphere.position.z = zPos;
scene.add(sphere);
zPos -= .90;
}
const animate = () => {
requestAnimationFrame(animate);
renderer.render(scene, camera);
gl.endFrameEXP()
}
animate();
scene.background = ExpoTHREE.createARBackgroundTexture(arSession, renderer)
}
}