constructor(props) { super(props); const { width, height } = Dimensions.get('window'); this.x1 = new Animated.Value(randomNumber(0, width)); this.y1 = new Animated.Value(randomNumber(0, height)); this.x2 = new Animated.Value(randomNumber(0, width)); this.y2 = new Animated.Value(randomNumber(0, height)); this.x3 = new Animated.Value(randomNumber(0, width)); this.y3 = new Animated.Value(randomNumber(0, height)); }
render() { return ( <View style={styles.container}> <ProgressiveImage thumbnailSource={{ uri: `https://images.pexels.com/photos/671557/pexels-photo-671557.jpeg?w=50&buster=${Math.random()}` }} source={{ uri: `https://images.pexels.com/photos/671557/pexels-photo-671557.jpeg?w=${w.width * 2}&buster=${Math.random()}` }} style={{ width: w.width, height: w.width }} resizeMode="cover" /> </View> ); }
function intersectObjects({ locationX, locationY }, objects) { const { width, height } = Dimensions.get('window'); pointerVector.set( locationX / width * 2 - 1, -(locationY / height * 2) + 1 ); ray.setFromCamera(pointerVector, camera); var intersections = ray.intersectObjects(objects, true); return intersections[0] ? intersections[0] : false; }
constructor(props) { super(props); const { width, height } = Dimensions.get('window'); this.source = [ new Animated.Value(randomNumber(0, width)), new Animated.Value(randomNumber(0, height)) ]; this.target = [ new Animated.Value(randomNumber(0, width)), new Animated.Value(randomNumber(0, height)) ]; }
constructor(props) { super(props); const { width, height } = Dimensions.get('window'); this.x1 = new Animated.Value(randomNumber(0, width)); this.y1 = new Animated.Value(randomNumber(0, height)); this.x2 = new Animated.Value(randomNumber(0, width)); this.y2 = new Animated.Value(randomNumber(0, height)); this.x3 = new Animated.Value(randomNumber(0, width)); this.y3 = new Animated.Value(randomNumber(0, height)); }
function intersectObjects({ locationX, locationY }, objects) { const { width, height } = Dimensions.get('window'); pointerVector.set( locationX / width * 2 - 1, -(locationY / height * 2) + 1 ); ray.setFromCamera(pointerVector, camera); var intersections = ray.intersectObjects(objects, true); return intersections[0] ? intersections[0] : false; }