From c19737e5ac269ac70a1a392a9514a425fdf662a0 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 02 四月 2024 13:51:28 +0800
Subject: [PATCH] #
---
zy-asrs-flow/public/model/001-1.fbx | 0
zy-asrs-flow/public/model/001.fbx | 0
zy-asrs-flow/src/pages/map/batch/index.jsx | 6 ++
zy-asrs-flow/src/pages/map/batch/view.jsx | 36 ++++++++++++++++++
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js | 29 ++++++++++++--
5 files changed, 66 insertions(+), 5 deletions(-)
diff --git a/zy-asrs-flow/public/model/001-1.fbx b/zy-asrs-flow/public/model/001-1.fbx
new file mode 100644
index 0000000..387d8fe
--- /dev/null
+++ b/zy-asrs-flow/public/model/001-1.fbx
Binary files differ
diff --git a/zy-asrs-flow/public/model/001.fbx b/zy-asrs-flow/public/model/001.fbx
new file mode 100644
index 0000000..a8400d8
--- /dev/null
+++ b/zy-asrs-flow/public/model/001.fbx
Binary files differ
diff --git a/zy-asrs-flow/src/pages/map/batch/index.jsx b/zy-asrs-flow/src/pages/map/batch/index.jsx
index 23b4e39..7f1166f 100644
--- a/zy-asrs-flow/src/pages/map/batch/index.jsx
+++ b/zy-asrs-flow/src/pages/map/batch/index.jsx
@@ -4,6 +4,7 @@
import { createStyles } from 'antd-style';
import * as Utils from '../utils'
import ShowJson from '../drawer/showJson';
+import BatchShelfView from './view'
import BatchModify from './modify';
const useStyles = createStyles(({ token, css }) => {
@@ -59,12 +60,15 @@
>
{model === ModelEnum.OBSERVER_MODEL && (
<>
- <ShowJson
+ {/* <ShowJson
data={
batchSprites?.map(item => {
return item.data?.no;
})
}
+ /> */}
+ <BatchShelfView
+
/>
</>
)}
diff --git a/zy-asrs-flow/src/pages/map/batch/view.jsx b/zy-asrs-flow/src/pages/map/batch/view.jsx
new file mode 100644
index 0000000..51f4496
--- /dev/null
+++ b/zy-asrs-flow/src/pages/map/batch/view.jsx
@@ -0,0 +1,36 @@
+import React, { useState, useRef, useEffect } from 'react';
+import * as THREE from 'three'
+import { Spin, Descriptions, Button } from 'antd';
+import { FormattedMessage, useIntl, useModel } from '@umijs/max';
+import { LoadingOutlined } from '@ant-design/icons';
+import { createStyles } from 'antd-style';
+import * as Utils from '../utils'
+import Http from '@/utils/http';
+
+const useStyles = createStyles(({ token, css }) => {
+ return {
+ }
+})
+
+const BatchShelfView = (props) => {
+ const intl = useIntl();
+ const { styles } = useStyles();
+ const refContainer = useRef();
+
+ const [loading, setLoading] = React.useState(false);
+
+
+ useEffect(() => {
+
+
+ }, [])
+
+ return (
+ <>
+ <h1>asd</h1>
+ </>
+ )
+}
+
+
+export default BatchShelfView;
\ No newline at end of file
diff --git a/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js b/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
index ece7876..189b112 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
+++ b/zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
@@ -7,9 +7,10 @@
import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass';
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader';
+import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader'
+import * as Utils from '../../utils'
-
-const help = false;
+const help = true;
export default class ShelfThree {
@@ -183,11 +184,31 @@
}
generateMesh = (fn) => {
- fn(this.addObject);
+ // fn(this.addObject);
+ const loader = new FBXLoader();
+ loader.load('model/001-1.fbx', (mesh) => {
+ console.log(mesh);
+ mesh.position.set(0, 10, 0);
+ mesh.scale.set(5, 5, 5);
+ mesh.rotation.x = Utils.rotationParseNum(270);
+ mesh.traverse(function (child) {
+ if (child.isMesh) {
+ child.castShadow = true;
+ child.receiveShadow = true;
+ }
+ });
+ this.addObject(mesh);
+
+ const clone = mesh.clone();
+ clone.position.set(0, 195, 0);
+ clone.scale.set(5, 5, 5);
+ clone.rotation.x = Utils.rotationParseNum(270);
+ this.addObject(clone);
+ })
}
setNewSelectedMesh = (objName) => {
- for(const mesh of this.objects) {
+ for (const mesh of this.objects) {
if (mesh.name === objName) {
this.outlinePass.selectedObjects = [mesh];
break;
--
Gitblit v1.9.1