three.js开发3D地图记录(一)

关键代码部分:

<template>
  <div class="center-map-box" id="contant"></div>
</template>

<script>
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
import {
  CSS2DRenderer,
  CSS2DObject,
} from "three/addons/renderers/CSS2DRenderer.js";
import * as d3 from "d3";
import jsondata from "@/api/420000_full.json";

let textureLoader = new THREE.TextureLoader(); //纹理贴图加载器
let WaveMeshArr = []; //所有波动光圈集合
let rotatingApertureMesh, rotatingPointMesh;

export default {
  data() {
    return {
      scene: null,
      camera: null,
      renderer: null,
      contant: null,
      spotLight: null,
      map: null,
      centerPos: [114.255221, 30.619014], // 地图中心经纬度坐标
      raycaster: null, // 光线投射 用于进行鼠标拾取
      mouse: null, // 鼠标位置
      labelRenderer: null, //CSS2DRenderer渲染器对象
    };
  },
  mounted() {
    // 第一步新建一个场景
    this.scene = new THREE.Scene();
    this.contant = document.getElementById("contant");
    // 辅助线
    const axesHelper = new THREE.AxesHelper(10);
    this.scene.add(axesHelper);

    //环境光
    const ambient = new THREE.AmbientLight("#ffffff", 4);
    this.scene.add(ambient);

    this.setCamera();
    this.setRenderer();
    this.generateGeometry();
    this.setClickFn();
    this.setController();
    this.animate();
    window.onresize = () => {
      this.renderer.setSize(
        this.contant.clientWidth,
        this.contant.clientHeight
      );
      this.camera.aspect = this.contant.clientWidth / this.contant.clientHeight;
      this.camera.updateProjectionMatrix();
    };

    this.initFloor();
  },
  methods: {
    // 新建透视相机
    setCamera() {
      this.camera = new THREE.PerspectiveCamera(
        45,
        this.contant.clientWidth / this.contant.clientHeight,
        0.1,
        1000
      );
      // 设置相机位置
      this.camera.position.set(20, 20, 20);
    },
    // 设置渲染器
    setRenderer() {
      this.renderer = new THREE.WebGLRenderer();
      // 设置画布的大小
      this.renderer.setSize(
        this.contant.clientWidth,
        this.contant.clientHeight
      );
      this.contant.appendChild(this.renderer.domElement);

      // 创建CSS2DRenderer渲染器(代替鼠标射线检测)
      this.labelRenderer = new CSS2DRenderer();
      // 设置labelRenderer渲染器宽高
      this.labelRenderer.setSize(
        this.contant.clientWidth,
        this.contant.clientHeight
      );
      this.labelRenderer.domElement.style.position = "absolute";
      this.labelRenderer.domElement.style.top = "0px";
      this.labelRenderer.domElement.style.pointerEvents = "none";
      // 将渲染器添加到页面
      this.contant.appendChild(this.labelRenderer.domElement);
    },

    render() {
      this.renderer.render(this.scene, this.camera);

      this.labelRenderer.render(this.scene, this.camera);
    },

    generateGeometry() {
      // 创建环境贴图
      let textureMap = textureLoader.load(require("./mapimg/gz-map.jpeg"));
      let texturefxMap = textureLoader.load(require("./mapimg/gz-map-fx.jpeg"));
      textureMap.wrapS = THREE.RepeatWrapping; //纹理水平方向的平铺方式
      textureMap.wrapT = THREE.RepeatWrapping; //纹理垂直方向的平铺方式
      textureMap.flipY = texturefxMap.flipY = false; // 如果设置为true,纹理在上传到GPU的时候会进行纵向的翻转。默认值为true。
      textureMap.rotation = texturefxMap.rotation =
        THREE.MathUtils.degToRad(45); //rotation纹理将围绕中心点旋转多少度
      const scale = 0.01;
      textureMap.repeat.set(scale, scale); //repeat决定纹理在表面的重复次数
      texturefxMap.repeat.set(scale, scale);
      textureMap.offset.set(0.5, 0.5); //offset贴图单次重复中的起始偏移量
      texturefxMap.offset.set(0.5, 0.5);

      // 初始化一个地图对象
      this.map = new THREE.Object3D();

      // 地理坐标数据 转换为3D坐标数据
      // 墨卡托投影转换
      const projection = d3
        .geoMercator()
        .center(this.centerPos)
        .scale(200)
        .translate([0, 0]);

      jsondata.features.forEach((elem) => {
        //this.renderer.render(this.scene, this.camera);
        const coordinates = elem.geometry.coordinates;

        //这里创建光柱、文字坐标
        this.initLightPoint(elem.properties, projection);

        // 循环坐标数组
        coordinates.forEach((multiPolygon) => {
          multiPolygon.forEach((polygon, index) => {
            const province = new THREE.Object3D();

            // 创建一个多边形轮廓
            const shape = new THREE.Shape();

            // 线材质对象 创建地图边界线 白色
            const lineMaterial = new THREE.LineBasicMaterial({
              color: "white",
            });
            // 创建一个空的几何体对象
            const lineGeometry = new THREE.BufferGeometry();
            const pointsArray = new Array();
            // 循环多边形坐标数组  polygon是地图区块的经纬度坐标数组
            for (let i = 0; i < polygon.length; i++) {
              const [x, y] = projection(polygon[i]);
              if (i === 0) {
                shape.moveTo(x, -y);
              }
              shape.lineTo(x, -y);
              // 三维向量对象  用于绘制边界线
              pointsArray.push(new THREE.Vector3(x, -y, 4.02));
            }
            // setFromPoints方法从pointsArray中提取数据改变几何体的顶点属性vertices
            // 如果几何体是BufferGeometry,setFromPoints方法改变的是.attributes.position属性
            lineGeometry.setFromPoints(pointsArray);

            // 拉伸参数
            const extrudeSettings = {
              depth: 1, // 拉伸度 (3D地图厚度)
              bevelEnabled: false, // 是否使用倒角
            };

            // 将多边形 拉伸扫描成型  //shape二维轮廓  //extrudeSettings拉伸参数
            const geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);

            // 创建高光材质
            const material = new THREE.MeshPhongMaterial({
              map: textureMap, //颜色贴图
              normalMap: texturefxMap, //用于创建法线贴图的纹理
              // normalScale: new THREE.Vector2(12.2, 2.2),//法线贴图对材质的影响程度
              color: "#7bc6c2",
              combine: THREE.MultiplyOperation, //如何将表面颜色的结果与环境贴图
              transparent: true,
              opacity: 1,
            });

            // 创建基础网格材质
            const material1 = new THREE.MeshBasicMaterial({
              color: "#3480C4",
              transparent: true,
              opacity: 0.4,
            });

            // 多边形添加材质
            const mesh = new THREE.Mesh(geometry, [
              material, //表面材质
              material1, //侧面材质
            ]);

            mesh.rotateX(-Math.PI / 2); //x轴旋转
            mesh.position.set(0, 1.5, -3); //设置放置位置

            const line = new THREE.Line(lineGeometry, lineMaterial);
            //this.materialArr.push(material);
            province.properties = elem.properties;
            province.add(mesh);

            line.rotateX(-Math.PI / 2); //x轴旋转
            line.position.set(0, -1.5, -3); //设置放置位置
            province.add(line);

            this.map.add(province);
            this.render();
          });
        });
      });

      this.map.position.set(4, 0, 6);
      this.scene.add(this.map);
      //this.spotLight.target = this.map;
      //this.camera.position.set(0, -0.7, 2.5);
      this.renderer.render(this.scene, this.camera);
    },

    /**
     * @description // 创建光柱
     * @param {*} x d3 - 经纬度转换后的x轴坐标
     * @param {*} z d3 - 经纬度转换后的z轴坐标
     * @param {*} heightScaleFactor
     */
    createLightPillar(x, z, heightScaleFactor = 1) {
      let group = new THREE.Group();
      // 柱体高度
      const height = heightScaleFactor;
      // 柱体的geo,6.19=柱体图片高度/宽度的倍数
      const geometry = new THREE.PlaneGeometry(height / 6.219, height);
      // 柱体旋转90度,垂直于Y轴
      // geometry.rotateX(Math.PI / 2)
      // 柱体的z轴移动高度一半对齐中心点
      geometry.translate(0, height / 2, 0);
      // 柱子材质
      const material = new THREE.MeshBasicMaterial({
        map: textureLoader.load(require("./mapimg/光柱.png")),
        color: 0x00ffff,
        transparent: true,
        depthWrite: false,
        // depthTest:false,
        side: THREE.DoubleSide,
      });
      // 光柱01
      let light01 = new THREE.Mesh(geometry, material);
      light01.renderOrder = 2;
      light01.name = "createLightPillar01";
      // 光柱02:复制光柱01
      let light02 = light01.clone();
      light02.renderOrder = 2;
      light02.name = "createLightPillar02";
      // 光柱02,旋转90°,跟 光柱01交叉
      light02.rotateY(Math.PI / 2);

      // 创建底部标点
      const bottomMesh = this.createPointMesh(0.5);

      // 创建光圈
      const lightHalo = this.createLightHalo(0.5);
      WaveMeshArr.push(lightHalo);
      // 将光柱和标点添加到组里
      group.add(bottomMesh, lightHalo, light01, light02);
      // 设置组对象的姿态
      // group = setMeshQuaternion(group, R, lon, lat)
      group.position.set(x, 2.6, z);
      return group;
    },
    /**
     * @description 创建底部标点
     * @param {number} size 缩放大小
     */
    createPointMesh(size) {
      // 标记点:几何体,材质,
      const geometry = new THREE.PlaneGeometry(1, 1);
      const material = new THREE.MeshBasicMaterial({
        map: textureLoader.load(require("./mapimg/标注.png")),
        color: 0x00ffff,
        side: THREE.DoubleSide,
        transparent: true,
        depthWrite: false, //禁止写入深度缓冲区数据
      });
      let mesh = new THREE.Mesh(geometry, material);
      mesh.renderOrder = 2;
      mesh.rotation.x = Math.PI / 2;
      mesh.name = "createPointMesh";
      // 缩放
      const scale = 1 * size;
      mesh.scale.set(scale, scale, scale);
      return mesh;
    },
    /**
     * @description 创建底部标点的光圈
     * @param {number} size 缩放大小
     */
    createLightHalo(size) {
      // 标记点:几何体,材质,
      const geometry = new THREE.PlaneGeometry(1, 1);
      const material = new THREE.MeshBasicMaterial({
        map: textureLoader.load(require("./mapimg/标注光圈.png")),
        color: 0x00ffff,
        side: THREE.DoubleSide,
        opacity: 0,
        transparent: true,
        depthWrite: false, //禁止写入深度缓冲区数据
      });
      let mesh = new THREE.Mesh(geometry, material);
      mesh.renderOrder = 2;
      mesh.name = "createLightHalo";
      mesh.rotation.x = Math.PI / 2;
      // 缩放
      const scale = 1.5 * size;
      mesh.size = scale; //自顶一个属性,表示mesh静态大小
      mesh.scale.set(scale, scale, scale);
      return mesh;
    },

    random(min, max) {
      return Math.floor(Math.random() * (max - min + 1)) + min;
    },

    /**
     * @description 创建光柱、文字坐标
     * @param {*} properties 属性、详情
     * @param {Function} projection  d3-geo转化坐标
     */
    initLightPoint(properties, projection) {
      // 创建光柱
      let heightScaleFactor = 2 + this.random(1, 5) / 5;
      let lightCenter = properties.centroid || properties.center;
      let areaName = properties.name;
      // projection用来把经纬度转换成坐标
      const [x, y] = projection(lightCenter);
      let light = this.createLightPillar(x, y, heightScaleFactor);
      light.position.z -= 3;
      this.map.add(light);
      //这里创建文字坐标
      this.createTextPoint(x, y, areaName);
    },

    /**
     * @description 创建文字坐标
     * @param {*} x d3 - 经纬度转换后的x轴坐标
     * @param {*} z d3 - 经纬度转换后的z轴坐标
     * @param {*} areaName 地名
     */
    createTextPoint(x, z, areaName) {
      let tag = document.createElement("div");
      tag.innerHTML = areaName;
      tag.style.color = "#fff";
      tag.style.pointerEvents = "auto";
      tag.style.position = "absolute";
      tag.addEventListener("mousedown", this.clickLabel, false); // 有时候PC端click事件不生效,不知道什么原因,就使用mousedown事件
      tag.addEventListener("touchstart", this.clickLabel, false);
      let label = new CSS2DObject(tag);
      //label.element.innerHTML = areaName;
      label.element.style.visibility = "visible";
      label.position.set(x, 3, z);
      label.position.x += 4;
      label.position.z += 3;
      this.scene.add(label);
    },

    /**
     * @description 文字坐标点击
     * @param {*} e
     */
    clickLabel(e) {
      console.log("🚀 ~ clickLabel ~ e:", e);
    },

    /**
     * @description 添加底部旋转背景
     */
    initFloor() {
      const geometry = new THREE.PlaneGeometry(80, 80);
      let texture = textureLoader.load(require("./mapimg/地板背景.png"));
      const material = new THREE.MeshPhongMaterial({
        color: 0xffffff,
        map: texture,
        // emissive:0xffffff,
        // emissiveMap:Texture,
        transparent: true,
        opacity: 1,
        depthTest: true,
        // roughness:1,
        // metalness:0,
        depthWrite: false,
        // side: THREE.DoubleSide
      });
      let plane = new THREE.Mesh(geometry, material);
      plane.rotateX(-Math.PI / 2);
      this.scene.add(plane);

      // 旋转装饰圆环1
      let rotatingApertureTexture = textureLoader.load(
        require("./mapimg/rotatingAperture.png")
      );
      let rotatingApertureerial = new THREE.MeshBasicMaterial({
        map: rotatingApertureTexture,
        transparent: true,
        opacity: 1,
        depthTest: true,
        depthWrite: false,
      });
      let rotatingApertureGeometry = new THREE.PlaneGeometry(25, 25);
      rotatingApertureMesh = new THREE.Mesh(
        rotatingApertureGeometry,
        rotatingApertureerial
      );
      rotatingApertureMesh.rotateX(-Math.PI / 2);
      rotatingApertureMesh.position.y = 0.02;
      rotatingApertureMesh.scale.set(1.2, 1.2, 1.2);
      this.scene.add(rotatingApertureMesh);

      // 旋转装饰圆环2
      let rotatingPointTexture = textureLoader.load(
        require("./mapimg/rotating-point2.png")
      );
      let material2 = new THREE.MeshBasicMaterial({
        map: rotatingPointTexture,
        transparent: true,
        opacity: 1,
        depthTest: true,
        depthWrite: false,
      });

      rotatingPointMesh = new THREE.Mesh(rotatingApertureGeometry, material2);
      rotatingPointMesh.rotateX(-Math.PI / 2);
      rotatingPointMesh.position.y = 0.04;
      rotatingPointMesh.scale.set(1, 1, 1);
      this.scene.add(rotatingPointMesh);

      // 背景小圆点
      let circlePoint = textureLoader.load(
        require("./mapimg/circle-point.png")
      );
      let material3 = new THREE.MeshPhongMaterial({
        color: 0x00ffff,
        map: circlePoint,
        transparent: true,
        opacity: 1,
        depthWrite: false,
        // depthTest: false,
      });
      let plane3 = new THREE.PlaneGeometry(30, 30);
      let mesh3 = new THREE.Mesh(plane3, material3);
      mesh3.rotateX(-Math.PI / 2);
      mesh3.position.y = 0.06;
      this.scene.add(mesh3);
    },

    //加事件
    setClickFn() {
      this.raycaster = new THREE.Raycaster();
      this.mouse = new THREE.Vector2();
      const onMouseMove = (event) => {
        var marginLeft = this.contant.offsetLeft;
        var marginTop = this.contant.offsetTop + 92;
        // 如果该地图不是占满全屏需要减去margintop和marginleft
        // 将鼠标位置归一化为设备坐标。x 和 y 方向的取值范围是 (-1 to +1)
        // this.mouse.x = (event.clientX / this.contant.clientWidth) * 2 - 1;
        // this.mouse.y = -(event.clientY / this.contant.clientHeight) * 2 + 1;
        this.mouse.x =
          ((event.clientX - marginLeft) / this.contant.clientWidth) * 2 - 1;
        this.mouse.y =
          -((event.clientY - marginTop) / this.contant.clientHeight) * 2 + 1;
      };

      let clickPosition;
      window.addEventListener("mousemove", onMouseMove, false);
      // 鼠标点击事件
      const onclick = (event) => {
        var marginLeft = this.contant.offsetLeft;
        var marginTop = this.contant.offsetTop;
        // let x = (event.clientX / this.contant.clientWidth) * 2 - 1;
        // let y = -(event.clientY / this.contant.clientHeight) * 2 + 1;
        // 如果该地图不是占满全屏需要减去margintop和marginleft
        let x =
          ((event.clientX - marginLeft) / this.contant.clientWidth) * 2 - 1;
        let y =
          -((event.clientY - marginTop) / this.contant.clientHeight) * 2 + 1;
        clickPosition = { x: x, y: y };
        this.raycaster.setFromCamera(clickPosition, this.camera);
        // 算出射线 与当场景相交的对象有那些
        const intersects = this.raycaster.intersectObjects(
          this.scene.children,
          true
        );
        let clickObj = intersects.find(
          (item) => item.object.material && item.object.material.length === 2
        );
        // 点击区县
        if (clickObj && clickObj.object) {
          console.log(clickObj);
          // this.$emit('clickAreaCheck',clickObj)
        }
      };
      window.addEventListener("mousedown", onclick, false);
    },

    // 设置最大旋转的角度
    setController() {
      const controls = new OrbitControls(this.camera, this.renderer.domElement);
      controls.maxPolarAngle = 2.5;
      controls.minPolarAngle = 1;
      controls.maxAzimuthAngle = 1;
      controls.minAzimuthAngle = -1;
      controls.addEventListener("change", () => {
        this.renderer.render(this.scene, this.camera);
      });
    },

    animate() {
      // 背景圆环 转动
      if (rotatingApertureMesh) {
        rotatingApertureMesh.rotation.z += 0.0005;
      }
      if (rotatingPointMesh) {
        rotatingPointMesh.rotation.z -= 0.0005;
      }
      // 圆柱底部 波纹
      if (WaveMeshArr.length) {
        WaveMeshArr.forEach(function (mesh) {
          mesh._s += 0.007;
          mesh.scale.set(
            mesh.size * mesh._s,
            mesh.size * mesh._s,
            mesh.size * mesh._s
          );
          if (mesh._s <= 1.5) {
            //mesh._s=1,透明度=0 mesh._s=1.5,透明度=1
            mesh.material.opacity = (mesh._s - 1) * 2;
          } else if (mesh._s > 1.5 && mesh._s <= 2) {
            //mesh._s=1.5,透明度=1 mesh._s=2,透明度=0
            mesh.material.opacity = 1 - (mesh._s - 1.5) * 2;
          } else {
            mesh._s = 1.0;
          }
        });
      }

      window.requestAnimationFrame(this.animate);
      // 通过摄像机和鼠标位置更新射线
      this.raycaster.setFromCamera(this.mouse, this.camera);
      this.labelRenderer.render(this.scene, this.camera);

      this.renderer.render(this.scene, this.camera);
    },
  },
};
</script>

<style>
.center-map-box {
  width: 100%;
  height: 100%;
  position: relative;
  font-size: 14px;
}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/716808.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

夏季河湖防溺水新举措:EasyCVR+AI视频智能监控系统保障水域安全

近日一则新闻引起大众关注&#xff0c;有网友发布视频称&#xff0c;假期在逛西湖时&#xff0c;发现水面上“平躺”漂浮着一名游客在等待救援。在事发3分钟内&#xff0c;沿湖救生员成功将落水游客救到了岸边。 随着夏季的到来&#xff0c;雨水增多&#xff0c;各危险水域水位…

别太小看“静态免杀“

0x01 简述 免杀总体来说可分为两种&#xff0c;静态免杀/动态免杀。往往来说&#xff0c;我们更注重于在内部代码层面实现一些免杀技巧&#xff0c;但在有些时候&#xff0c;动态免杀静态免杀以"打组合拳"的方式效果往往会更出人所料。 当我们的程序生成后&#xf…

CCAA认证人员注册全国统一考试开始报名

备受瞩目的CCAA&#xff08;中国认证认可协会&#xff09;认证人员注册全国统一考试即将拉开报名序幕。 考试基本信息&#xff1a; 1&#xff09;报名网站网址&#xff1a;https://kaoshi.ccaa.org.cn/ 2&#xff09;考试报名系统自2024年6月17日12:00时起面向考生正式开通&…

Apache DolphinScheduler查看版本信息

我找了半天&#xff0c;没有看到版本在哪里。然后我看配置&#xff0c;他要连接数据库&#xff0c;我去他存储数据库的表里面&#xff0c;看到了相关的版本信息。 cd /home/dolphinscheduler/dolphinscheduler/bin/env dolphinscheduler找到了里面的密码 版本是3.1.3

【C++】模板初级

【C】模板初级 泛型编程函数模板函数模板的概念函数模板格式函数模板的原理函数模板的实例化模板参数的匹配原则 类模板类模板格式类模板的实例化 泛型编程 当我们之前了解过函数重载后可以知道&#xff0c;一个程序可以出现同名函数&#xff0c;但参数类型不同。 //整型 voi…

网络安全等级保护制度详解,一文掌握核心要点!

一、等级保护制度发展情况 等级保护制度的法律依据 《计算机信息系统安全保护条例》&#xff08;1994年General Office of the State Council第147号令&#xff09; 公安部主管全国计算机信息系统安全保护工作。 计算机信息系统实行安全等级保护&#xff0c;安全等级的划分…

Python+Selenium自动化测试环境搭建步骤(selenium环境搭建)

一、自动化简介 1.自动化测试概念&#xff1a; 是把以人为驱动的测试转化为机器执行的一种过程&#xff0c;它是一种以程序测试程序的过程 2.自动化测试分类&#xff1a; 一般IT上所说的自动化测试是指功能自动化测试&#xff0c;通过编码的方式用一段程序来测试一个软件的功…

数据预处理之基于统计的(3σ,Z分数,Boxplot箱线图)异常值检测#matlab

基于统计的异常值检测 1.异常值的含义 异常值是指在数据集中偏离大部分数据的数据&#xff0c;使人怀疑这些数据的偏离并非由随机因素产生&#xff0c;而是产生于完全不同的机制。 异常挖掘(outlier mining)问题由两个子问题构成&#xff1a;(1)如何度量异常。(2)如何有效发…

我一直看不明白:“C++会被java/python等这些语言替代”

在开始前刚好我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「C的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共享给大家&#xff01;&#xff01;&#xff01; 有些程序&#xff0c;是既可以…

【QT5】<重点> IMX6ULL开发板运行QT

目录 1. 安装交叉编译器 2. 命令行交叉编译QT项目 3. 运行该可执行程序 4. 开发板上运行UDP程序与Ubuntu通信 1. 安装交叉编译器 第一步&#xff1a;进入正点原子论坛找到IMX6ULL开发板的资料&#xff0c;下载“开发工具”&#xff0c;将“交叉编译工具”中的fsl-imx-x11-…

Spring中的IOC

IOC&#xff08;Inversion of Control&#xff0c;控制反转&#xff09;是Spring框架核心概念之一。它是一种设计原则&#xff0c;用来实现对象的松耦合和依赖管理。在传统的编程中&#xff0c;对象负责创建或查找其依赖对象&#xff0c;而在IOC模式下&#xff0c;这些职责被移…

el-date-picker 有效时间精确到时分秒 且给有效时间添加标记

el-date-picker实现有效日期做标记且时分秒限制选择范围 代码如下&#xff1a; // html部分 <el-date-pickerv-model"dateTime"type"datetime":picker-options"pickerOptions" > </el-date-picker>// js部分 /*** 回放有效日期开始时…

WPF/C#:如何将数据分组显示

WPF Samples中的示例 在WPF Samples中有一个关于Grouping的Demo。 该Demo结构如下&#xff1a; MainWindow.xaml如下&#xff1a; <Window x:Class"Grouping.MainWindow"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x&q…

文心一言 VS 讯飞星火 VS chatgpt (283)-- 算法导论21.2 1题

一、使用链表表示和加权合并启发式策略&#xff0c;写出 MAKE-SET、FIND-SET 和 UNION 操作的伪代码。并指定你在集合对象和表对象中所使用的属性。如果要写代码&#xff0c;请用go语言。 文心一言&#xff1a; 在并查集&#xff08;Disjoint Sets&#xff09;或集合合并&…

6.7.29 基于卷积神经网络的乳腺良恶性图像分类

计算机化乳腺癌诊断系统在早期癌症诊断中发挥着重要作用。为此&#xff0c;应用深度学习&#xff0c;利用卷积神经网络 (CNN) 对基于小型乳房 X 线图像分析协会 (mini-MIAS) 数据库的乳房 X 线图像中的异常&#xff08;良性或恶性&#xff09;进行分类。观察准确度、灵敏度和特…

天锐绿盾数据防泄密软件有哪些功能

天锐绿盾数据防泄密软件的功能丰富而全面&#xff0c;旨在从源头上保障企业数据的安全。以下是对其主要功能的归纳和介绍&#xff1a; www.drhchina.com 一、文件加密模块 透明加密&#xff1a;在不影响用户工作流程的前提下&#xff0c;对需要保护的文件进行自动加密处理。文…

unity 打包PC安装包中常见文件的功能

目录 前言 一、打包好的文件 二、常用文件 1.文件夹XXX_Data 2.文件夹MonoBleedingEdge 3.文件夹XXX_Data内部 三、文件的应用 1.如果你替换了一个图片 2.如果你新增了或减少了图片和资源 3.场景中有变动 4.resources代码加载的资源改了 5.如果你代码替换了 四、作…

大模型时代:消失的飞轮

在移动互联网时代&#xff0c;“数据飞轮”效应深入人心&#xff1a;场景催生应用&#xff0c;应用生成数据&#xff0c;继而这些数据反馈优化算法&#xff0c;再反哺应用本身&#xff0c;进入迭代优化的良性循环。 随着生成式人工智能的兴起&#xff0c;许多人认为这一飞轮效…

springboot原理篇-bean管理

springboot原理篇-bean管理&#xff08;二&#xff09; 我们今天主要学习IOC容器中Bean的其他使用细节&#xff0c;主要学习以下三方面&#xff1a; 如何从IOC容器中手动的获取到bean对象bean的作用域配置管理第三方的bean对象 一、获取Bean 了解即可&#xff0c;默认情况下…

基于Python的花卉识别分类系统【W9】

简介&#xff1a; 基于Python的花卉识别分类系统利用深度学习和计算机视觉技术&#xff0c;能够准确识别和分类各种花卉&#xff0c;如玫瑰、郁金香和向日葵等。这种系统不仅有助于植物学研究和园艺管理&#xff0c;还在生态保护、智能农业和市场销售等领域展现广泛应用前景。随…