H5 three.js 实现六年级观察物体

o( ̄▽ ̄)ブ 我又带着新的demo来啦~

预览
在这里插入图片描述
功能点

  • 立方体的阴影
  • 立方体的添加
  • 位置记录
  • 最大限制
  • 三视图展示
  • 立方体的移除
  • 答题模式
  • 随机出题
  • 题库出题

源码
注释算是比较全了,可能部分会有点绕,还能够再优化一下~

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="./assets/global.css"><style>body {user-select: none;}.panel-container {position: absolute;top: 0;left: 0;/* height: 200px; */width: 100%;background-color: rgba(255, 255, 255, .8);padding: 20px;box-sizing: border-box;display: flex;justify-content: space-between;}.mode-switch {display: inline-flex;overflow: hidden;height: 32px;border-radius: 6px;background-color: #ccc;}.mode-switch .mode-switch-item {display: inline-block;padding: 0 8px;line-height: 32px;font-size: 12px;background-color: transparent;cursor: pointer;}.mode-switch .mode-switch-item.active {background-color: #88ccee;}.mode-switch .mode-switch-item.del.active {background-color: #cc3333;}.mode-switch-item.clear.active,.mode-switch-item.again.active {display: inline-block;}.mode-switch-item.clear,.mode-switch-item.again {display: none;}.mode-switch-item.clear.active,.mode-switch-item.del.active {background-color: #cc3333;color: #fff;}.panel-container.bottom {top: auto;bottom: 0;padding-top: 32px;}.front-view,.top-view,.left-view {width: 25vmin;height: 25vmin;position: relative;}.front-view::before,.top-view::before,.left-view::before {position: absolute;font-size: 12px;top: -16px;}.front-view::before {content: "正视图";}.top-view::before {content: "顶视图";}.left-view::before {content: "左视图";}.front-view.right::after,.top-view.right::after,.left-view.right::after {position: absolute;left: 0;right: 0;top: 0;bottom: 0;z-index: 0;background-color: rgba(255, 255, 255, .8);background-image: url('./assets/observing-objects/right.png');background-size: 50%;background-repeat: no-repeat;background-position: center;content: '';}.view-cude {position: absolute;background-image: url('./assets/cubeTexture.jpg');background-size: 110%;background-position: center;transform: translateY(-100%);}.view-cude.active {background: #404040;}.hint-container {position: absolute;top: 72px;color: #cc3333;opacity: .6;line-height: 20px;font-size: 12px;padding: 10px 10px;}.win-container {position: absolute;top: 72px;bottom: 0;left: 0;right: 0;background-color: rgba(255, 255, 255, .8);display: flex;justify-content: center;align-items: center;display: none}.win-container img {width: 50%;height: 80%;object-fit: contain;}</style>
</head><body><script type="importmap">{"imports": {"three": "https://unpkg.com/three/build/three.module.js","three/addons/": "https://unpkg.com/three/examples/jsm/"}}</script><div class="panel-container"><div class="mode-switch"><div class="mode-switch-item new">新增模式</div><div class="mode-switch-item del">删除模式</div><div class="mode-switch-item que">答题模式</div></div><div class="mode-switch"><div class="mode-switch-item again">再来一题</div><div class="mode-switch-item clear">清空方块</div></div></div><div class="hint-container">提示:答题模式无法编辑添加方块,通过观察立方体,单击三视图中的方块显示和隐藏来回答问题。</div><div class="panel-container bottom"><div class="front-view"></div><div class="top-view"></div><div class="left-view"></div></div><div class="win-container"><img src="./assets/rainbow-fart/1.gif"><img src="./assets/rainbow-fart/2.gif"></div><script type="module">import * as THREE from 'three';import { OrbitControls } from 'three/addons/controls/OrbitControls.js';import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';import { Randoms } from "https://gcore.jsdelivr.net/npm/@3r/tool/lib/randoms.js";let newModeDom = document.querySelector('.mode-switch-item.new')let delModeDom = document.querySelector('.mode-switch-item.del')let queModeDom = document.querySelector('.mode-switch-item.que')let cleModeDom = document.querySelector('.mode-switch-item.clear')let agaModeDom = document.querySelector('.mode-switch-item.again')let opeModeLis = [newModeDom, delModeDom, queModeDom, cleModeDom, agaModeDom]let cubeMap = {}; // 方块存储let maximumSize = 4;  // 新建底座 4 x 4 let cubeMaterial = null;  // 方块材质let mode = 'new' // new 新增 del 删除 que 答题 function removeActiveOpeMode() {opeModeLis.forEach(item =>item.classList.remove('active'))}newModeDom.addEventListener('click', () => {mode = 'new';removeActiveOpeMode()newModeDom.classList.add('active')cleModeDom.classList.add('active')refreshView()winHide()})delModeDom.addEventListener('click', () => {mode = 'del';removeActiveOpeMode()delModeDom.classList.add('active')cleModeDom.classList.add('active')refreshView()winHide()})queModeDom.addEventListener('click', () => {mode = 'que';removeActiveOpeMode()queModeDom.classList.add('active')agaModeDom.classList.add('active')agaModeDom.click()})cleModeDom.addEventListener('click', () => {if (cubeMap) {for (const cude of Object.values(cubeMap)) {scene.remove(cude)}cubeMap = {}refreshView()}})agaModeDom.addEventListener('click', () => {winHide()cleModeDom.click();randomMap()})// newModeDom.click()const scene = new THREE.Scene();const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);const renderer = new THREE.WebGLRenderer();scene.background = new THREE.Color(0x88ccee);camera.position.set(-10.5, 5, -10.5);renderer.shadowMap.enabled = true;renderer.setSize(window.innerWidth, window.innerHeight);document.body.appendChild(renderer.domElement);// 创建平行光const directionalLight = new THREE.DirectionalLight(0xffffff, 0.3);directionalLight.position.set(4, 4, -4)directionalLight.castShadow = true;scene.add(directionalLight);// 创建环境光源const ambientLight = new THREE.AmbientLight(0x404040); // 灰色的环境光scene.add(ambientLight);// 材质获取const textareaLoader = new THREE.TextureLoader();textareaLoader.load("./assets/cubeTexture.jpg", texture => {cubeMaterial = new THREE.MeshLambertMaterial({map: texture //材质的贴图为加载的图片});// 材质加载完成queModeDom.click();})// 模型加载const gltfLoader = new GLTFLoader().setPath('./assets/observing-objects/');gltfLoader.load('left.glb', (gltf) => {gltf.scene.position.x = 4.5;gltf.scene.position.y = 1.5;gltf.scene.position.z = -0.5;scene.add(gltf.scene);})gltfLoader.load('up.glb', (gltf) => {gltf.scene.position.x = 0.5;gltf.scene.position.y = 4.5;gltf.scene.position.z = -0.5;scene.add(gltf.scene);})gltfLoader.load('front.glb', (gltf) => {gltf.scene.position.x = 0.5;gltf.scene.position.y = 0;gltf.scene.position.z = -4.5;scene.add(gltf.scene);})// 平面预设for (let x = 0; x < maximumSize; x++) {for (let z = 0; z < maximumSize; z++) {console.log(x, z);const planeMaterial = new THREE.MeshStandardMaterial({ color: 0x999999, side: THREE.DoubleSide });const plane = new THREE.Mesh(new THREE.BoxGeometry(1, .01, 1), planeMaterial);plane.position.x = x - maximumSize / 2;plane.position.z = z - maximumSize / 2;plane.name = `plane(${x},${z})`plane.receiveShadow = true;scene.add(plane);}}// <div class="front-view"></div>// <div class="top-view"></div>// <div class="left-view"></div>// 三视图预设let frontViewDom = document.querySelector('.front-view')let topViewDom = document.querySelector('.top-view')let leftViewDom = document.querySelector('.left-view')let viewDomLis = [frontViewDom, topViewDom, leftViewDom]// 创建视图方块function createViewCude(x, y) {let viewCudeDom = document.createElement('div')viewCudeDom.classList.add('view-cude')viewCudeDom.style.width = `${100 / maximumSize}%`viewCudeDom.style.height = `${100 / maximumSize}%`viewCudeDom.style.left = (x * 100 / maximumSize) + '%'viewCudeDom.style.top = (100 - y * 100 / maximumSize) + '%'viewCudeDom.setAttribute('x', x)viewCudeDom.setAttribute('y', y)viewCudeDom.addEventListener('click', function () {if (mode == 'que') {if (viewCudeDom.classList.contains('active')) {viewCudeDom.classList.remove("active")}else {viewCudeDom.classList.add("active")}checkQuestionIsRight()}})return viewCudeDom}for (let i = 0; i < maximumSize; i++) {for (let j = 0; j < maximumSize; j++) {frontViewDom.appendChild(createViewCude(j, i))topViewDom.appendChild(createViewCude(j, i))leftViewDom.appendChild(createViewCude(j, i))}}// 刷新视图function refreshView() {console.log(cubeMap);let cubeMapKeys = Object.keys(cubeMap)// 移除正确标签 viewDomLis.map(item => {item.classList.remove('right')})// 正视图for (let i = 0; i < frontViewDom.children.length; i++) {const viewCudeDom = frontViewDom.children.item(i);let tmpX = viewCudeDom.getAttribute('x')let tmpY = viewCudeDom.getAttribute('y')if (cubeMapKeys.find(key => key.startsWith(`${tmpX},${tmpY}`))) viewCudeDom.classList.add('active')else viewCudeDom.classList.remove('active')}// 顶视图for (let i = 0; i < topViewDom.children.length; i++) {const viewCudeDom = topViewDom.children.item(i);let tmpX = viewCudeDom.getAttribute('x')let tmpZ = viewCudeDom.getAttribute('y')if (cubeMapKeys.find(key => key.startsWith(`${tmpX}`) && key.endsWith(`${tmpZ}`))) viewCudeDom.classList.add('active')else viewCudeDom.classList.remove('active')}// 左视图for (let i = 0; i < leftViewDom.children.length; i++) {const viewCudeDom = leftViewDom.children.item(i);let tmpZ = maximumSize - 1 - +viewCudeDom.getAttribute('x')let tmpY = viewCudeDom.getAttribute('y')if (cubeMapKeys.find(key => key.endsWith(`${tmpY},${tmpZ}`))) viewCudeDom.classList.add('active')else viewCudeDom.classList.remove('active')}}let winDom = document.querySelector('.win-container')   // 胜利function winHide() {winDom.setAttribute('style', 'display:none')}function winShow() {winDom.setAttribute('style', 'display:flex')let winImgCount = winDom.children.lengthlet winImgShowIndex = Randoms.getRandomInt(0, winImgCount) // 随机高度 [)for (let i = 0; i < winImgCount; i++) {const winImg = winDom.children.item(i);winImg.setAttribute('style', winImgShowIndex == i ? 'display:flex' : 'display:none')}}// 控制器let controls = new OrbitControls(camera, renderer.domElement);controls.screenSpacePanning = true;controls.minDistance = 5;controls.maxDistance = 40;controls.target.set(0, 0, 0);controls.update();//获取鼠标坐标 处理点击某个模型的事件let mouse = new THREE.Vector2();let raycaster = new THREE.Raycaster();// 模型点击事件function onmodelclick(event) {if (event.type == 'touchstart') {let touch = event.changedTouches[0]mouse.x = (touch.clientX / window.innerWidth) * 2 - 1;mouse.y = -(touch.clientY / window.innerHeight) * 2 + 1;}else {mouse.x = (event.clientX / window.innerWidth) * 2 - 1;mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;}raycaster.setFromCamera(mouse, camera);const intersects = raycaster.intersectObjects(scene.children);const lastObject = intersects.find(o =>o.object.name.startsWith('plane') ||o.object.name.startsWith('cube')) // 点击的物体是平面或者是立方体if (lastObject) { // 存在let lastObjectNormal = lastObject.normal // 点击的方向 let lastObjectPosition = lastObject.object.position // 物体的位置 let isPlane = lastObject.object.name.startsWith('plane'); // 是否点击的是平面if (mode == 'new') { // 是否是新增 let x = lastObjectNormal.x + lastObjectPosition.xlet y = lastObjectNormal.y + lastObjectPosition.y - (isPlane ? .5 : 0)let z = lastObjectNormal.z + lastObjectPosition.zlet checkCanPlaceRes = checkCanPlace(x, y, z)if (isRange(x, y, z) && checkCanPlaceRes) {x = checkCanPlaceRes.xy = checkCanPlaceRes.yz = checkCanPlaceRes.zcreateCube(x, y, z); // 新建物体 }else {console.log('不能添加');}refreshView()}else if (mode == 'del' && !isPlane) {let x = lastObjectPosition.xlet y = lastObjectPosition.ylet z = lastObjectPosition.zremoveUpperAndSelf(x, y, z)refreshView()}console.log('当前地图', Object.keys(cubeMap).map(v => {let [x, y, z] = v.split(',').map(p => +p)return { x, y, z }}));}}if (navigator.userAgent.includes('Android') || navigator.userAgent.includes('iPhone') || navigator.userAgent.includes('iPad')) {window.addEventListener("touchstart", onmodelclick)}else {window.addEventListener("click", onmodelclick);}// 是否在范围内function isRange(x, y, z) {let maxX = maximumSize / 2;let minX = -maximumSize / 2;let maxZ = maximumSize / 2;let minZ = -maximumSize / 2;let maxY = maximumSize;let minY = 0;if (y > maxY) return falseif (y < minY) return falseif (x >= maxX) return false;if (x < minX) return false;if (z >= maxZ) return false;if (z < minZ) return false;return true;}// 检查当前位置是否存在物体function checkPositionExist(key) {return cubeMap[key]}// 检测是否可以放置function checkCanPlace(x, y, z) {let standardKey = mapStandardKey(x, y, z)let standerdY = +standardKey.split(',')[1]for (let i = 0; i <= standerdY; i++) {if (!checkPositionExist(mapStandardKey(x, i, z))) {return {x,y: y - standerdY + i,z};}}return false}// 删除它上面的物体及自身function removeUpperAndSelf(x, y, z) {let standardKey = mapStandardKey(x, y, z)let standerdY = +standardKey.split(',')[1]for (let i = standerdY; i < maximumSize; i++) {let tmpStandardKey = mapStandardKey(x, i, z)let cube = checkPositionExist(tmpStandardKey)if (cube) {delete cubeMap[tmpStandardKey]scene.remove(cube)}}}// 坐标处理 便于存储function mapStandardKey(x, y, z) {y = Math.floor(y)x = x * -1 + maximumSize / 2 - 1;z = z + maximumSize / 2;return `${x},${y},${z}`}// 标准位置 用于3d展示function standardToScene(x, y, z) {y += .5x = x * -1 + maximumSize / 2 - 1;z = z - maximumSize / 2;return {x, y, z}}// 创建方块function createCube(x, y, z) {const geometry = new THREE.BoxGeometry(1, 1, 1);const material = cubeMaterial || new THREE.MeshStandardMaterial({ color: 0x00ff00 });const cube = new THREE.Mesh(geometry, material);cube.receiveShadow = truecube.castShadow = true;cube.position.x = xcube.position.y = ycube.position.z = zlet standardKey = mapStandardKey(x, y, z) // 获取x,y,z的标准cubeMap[standardKey] = cubecube.name = `cube(${x},${y},${z})`scene.add(cube)return cube}// 出一题function randomMap() {// 题库出题let questionList = [[{"x": 0,"y": 0,"z": 2},{"x": 1,"y": 0,"z": 2},{"x": 2,"y": 0,"z": 2},{"x": 3,"y": 0,"z": 2},{"x": 1,"y": 1,"z": 2}],[{"x": 1,"y": 0,"z": 2},{"x": 0,"y": 0,"z": 1},{"x": 1,"y": 0,"z": 1},{"x": 2,"y": 0,"z": 1},{"x": 1,"y": 1,"z": 1}],[{"x": 0,"y": 0,"z": 2},{"x": 1,"y": 0,"z": 2},{"x": 2,"y": 0,"z": 2},{"x": 0,"y": 1,"z": 2},{"x": 1,"y": 0,"z": 1}],[{"x": 0,"y": 0,"z": 3},{"x": 0,"y": 0,"z": 2},{"x": 0,"y": 0,"z": 1},{"x": 1,"y": 0,"z": 2},{"x": 1,"y": 0,"z": 3},{"x": 2,"y": 0,"z": 3},{"x": 0,"y": 1,"z": 3},{"x": 0,"y": 1,"z": 2},{"x": 0,"y": 2,"z": 3},{"x": 1,"y": 1,"z": 3}]]let queIndex = Randoms.getRandomInt(0, questionList.length)let que = questionList[queIndex]for (let i = 0; i < que.length; i++) {let { x, y, z } = que[i];createCube(...Object.values(standardToScene(x, y, z)))}// 随机出题// for (let i = 0; i < maximumSize; i++) {//     for (let j = 0; j < maximumSize; j++) {//         let h = Randoms.getRandomInt(0, maximumSize + 1) // 随机高度 [)//         console.log(h);//         for (let k = 0; k < h; k++) {//             let { x, y, z } = standardToScene(j, k, i) // 输出的坐标//             console.log(x, y, z);//             createCube(x, y, z)//         }//     }// }}// 检查问题是否正确function checkQuestionIsRight() {let cubeMapKeys = Object.keys(cubeMap)let frontViewIsRight = true;let topViewIsRight = truelet leftViewIsRight = true// 正视图for (let i = 0; i < frontViewDom.children.length; i++) {const viewCudeDom = frontViewDom.children.item(i);let tmpX = viewCudeDom.getAttribute('x')let tmpY = viewCudeDom.getAttribute('y')let active = viewCudeDom.classList.contains('active')let userActive = !!cubeMapKeys.find(key => key.startsWith(`${tmpX},${tmpY}`))console.log(tmpX, tmpY, active, userActive);if (active != userActive) {frontViewIsRight = false;break;}}// 顶视图for (let i = 0; i < topViewDom.children.length; i++) {const viewCudeDom = topViewDom.children.item(i);let tmpX = viewCudeDom.getAttribute('x')let tmpZ = viewCudeDom.getAttribute('y')let active = viewCudeDom.classList.contains('active')let userActive = !!cubeMapKeys.find(key => key.startsWith(`${tmpX}`) && key.endsWith(`${tmpZ}`))if (active != userActive) {topViewIsRight = false;break;}}// 左视图for (let i = 0; i < leftViewDom.children.length; i++) {const viewCudeDom = leftViewDom.children.item(i);let tmpZ = maximumSize - 1 - +viewCudeDom.getAttribute('x')let tmpY = viewCudeDom.getAttribute('y')let active = viewCudeDom.classList.contains('active')let userActive = !!cubeMapKeys.find(key => key.endsWith(`${tmpY},${tmpZ}`))if (active != userActive) {leftViewIsRight = false;break;}}if (frontViewIsRight) {frontViewDom.classList.add('right')}if (topViewIsRight) {topViewDom.classList.add('right')}if (leftViewIsRight) {leftViewDom.classList.add('right')}if (frontViewIsRight && topViewIsRight && leftViewIsRight) {winShow();}}// 渲染动画function animate() {renderer.render(scene, camera);requestAnimationFrame(animate);}animate();</script></body></html>

在线预览
https://linyisonger.github.io/H5.Examples/
源码仓库
https://github.com/linyisonger/H5.Examples.git

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

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【第35章】Spring Cloud之Seata-Server快速入门

文章目录 前言一、准备1. 架构图2. 工作机制3. Seata术语4. 事务模式4.1 Seata AT 模式(依赖数据库)4.2 Seata TCC 模式(不依赖数据库)4.3 Seata Saga 模式(支持长事务)4.4 Seata XA 模式(支持XA 协议) 二、安装1. 下载2. 解压3. 重要属性4. 修改配置4.1 配置中心4.2 注册中心4…

C语言 13 指针

指针可以说是整个 C 语言中最难以理解的部分了。 什么是指针 还记得在前面谈到的通过函数交换两个变量的值吗&#xff1f; #include <stdio.h>void swap(int, int);int main() {int a 10, b 20;swap(a, b);printf("a %d, b %d", a, b); }void swap(int …

循环神经网络RNN+长短期记忆网络LSTM 学习记录

循环神经网络&#xff08;RNN) RNN的的基础单元是一个循环单元&#xff0c;前部序列的信息经处理后&#xff0c;作为输入信息传递到后部序列 x为输入向量&#xff0c;y为输出向量&#xff0c;a为上一隐藏层的a与x通过激活函数得到的值&#xff0c;简言之&#xff0c;每一层神…

华为 HCIP-Datacom H12-821 题库 (23)

&#x1f423;博客最下方微信公众号回复题库,领取题库和教学资源 &#x1f424;诚挚欢迎IT交流有兴趣的公众号回复交流群 &#x1f998;公众号会持续更新网络小知识&#x1f63c; 1.以下关于 VRRP 基本概念的描述&#xff0c;错误的是哪些选项&#xff1f; A、一个虚拟路由器…

S32K3 工具篇6:如何将RTD EB工程导入到S32DS

S32K3 工具篇6&#xff1a;如何将RTD EB工程导入到S32DS 1. MCAL_Plugins->Link Source Resource Filters2. Includes3. Preprocessor4. Linker5. optimization6. main.c 这个主题实际上&#xff0c;之前已经有多人写过&#xff0c;并且写的很好&#xff0c;只是实际操作中&…

qt-creator-10.0.2之后版本的jom.exe编译速度慢下来了

1、Qt的IDE一直在升级&#xff0c;qt-creator的新版本下载地址 https://download.qt.io/official_releases/qtcreator/ 2、本人一直用的是qt-creator-10.0.2版本&#xff0c;官网历史仓库可以下载安装包qt-creator-opensource-windows-x86_64-10.0.2.exe https://download.qt…

URP 线性空间 ui资源制作规范

前言&#xff1a; 关于颜色空间的介绍&#xff0c;可参阅 unity 文档 Color space URP实现了基于物理的渲染&#xff0c;为了保证光照计算的准确&#xff0c;需要使用线性空间&#xff1b; 使用线性空间会带来一个问题&#xff0c;ui资源在unity中进行透明度混合时&#xff…

COMP 6714-Info Retrieval and Web Search笔记week1

哭了哭了&#xff0c;这周唯一能听懂的就这门 目录 IR&#xff08;Information Retrieval)是什么&#xff1f;IR的基本假设Unstructured (text) vs. structuredDocuments vs. Database Records比较文本&#xff08;Comparing Text&#xff09;IR的范围(Dimensions of IR)IR的任…

YoloV10改进策略:上采样改进|动态上采样|轻量高效,即插即用(适用于分类、分割、检测等多种场景)

摘要 本文使用动态上采样改进YoloV10,动态上采样是今天最新的上采样改进方法,具有轻量高效的特点,经过验证,在多个场景上均有大幅度的涨点,而且改进方法简单,即插即用! 论文:《DySample:Learning to Upsample by Learning to Sample》 论文:https://arxiv.org/pdf/…

fmql之ubuntu移植

官方资料&#xff1a;ubuntu18的压缩包 目的&#xff1a;放到SD卡中启动ubuntu&#xff08;官方是放在emmc中&#xff09; 教程&#xff1a;99_FMQL45_大黄蜂开发板跑ubuntu18.04.docx 所需文件 其中&#xff0c;format_emmc_ext4.txt对emmc的分区是512M&#xff08;放上述文…

C++ | Leetcode C++题解之第397题整数替换

题目&#xff1a; 题解&#xff1a; class Solution { public:int integerReplacement(int n) {int ans 0;while (n ! 1) {if (n % 2 0) {ans;n / 2;}else if (n % 4 1) {ans 2;n / 2;}else {if (n 3) {ans 2;n 1;}else {ans 2;n n / 2 1;}}}return ans;} };

如何查看串口被哪个程序占用?截止目前最方便的方法

痛点&#xff1a;串口因为某种原因被占用&#xff0c;如何找到罪魁祸首&#xff1f; 做开发的小伙伴们&#xff0c;经常会遇到这样的问题&#xff1a;串口因为某种原因被占用&#xff0c;导致无法通讯&#xff0c;但是又找不到被哪个程序占用。只有重启电脑&#xff0c;才能解…

CSS“多列布局”(补充)——WEB开发系列35

多列布局是一种非常常见的布局方式&#xff0c;适用于内容丰富的页面&#xff0c;如新闻网站、杂志或博客。 一、CSS多列布局概述 CSS多列布局允许我们将内容分成多个垂直列&#xff0c;使页面布局更加灵活和多样化。多列布局的主要属性包括 ​​column-count​​、​​column…

「数组」堆排序 / 大根堆优化(C++)

目录 概述 核心概念&#xff1a;堆 堆结构 数组存堆 思路 算法过程 up() down() Code 优化方案 大根堆优化 Code(pro) 复杂度 总结 概述 在「数组」快速排序 / 随机值优化|小区间插入优化&#xff08;C&#xff09;中&#xff0c;我们介绍了三种基本排序中的冒泡…

Java工具插件

一、springboot集成mqtt订阅 阿里云MQTT使用教程_复杂的世界311的博客-CSDN博客_阿里云mqtt 阿里云创建MQTT服务 先找到产品与服务,然后选择物联网平台,找到公共实例,创建一个产品。 创建产品 然后在左侧下拉栏找到设备管理,在设备管理下拉栏找到设备,然后添加设备。添加…

博客建站9 - hexo网站如何提升markdown文档的编辑效率和体验

1. 本网站的系统架构2. 场景概述3. 影响效率的问题和解决方案 3.1. 图片插入-根据文章来分类管理 3.1.1. 效率问题3.1.2. 解决方案 3.2. 图片插入-从剪贴板中插入图片 3.2.1. 效率问题3.2.2. 解决方案 3.3. 图片插入-在VSCode中预览图片 3.3.1. 效率问题3.3.2. 解决方案 3.4. 提…

【软考】设计模式之责任链模式

目录 1. 说明2. 应用场景3. 结构图4. 构成5. 适用性6. 优点7. 缺点8. java示例 1. 说明 1.使多个对象都有机会处理请求&#xff0c;从而避免请求的发送者和接收者之间的耦合关系。2.将这些对象连成一条链&#xff0c;并沿着这条链传递该请求&#xff0c;直到有一个对象处理它为…

个人学习笔记7-5:动手学深度学习pytorch版-李沐

#人工智能# #深度学习# #语义分割# #计算机视觉# #神经网络# 计算机视觉 13.10 转置卷积 例如&#xff0c;卷积层和汇聚层&#xff0c;通常会减少下采样输入图像的空间维度&#xff08;高和宽&#xff09;。然而如果输入和输出图像的空间维度相同&#xff0c;在以像素级分类…

c++基础入门二

C基础入门(二) 一、函数重载 在自然语言中&#xff0c;一句话或者一个词有不同的意思。例如&#xff1a;国乒和别人比赛是“谁也赢不了”&#xff0c;而国足和别人比赛是“谁也赢不了” 函数重载&#xff1a;是函数的一种特殊情况&#xff0c;C允许在同一作用域中声明几个功…

浪潮信息金风慧能:打造智慧新能源运营平台

近来&#xff0c;浪潮信息携手北京金风慧能技术有限公司&#xff08;简称“金风慧能”&#xff09;&#xff0c;共同发布了新能源场站集控中心的创新解决方案。该方案深度融合了浪潮信息的前沿服务器技术、软硬件一体化超融合方案及边缘计算产品与金风慧能自主研发的GW SCADA S…