| | |
| | | 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 }) => { |
| | |
| | | > |
| | | {model === ModelEnum.OBSERVER_MODEL && ( |
| | | <> |
| | | <ShowJson |
| | | {/* <ShowJson |
| | | data={ |
| | | batchSprites?.map(item => { |
| | | return item.data?.no; |
| | | }) |
| | | } |
| | | /> */} |
| | | <BatchShelfView |
| | | |
| | | /> |
| | | </> |
| | | )} |
New file |
| | |
| | | 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; |
| | |
| | | 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 { |
| | | |
| | |
| | | } |
| | | |
| | | 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) => { |