Commit 411b673d authored by wuhao's avatar wuhao 🎯

asder

parent e26a999e
/*
* @Author: wuhao930406 1148547900@qq.com
* @Date: 2023-10-19 14:49:40
* @LastEditors: wuhao930406 1148547900@qq.com
* @LastEditTime: 2023-10-25 15:59:31
* @FilePath: /standaloneframe/frontend/src/pages/dashboard/index.jsx
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import * as THREE from "three";
import React, { useRef, Suspense, memo, useState, useEffect } from "react";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
......@@ -12,6 +22,8 @@ import {
} from "@react-three/fiber";
useGLTF.preload(require(`./model.glb`));
useGLTF.preload(require(`./dixing.glb`));
const Mesh = (props) => {
const { scene, nodes, materials, animations } = useGLTF(props.path);
......@@ -49,19 +61,6 @@ const Mesh = (props) => {
castShadow
scale={0.1}
position={[0, 0, 0]}
inject={
<meshPhysicalMaterial
color={"#fff"}
transparent={true} //是否支持透明度
opacity={1} //透明度
//visible={true}//是否可见
metalness={0.5} //金属性贴图
roughness={2} //粗糙程度 越精细镜面效果越强
clearcoat={1} // 透明漆 罩光漆
transmission={0.5} //透光效果 模型透明 表面效果处理不变 opactiy是整体透明 不削弱反射光
reflectivity={1} //光的 反射率
/>
}
/>
);
};
......@@ -85,10 +84,16 @@ function Dashboard({}) {
<pointLight position={[10, 10, 10]} />
<OrbitControls />
<Jixie castShadow receiveShadow />
<Gltf
src={require(`./dixing.glb`)}
receiveShadow
castShadow
scale={0.1}
position={[0, 0, 0]}
/>
</Canvas>
</div>
);
}
export default Dashboard;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment