Skip to content

Instantly share code, notes, and snippets.

View vradionovskii's full-sized avatar

vradionovskii

View GitHub Profile
@drcmda
drcmda / scroll.jsx
Last active September 14, 2023 17:32
scrolling images + minimap
import * as THREE from 'three'
import { Suspense, useRef, useState } from 'react'
import { Canvas, createPortal, applyProps, useFrame, useThree } from '@react-three/fiber'
import { useFBO, PerspectiveCamera, ScrollControls, Scroll, useScroll, Image } from '@react-three/drei'
function Images() {
const { width, height } = useThree(state => state.viewport)
const data = useScroll()
const group = useRef()
useFrame(() => {