mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 08:41:37 +00:00
feat: update screen texture
This commit is contained in:
@ -5,6 +5,7 @@ import { lazy, Suspense, useMemo } from 'react';
|
|||||||
import Loading from './loading';
|
import Loading from './loading';
|
||||||
import { PerspectiveCamera } from '@react-three/drei/core/PerspectiveCamera';
|
import { PerspectiveCamera } from '@react-three/drei/core/PerspectiveCamera';
|
||||||
import { useMediaQuery } from 'react-responsive';
|
import { useMediaQuery } from 'react-responsive';
|
||||||
|
import { useTexture } from '@react-three/drei';
|
||||||
|
|
||||||
const ComputerModel = lazy(
|
const ComputerModel = lazy(
|
||||||
() => import('components/models/home/computer-model'),
|
() => import('components/models/home/computer-model'),
|
||||||
|
@ -7,7 +7,7 @@ License: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
|
|||||||
Source: https://sketchfab.com/3d-models/hacker-room-stylized-a0cfe6edf2dd494c8a95addf6bb13a10
|
Source: https://sketchfab.com/3d-models/hacker-room-stylized-a0cfe6edf2dd494c8a95addf6bb13a10
|
||||||
Title: Hacker Room - Stylized
|
Title: Hacker Room - Stylized
|
||||||
*/
|
*/
|
||||||
import { useGLTF } from '@react-three/drei';
|
import { useGLTF, useTexture } from '@react-three/drei';
|
||||||
import { useLoader } from '@react-three/fiber';
|
import { useLoader } from '@react-three/fiber';
|
||||||
import { JSX } from 'react';
|
import { JSX } from 'react';
|
||||||
import * as THREE from 'three';
|
import * as THREE from 'three';
|
||||||
@ -59,6 +59,9 @@ export function Model(props: JSX.IntrinsicElements['group']) {
|
|||||||
},
|
},
|
||||||
) as unknown as GLTFResult;
|
) as unknown as GLTFResult;
|
||||||
|
|
||||||
|
const moniterTexture = useTexture('/texture/desk/monitor.png');
|
||||||
|
const screenTexture = useTexture('/texture/desk/screen.png');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<group {...props} dispose={null}>
|
<group {...props} dispose={null}>
|
||||||
<mesh
|
<mesh
|
||||||
@ -66,7 +69,9 @@ export function Model(props: JSX.IntrinsicElements['group']) {
|
|||||||
receiveShadow
|
receiveShadow
|
||||||
geometry={nodes.computer_computer_mat_0.geometry}
|
geometry={nodes.computer_computer_mat_0.geometry}
|
||||||
material={materials.computer_mat}
|
material={materials.computer_mat}
|
||||||
/>
|
>
|
||||||
|
<meshMatcapMaterial map={moniterTexture} />
|
||||||
|
</mesh>
|
||||||
<mesh
|
<mesh
|
||||||
castShadow
|
castShadow
|
||||||
receiveShadow
|
receiveShadow
|
||||||
@ -126,7 +131,9 @@ export function Model(props: JSX.IntrinsicElements['group']) {
|
|||||||
receiveShadow
|
receiveShadow
|
||||||
geometry={nodes.screen_screens_0.geometry}
|
geometry={nodes.screen_screens_0.geometry}
|
||||||
material={materials.screens}
|
material={materials.screens}
|
||||||
/>
|
>
|
||||||
|
<meshMatcapMaterial map={screenTexture} />
|
||||||
|
</mesh>
|
||||||
<mesh
|
<mesh
|
||||||
castShadow
|
castShadow
|
||||||
receiveShadow
|
receiveShadow
|
||||||
|
@ -30,7 +30,7 @@ export function ReactLogo(props: JSX.IntrinsicElements['group']) {
|
|||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
return [5, 3, 0] as const;
|
return [5, 3, 0] as const;
|
||||||
}
|
}
|
||||||
return [10, 3, 0] as const;
|
return [9, 1, 0] as const;
|
||||||
}, [isMobile]);
|
}, [isMobile]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -51,7 +51,7 @@ export function Target(props: JSX.IntrinsicElements['group']) {
|
|||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
return [-5, -5, 3] as const;
|
return [-5, -5, 3] as const;
|
||||||
}
|
}
|
||||||
return [-14, -8, 0] as const;
|
return [-12, -10, 0] as const;
|
||||||
}, [isMobile]);
|
}, [isMobile]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
BIN
public/texture/desk/chair.png
Executable file
BIN
public/texture/desk/chair.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
BIN
public/texture/desk/cushion.png
Executable file
BIN
public/texture/desk/cushion.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
BIN
public/texture/desk/monitor.png
Executable file
BIN
public/texture/desk/monitor.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
BIN
public/texture/desk/screen.png
Executable file
BIN
public/texture/desk/screen.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
BIN
public/texture/desk/screen.psd
Executable file
BIN
public/texture/desk/screen.psd
Executable file
Binary file not shown.
BIN
public/texture/desk/table.png
Executable file
BIN
public/texture/desk/table.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
Reference in New Issue
Block a user