part of exp

This commit is contained in:
Kseninia Mikhaylova 2024-06-18 15:46:35 +03:00
parent 6f45cbc0b3
commit 3d39c6bf3b
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { useGLTF } from '@tresjs/cientos' import { useGLTF } from '@tresjs/cientos'
import { Box3, Color, DoubleSide, MeshStandardMaterial, Vector3 } from 'three'; import { Box3, CanvasTexture, Color, DoubleSide, MeshStandardMaterial, Vector3 } from 'three';
const props = defineProps(['modelUrl', 'model', 'position', 'removePos', 'target', 'color', 'map']) const props = defineProps(['modelUrl', 'model', 'position', 'removePos', 'target', 'color', 'map'])
let scene let scene
@ -19,14 +19,14 @@ box.expandByObject(scene.children[0]);
let size = new Vector3(); let size = new Vector3();
box.getSize(size) box.getSize(size)
const getMaterial = () => { const getMaterial = async () => {
return new MeshStandardMaterial({ return new MeshStandardMaterial({
color: new Color(props.color || '#9c9c9c'), color: new Color(props.color || '#9c9c9c'),
roughness: 0.3, roughness: 0.3,
metalness: 0.3, metalness: 0.3
}) })
} }
const material = getMaterial() const material = await getMaterial()
function shadows_and_pos(scene: any) { function shadows_and_pos(scene: any) {
scene.children.forEach((el: any) => { scene.children.forEach((el: any) => {
if (el.isMesh) { if (el.isMesh) {

BIN
public/texture/images.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB