This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useFBO } from '@react-three/drei'; | |
import { useFrame, useThree, type ThreeEvent } from '@react-three/fiber'; | |
import { useCallback, useEffect, useMemo, useRef } from 'react'; | |
import * as THREE from 'three'; | |
export const LiquifyShader = () => { | |
const gl = useThree((s) => s.gl); | |
const size = useThree((s) => s.size); | |
const viewport = useThree((s) => s.viewport); | |
const mesh = useRef<THREE.Mesh>(null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Plane } from '@react-three/drei'; | |
import { useMemo } from 'react'; | |
export const Border = () => { | |
const uniforms = useMemo( | |
() => ({ | |
u_color: { | |
value: [0.129, 0.129, 0.129] //same color as my background | |
}, | |
u_outline_color: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uniforms = useRef(null) | |
useFrame(({ clock }) => { | |
if (!uniforms.current) return | |
uniforms.current.u_color.value.y = Math.sin(clock.elapsedTime * 2) | |
}) | |
return ( | |
<mesh geometry={Suz.nodes.geometry}> | |
<meshNormalMaterial |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useFrame } from '@react-three/fiber' | |
import React, { useEffect, useRef } from 'react' | |
import { create } from 'zustand' | |
function AnimateBoxWithZustand() { | |
const useStore = create((set) => ({ | |
position: [0, 0, 0], | |
setPosition: (newPosition) => set(() => ({ position: newPosition })), | |
updatePosition: (time) => | |
set((state) => ({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as explained by QuantitativeBytes | |
# https://youtu.be/iDHWyt1v4T8 | |
import bpy | |
class Lorenz: | |
def __init__(self, sceneRef, objName, color, initX, initY, initZ): | |
self.X, self.Y, self.Z = initX, initY, initZ | |
self.dt = 0.005 | |
self.a, self.b, self.c = 10, 28, 8/3 |