three.js官方案例webgl_loader_fbx.html学习
目录
1.1 添加库引入
1.2 添加必要的组件scene,camera,webrenderer等
1.3 模型加载
1.4 半球光
1.5 动画
1.6 换个自己的fbx模型
1.7 fbx模型和fbx动画关联
1.7 html脚本全部如下
1.8 fbx.js全部脚本如下
1.1 添加库引入
import * as THREE from 'three';
import Stats from 'three/addons/libs/stats.module.js';//控制器
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';//fbx模型加载器
import { FBXLoader } from 'three/addons/loaders/FBXLoader.js';
1.2 添加必要的组件scene,camera,webrenderer等
先创建必要的场景scene,相机camera,渲染器webrenderer,控制器controls和灯光DirectionalLight. 性能检测stars, 地面, 网格
自定义属性
let camera, scene, renderer, stats;
function init() {const container = document.createElement( 'div' );document.body.appendChild( container );//相机camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );camera.position.set( 100, 200, 300 );//场景scene = new THREE.Scene();scene.background = new THREE.Color( 0xa0a0a0 );scene.fog = new THREE.Fog( 0xa0a0a0, 200, 1000 );//雾//灯 模拟太阳光const dirLight = new THREE.DirectionalLight( 0xffffff, 5 );dirLight.position.set( 0, 200, 100 );dirLight.castShadow = true;//此属性设置为 true 灯光将投射阴影 注意:这样做的代价比较高,需要通过调整让阴影看起来正确。 查看 DirectionalLightShadow 了解详细信息。 默认值为 false//dirLight.shadow 为DirectionalLightShadow 对象,用于计算该平行光产生的阴影//.camera 在光的世界里。这用于生成场景的深度图;从光的角度来看,其他物体背后的物体将处于阴影中dirLight.shadow.camera.top = 180;dirLight.shadow.camera.bottom = - 100;dirLight.shadow.camera.left = - 120;dirLight.shadow.camera.right = 120;scene.add( dirLight );// ground 地面const mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2000, 2000 ), new THREE.MeshPhongMaterial( { color: 0x999999, depthWrite: false } ) );mesh.rotation.x = - Math.PI / 2;mesh.receiveShadow = true;scene.add( mesh );//网格const grid = new THREE.GridHelper( 2000, 20, 0x000000, 0x000000 );grid.material.opacity = 0.2;grid.material.transparent = true;scene.add( grid );//WEBGL渲染器renderer = new THREE.WebGLRenderer( { antialias: true } );renderer.setPixelRatio( window.devicePixelRatio );renderer.setSize( window.innerWidth, window.innerHeight );renderer.shadowMap.enabled = true;//container.appendChild( renderer.domElement );//控制器const controls = new OrbitControls( camera, renderer.domElement );controls.target.set( 0, 100, 0 );controls.update();// stats 性能检测stats = new Stats();container.appendChild( stats.dom );}

1.3 模型加载
function fbxLoad(path){// model 加载模型const loader = new FBXLoader();loader.load( path, function ( object ) {console.log(object);//动画混合器mixer = new THREE.AnimationMixer( object );// 返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称const action = mixer.clipAction( object.animations[ 0 ] );action.play();//动画播放object.traverse( function ( child ) {if ( child.isMesh ) {child.castShadow = true;//对象是否被渲染到阴影贴图中。默认值为falsechild.receiveShadow = true;//材质是否接收阴影。默认值为false}} );scene.add( object );} );
}

打印的模型信息如下:

1.4 半球光
HemisphereLight( skyColor : Integer, groundColor : Integer, intensity : Float )
skyColor -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 Color 对象。
groundColor -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 Color 对象。
intensity -(可选)光照强度。默认值为 1
//灯 半球光
//光源直接放置于场景之上,光照颜色从天空光线颜色渐变到地面光线颜色
const hemiLight = new THREE.HemisphereLight( 0xffffff, 0x444444, 5 );
hemiLight.position.set( 0, 200, 0 );
scene.add( hemiLight );
加上这个光后,模型明显变量了。
1.5 动画
function animate() {requestAnimationFrame( animate );
//获取自 .oldTime 设置后到当前的秒数。 同时将 .oldTime 设置为当前时间。
//如果 .autoStart 设置为 true 且时钟并未运行,则该方法同时启动时钟const delta = clock.getDelta();//if ( mixer ) mixer.update( delta );//动画更新renderer.render( scene, camera );stats.update();//性能监视器更新}
init();
animate();
1.6 换个自己的fbx模型
fbxLoad('../Models/ren/Arisa/Arisa.fbx');

这里模型加载进去小,所以进行了放大100
function fbxLoad(path){// model 加载模型const loader = new FBXLoader();loader.load( path, function ( object ) {console.log(object);//动画混合器mixer = new THREE.AnimationMixer( object );// 返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称if(object.animations>0){const action = mixer.clipAction( object.animations[ 0 ] );action.play();//动画播放}object.traverse( function ( child ) {if ( child.isMesh ) {child.castShadow = true;//对象是否被渲染到阴影贴图中。默认值为falsechild.receiveShadow = true;//材质是否接收阴影。默认值为false}} );object.position.set(0,0,0);object.scale.set(100,100,100);scene.add( object );} );}
注意:需要把贴图和fbx放入同一个文件下

1.7 fbx模型和fbx动画关联
如果模型和动画不在一个文件里,比如模型是一个fbx,动画是另一个fbx,需要这么加载:
function fbxLoad(path,aniPath){// model 加载模型const loader = new FBXLoader();loader.load( path, function ( object ) {console.log(object);//动画混合器mixer = new THREE.AnimationMixer( object );// 返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称// if(object.animations>0){// const action = mixer.clipAction( object.animations[ 0 ] );// action.play();//动画播放// }object.traverse( function ( child ) {if ( child.isMesh ) {child.castShadow = true;//对象是否被渲染到阴影贴图中。默认值为falsechild.receiveShadow = true;//材质是否接收阴影。默认值为false}} );object.position.set(0,0,0);//object.scale.set(100,100,100);scene.add( object );const clips={};const actions={};//加载动画loader.load(aniPath,(animations)=>{console.log(animations);animations.animations.forEach((clip)=>{clips[clip.name]=clip;actions[clip.name]=mixer.clipAction(clip);});actions['Take 001'].play(); }) ; } );}
针对后缀的anim的动画文件,目前是需要这么解决
我找了个之前Unity工程里用的人物模型,一个fbx里包含了8种风格的人物 和他的6个动作fbx:

为了切换不同人物和不同的动画,增加了一个UI模块:


把模型和动画加载的函数重构了下:
// model 加载模型function fbxLoad(path,aniPath,type){//移除已有的while ( root.children.length > 0 ) {const object = root.children[ 0 ];object.parent.remove( object );} container.style.display='block';percenDiv.style.width=0+"px";//进度条元素长度0percenDiv.style.textIndent=0+5+"px";//缩进元素中的首行文本0percenDiv.innerHTML=Math.floor(0) +"%";//进度百分比0//开始加载loader.load( path, function ( object ) {console.log(object); container.style.display='none'; //动画混合器mixer = new THREE.AnimationMixer(object);// 返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称// if(object.animations>0){// const action = mixer.clipAction( object.animations[ 0 ] );// action.play();//动画播放// }object.position.set(0,0,0);//object.scale.set(100,100,100);root.add( object );ChangePerson2(currenPersonType);// object.traverse( function ( child ) { // if ( child.isMesh ) {// ChangePerson(child,currenPersonType);// child.castShadow = true;//对象是否被渲染到阴影贴图中。默认值为false// child.receiveShadow = true;//材质是否接收阴影。默认值为false// } // } );//加载动画LoadPersonAnimation(aniPath);// loader.load(aniPath,(animations)=>{// let clipName;// console.log(animations);// animations.animations.forEach((clip)=>{// clips[clip.name]=clip;// actions[clip.name]=mixer.clipAction(clip);// clipName=clip.name;// });// actions[clipName].play(); // }) ; },function(xhr){const percent=xhr.loaded/xhr.total; percenDiv.style.width=percent*400+"px";//进度条元素长度percenDiv.style.textIndent=percent*400+5+"px";//缩进元素中的首行文本percenDiv.innerHTML=Math.floor(percent*100) +"%";//进度百分比} );}//加载动画fbxfunction LoadPersonAnimation(aniPath){mixer.stopAllAction ();//停用混合器上所有预定的动作loader.load(aniPath,(animations)=>{let clipName;console.log(animations);animations.animations.forEach((clip)=>{clips[clip.name]=clip;//clipAction返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称。如果不存在符合传入的剪辑和根对象这两个参数的动作, 该方法将会创建一个。传入相同的参数多次调用将会返回同一个剪辑实例。actions[clip.name]=mixer.clipAction(clip);clipName=clip.name;});actions[clipName].play(); }) ; }
UI监听的两函数:

1.7 html脚本全部如下
里面加了一个进度条,这部分我也不是很了解,脚本如下:
<!DOCTYPE html>
<html lang="en"><head><title>three.js webgl - FBX loader</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"><link type="text/css" rel="stylesheet" href="../three.js-r163/examples/main.css"><style>
/* 进度条css样式*/
#container{position: absolute;width: 400px;height: 16px;top: 50%;left: 50%;margin-left: -200px;margin-top: -8px;border-radius: 8px;border: 1px solid #009999;overflow: hidden;}#per{height: 100px;width: 0px;background: #00ffff;color: #00ffff;line-height: 15px;}</style></head><body><div id="info"><a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - FBXLoader<br />Character and animation from <a href="https://www.mixamo.com/" target="_blank" rel="noopener">Mixamo</a></div><div id="container"><!--进度条--><div id="per"></div></div><script type="importmap">{"imports": {"three": "../three.js-r163/build/three.module.js", "three/addons/":"../three.js-r163/examples/jsm/" }}</script><script type="module" src="fbx.js"></script></body>
</html>
1.8 fbx.js全部脚本如下
import * as THREE from 'three';
import Stats from 'three/addons/libs/stats.module.js';//控制器
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';//fbx模型加载器
import { FBXLoader } from 'three/addons/loaders/FBXLoader.js';//引入ui库import { GUI } from 'three/addons/libs/lil-gui.module.min.js';let camera, scene, renderer, stats;const clock = new THREE.Clock();//该对象用于跟踪时间let mixer;//动画混合器let gui;//uilet root;//模型的父物体const percenDiv=document.getElementById('per');//获取进度条元素const container=document.getElementById('container');//获取进度条元素背景//不同人物对象const Persons = {'人物1': '01','人物2': '02','人物3': '03','人物4': '04','人物5': '05','人物6': '06','人物7': '07','人物8': '08', };const params = {molecule: '01',currentAni:'idle',};//不同的动画const PersonAnis={'idle':'idle','Asking Question':'Asking Question','Clapping':'Clapping','Running':'Running','sit':'sit','sit_Clapping':'sit_Clapping','Waving':'Waving'}let currenPersonType='01';;//当前人物let currentPersonAni='idle';//当前动画const loader = new FBXLoader();//模型加载器const clips={};const actions={};function init() {const container = document.createElement( 'div' );document.body.appendChild( container );//相机camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );camera.position.set( 100, 200, 300 );//场景scene = new THREE.Scene();scene.background = new THREE.Color( 0xa0a0a0 );scene.fog = new THREE.Fog( 0xa0a0a0, 200, 1000 );//雾//灯 模拟太阳光const dirLight = new THREE.DirectionalLight( 0xffffff, 5 );dirLight.position.set( 0, 200, 100 );dirLight.castShadow = true;//此属性设置为 true 灯光将投射阴影 注意:这样做的代价比较高,需要通过调整让阴影看起来正确。 查看 DirectionalLightShadow 了解详细信息。 默认值为 false//dirLight.shadow 为DirectionalLightShadow 对象,用于计算该平行光产生的阴影//.camera 在光的世界里。这用于生成场景的深度图;从光的角度来看,其他物体背后的物体将处于阴影中dirLight.shadow.camera.top = 180;dirLight.shadow.camera.bottom = - 100;dirLight.shadow.camera.left = - 120;dirLight.shadow.camera.right = 120;scene.add( dirLight );root=new THREE.Group();scene.add(root);// ground 地面const mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2000, 2000 ), new THREE.MeshPhongMaterial( { color: 0x999999, depthWrite: false } ) );mesh.rotation.x = - Math.PI / 2;mesh.receiveShadow = true;//接收阴影scene.add( mesh );//网格const grid = new THREE.GridHelper( 2000, 20, 0x000000, 0x000000 );grid.material.opacity = 0.2;grid.material.transparent = true;scene.add( grid );//WEBGL渲染器renderer = new THREE.WebGLRenderer( { antialias: true } );renderer.setPixelRatio( window.devicePixelRatio );renderer.setSize( window.innerWidth, window.innerHeight );renderer.shadowMap.enabled = true;//container.appendChild( renderer.domElement );//控制器const controls = new OrbitControls( camera, renderer.domElement );controls.target.set( 0, 100, 0 );controls.update();// stats 性能检测stats = new Stats();container.appendChild( stats.dom );// //窗口大小更改监听window.addEventListener( 'resize', onWindowResize );//fbxLoad('../Models/Arisa/Arisa.fbx');fbxLoad('../Models/ren/man.fbx','../Models/ren/idle.fbx','01');//灯 半球光//光源直接放置于场景之上,光照颜色从天空光线颜色渐变到地面光线颜色const hemiLight = new THREE.HemisphereLight( 0xffffff, 0x444444, 5 );hemiLight.position.set( 0, 200, 0 );scene.add( hemiLight );//scene.add( new THREE.CameraHelper( dirLight.shadow.camera ) );//ui部分gui=new GUI();gui.add( params, 'molecule', Persons).onChange( ChangePerson2 );//切换不同的人物模型gui.add( params, 'currentAni', PersonAnis).onChange( ChangePersonAni );//切换不同的人物模型gui.open(); }// model 加载模型function fbxLoad(path,aniPath,type){//移除已有的while ( root.children.length > 0 ) {const object = root.children[ 0 ];object.parent.remove( object );} container.style.display='block';percenDiv.style.width=0+"px";//进度条元素长度0percenDiv.style.textIndent=0+5+"px";//缩进元素中的首行文本0percenDiv.innerHTML=Math.floor(0) +"%";//进度百分比0//开始加载loader.load( path, function ( object ) {console.log(object); container.style.display='none'; //动画混合器mixer = new THREE.AnimationMixer(object);// 返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称// if(object.animations>0){// const action = mixer.clipAction( object.animations[ 0 ] );// action.play();//动画播放// }object.position.set(0,0,0);//object.scale.set(100,100,100);root.add( object );ChangePerson2(currenPersonType);// object.traverse( function ( child ) { // if ( child.isMesh ) {// ChangePerson(child,currenPersonType);// child.castShadow = true;//对象是否被渲染到阴影贴图中。默认值为false// child.receiveShadow = true;//材质是否接收阴影。默认值为false// } // } );//加载动画LoadPersonAnimation(aniPath);// loader.load(aniPath,(animations)=>{// let clipName;// console.log(animations);// animations.animations.forEach((clip)=>{// clips[clip.name]=clip;// actions[clip.name]=mixer.clipAction(clip);// clipName=clip.name;// });// actions[clipName].play(); // }) ; },function(xhr){const percent=xhr.loaded/xhr.total; percenDiv.style.width=percent*400+"px";//进度条元素长度percenDiv.style.textIndent=percent*400+5+"px";//缩进元素中的首行文本percenDiv.innerHTML=Math.floor(percent*100) +"%";//进度百分比} );}//加载动画fbxfunction LoadPersonAnimation(aniPath){mixer.stopAllAction ();//停用混合器上所有预定的动作loader.load(aniPath,(animations)=>{let clipName;console.log(animations);animations.animations.forEach((clip)=>{clips[clip.name]=clip;//clipAction返回所传入的剪辑参数的AnimationAction, 根对象参数可选,默认值为混合器的默认根对象。第一个参数可以是动画剪辑(AnimationClip)对象或者动画剪辑的名称。如果不存在符合传入的剪辑和根对象这两个参数的动作, 该方法将会创建一个。传入相同的参数多次调用将会返回同一个剪辑实例。actions[clip.name]=mixer.clipAction(clip);clipName=clip.name;});actions[clipName].play(); }) ; }function onWindowResize() {camera.aspect = window.innerWidth / window.innerHeight;camera.updateProjectionMatrix();renderer.setSize( window.innerWidth, window.innerHeight );}//function animate() {requestAnimationFrame( animate );//获取自 .oldTime 设置后到当前的秒数。 同时将 .oldTime 设置为当前时间。
//如果 .autoStart 设置为 true 且时钟并未运行,则该方法同时启动时钟const delta = clock.getDelta();//if ( mixer ) mixer.update( delta );//推进混合器时间并更新动画renderer.render( scene, camera );stats.update();//性能监视器更新}init();animate();// function ChangePerson(child,type){// currenPersonType=type;// //fbxLoad('../Models/ren/man.fbx','../Models/ren/'+currentPersonAni+'.fbx',type);// if(child.name.includes(type)){// console.log(child.name);// //这里如果是clone 导致切换时不显示// child.copy(child).visible=true;// }else{// child.visible=false;// }// }//切换人物function ChangePerson2(type){currenPersonType=type; root.traverse( function ( child ) { if ( child.isMesh ) {//ChangePerson(child,type);if(child.name.includes(type)){console.log(child.name);//这里如果是clone 导致切换时不显示child.copy(child).visible=true;}else{child.visible=false;} } } );}//切换人物动画function ChangePersonAni(Anitype){currentPersonAni=Anitype;LoadPersonAnimation('../Models/ren/'+Anitype+'.fbx'); }

运行结果:

相关文章:
three.js官方案例webgl_loader_fbx.html学习
目录 1.1 添加库引入 1.2 添加必要的组件scene,camera,webrenderer等 1.3 模型加载 1.4 半球光 1.5 动画 1.6 换个自己的fbx模型 1.7 fbx模型和fbx动画关联 1.7 html脚本全部如下 1.8 fbx.js全部脚本如下 1.1 添加库引入 import * as THREE from three; import Stats …...
51单片机-实机演示(单多个数码管)
仿真链接: http://t.csdnimg.cn/QAPhx 目录 一.引脚位置 二.多个显示 三 扩展 一.引脚位置 注意P00 - >A ; 这个多个的在左边,右边的A到B是控制最右边那个单个的. 接下来上显示单个的代码 #include <reg52.h> #include <intrins.h> #define u…...
Pytorch深度学习实践笔记10(b站刘二大人)
🎬个人简介:一个全栈工程师的升级之路! 📋个人专栏:pytorch深度学习 🎀CSDN主页 发狂的小花 🌄人生秘诀:学习的本质就是极致重复! 《PyTorch深度学习实践》完结合集_哔哩哔哩_bilibi…...
QT5.15.2及以上版本安装
更新时间:2024-05-20 安装qt5.15以上版本 系统:ubuntu20.04.06 本文安装:linux-5.15.2 下载安装 # 安装编译套件g sudo apt-get install build-essential #安装OpenGL sudo apt-get install libgl1-mesa-dev# 下载qt安装器 https://downl…...
5月27日
思维导图 #include <iostream>using namespace std; namespace st_open {string a1;string retval(string a1);} using namespace st_open; int main() {getline(cin,a1);cout << "逆置前的字符串:" << a1 << endl;a1rerval(a1);…...
python给三维点上色,并添加颜色柱
python的matplotlib库给三维点上色,并添加颜色柱 import numpy as np from pathlib import Path import matplotlib.cm as cm import matplotlib.pyplot as plt# 可视化3d点迹 def Show3D_complete(points3D_result, color_list, save_path):# 指定起止点start_poin…...
Ubuntu22.04之解决:忘记登录密码(二百三十二)
简介: CSDN博客专家,专注Android/Linux系统,分享多mic语音方案、音视频、编解码等技术,与大家一起成长! 优质专栏:Audio工程师进阶系列【原创干货持续更新中……】🚀 优质专栏:多媒…...
stream-并行流
定义 常规的流都是串行的流并行流就是并发的处理数据,一般要求被处理的数据互相不影响优点:数据多的时候速度更快,缺点:浪费系统资源,数据少的时候开启线程更耗费时间 模版 Stream<Integer> stream1 Stream.of…...
插件“猫抓”使用方法 - 浏览器下载m3u8视频 - 合并 - 视频检测下载 - 网课下载神器
前言 浏览器下载m3u8视频 - 合并 - 网课下载神器 chrome插件-猫抓 https://chrome.zzzmh.cn/info/jfedfbgedapdagkghmgibemcoggfppbb 步骤: P.s. 推荐大佬的学习视频! 《WEB前端大师课》超级棒! https://ke.qq.com/course/5892689#term_id…...
【quarkus系列】构建可执行文件native image
目录 序言为什么选择 Quarkus Native Image?性能优势便捷的云原生部署 搭建项目构建可执行文件方式一:配置GraalVM方式二:容器运行错误示例构建过程分析 创建docker镜像基于可执行文件命令式构建基于dockerfile构建方式一:构建mic…...
linux(ubuntu)常用的代理设置
1. git代理设置与取消 # 设置 git config --global http.proxy socks5://127.0.0.1:1234 git config --global https.proxy socks5://127.0.0.1:1234 # 取消 git config --global --unset http.proxy git config --global --unset https.proxy2. conda代理设置与取消 在.cond…...
红队攻防渗透技术实战流程:红队目标上线之Webshell免杀对抗
红队攻防免杀实战 1. 红队目标上线-Webshell免杀-基础准备2. 红队目标上线-Webshell免杀-基础内容3.红队目标上线-Webshell免杀-建立认知3.红队目标上线-Webshell免杀-测试实验3.1 查杀对象-Webshell&C2后门&工具&钓鱼3.2 免杀对象-Webshell&表面代码&行为…...
Habicht定理中有关子结式命题3.4.6的证明
个人认为红色区域有问题,因为 deg ( ϕ ( S j ) ) r \deg{\left( \phi\left( S_{j} \right) \right) r} deg(ϕ(Sj))r,当 i ≥ r i \geq r i≥r时, s u b r e s i ( ϕ ( S j 1 ) , ϕ ( S j ) ) subres_{i}\left( \phi(S_{j 1}),\p…...
【Unity AR开发插件】如何快速地开发可热更的AR应用
预告 本专栏将介绍如何使用这个支持热更的AR开发插件,快速地开发AR应用。 Unity AR开发插件使用教程 更新 二、使用插件一键安装HybridCLR和ARCore 三、配置带HybridCLR的ARCore开发环境 四、制作热更数据-AR图片识别场景...
Divisibility Part1(整除理论1)
Divisibility Part1 学习本节的基础:任意个整数之间进行加、减、乘的混合运算之后的结果仍然是整数。之后将不申明地承认这句话的正确性并加以运用。 用一个不为 0 0 0的数去除另一个数所得的商却不一定是整数( a a a除 b b b,写作 b a \frac…...
代码随想录算法训练营第三十七天 | 860.柠檬水找零、406.根据身高重建队列、452.用最少数量的箭引爆气球
目录 860.柠檬水找零 思路 代码 406.根据身高重建队列 思路 代码 452. 用最少数量的箭引爆气球 思路 代码 860.柠檬水找零 本题看上好像挺难,其实挺简单的,大家先尝试自己做一做。 代码随想录 思路 这题还有什么难不难的,这道题不是非…...
GolangFoundation
GolangFoundation 一. Hello World1.1 SDK1.2 环境1.3 hello world1.4 语法规则二. 程序结构2.1 循环2.2 概述2.3 完整写法2.4 类似while2.5 死循环2.6 特殊循环三. 变量3.1 命名3.2 声明2.3 变量...
如果任务过多,队列积压怎么处理?
如果任务过多,队列积压怎么处理? 1、内存队列满了应该怎么办2、问题要治本——发短信导致吞吐量降低的问题不能忽略!!3、多路复用IO模型的核心组件简介1、内存队列满了应该怎么办 如图: 大家可以看到,虽然现在发短信和广告投递,彼此之间的执行效率不受彼此影响,但是请…...
FTP协议——BFTPD基本操作(Ubuntu+Win)
1、描述 本机(Win10)与虚拟机(Ubuntu22.04.4)上的BFTPD服务器建立FTP连接,执行一些基本操作。BFTPD安装教程:FTP协议——BFTPD安装(Linux)-CSDN博客 2、 步骤 启动BFTPD。启动文件…...
为什么需要分布式 ID?
目录 为什么需要分布式 ID 分布式 ID 的生成方法 分布式 ID 的应用场景 小结 在现代软件架构中,分布式系统架构变得越来越流行。在这些系统中,由于组件分散在不同的服务器、数据中心甚至不同的地理位置,因此要构建高性能、可扩展的应用系…...
地震勘探——干扰波识别、井中地震时距曲线特点
目录 干扰波识别反射波地震勘探的干扰波 井中地震时距曲线特点 干扰波识别 有效波:可以用来解决所提出的地质任务的波;干扰波:所有妨碍辨认、追踪有效波的其他波。 地震勘探中,有效波和干扰波是相对的。例如,在反射波…...
中南大学无人机智能体的全面评估!BEDI:用于评估无人机上具身智能体的综合性基准测试
作者:Mingning Guo, Mengwei Wu, Jiarun He, Shaoxian Li, Haifeng Li, Chao Tao单位:中南大学地球科学与信息物理学院论文标题:BEDI: A Comprehensive Benchmark for Evaluating Embodied Agents on UAVs论文链接:https://arxiv.…...
Docker 运行 Kafka 带 SASL 认证教程
Docker 运行 Kafka 带 SASL 认证教程 Docker 运行 Kafka 带 SASL 认证教程一、说明二、环境准备三、编写 Docker Compose 和 jaas文件docker-compose.yml代码说明:server_jaas.conf 四、启动服务五、验证服务六、连接kafka服务七、总结 Docker 运行 Kafka 带 SASL 认…...
对WWDC 2025 Keynote 内容的预测
借助我们以往对苹果公司发展路径的深入研究经验,以及大语言模型的分析能力,我们系统梳理了多年来苹果 WWDC 主题演讲的规律。在 WWDC 2025 即将揭幕之际,我们让 ChatGPT 对今年的 Keynote 内容进行了一个初步预测,聊作存档。等到明…...
反射获取方法和属性
Java反射获取方法 在Java中,反射(Reflection)是一种强大的机制,允许程序在运行时访问和操作类的内部属性和方法。通过反射,可以动态地创建对象、调用方法、改变属性值,这在很多Java框架中如Spring和Hiberna…...
Java多线程实现之Thread类深度解析
Java多线程实现之Thread类深度解析 一、多线程基础概念1.1 什么是线程1.2 多线程的优势1.3 Java多线程模型 二、Thread类的基本结构与构造函数2.1 Thread类的继承关系2.2 构造函数 三、创建和启动线程3.1 继承Thread类创建线程3.2 实现Runnable接口创建线程 四、Thread类的核心…...
AI书签管理工具开发全记录(十九):嵌入资源处理
1.前言 📝 在上一篇文章中,我们完成了书签的导入导出功能。本篇文章我们研究如何处理嵌入资源,方便后续将资源打包到一个可执行文件中。 2.embed介绍 🎯 Go 1.16 引入了革命性的 embed 包,彻底改变了静态资源管理的…...
华硕a豆14 Air香氛版,美学与科技的馨香融合
在快节奏的现代生活中,我们渴望一个能激发创想、愉悦感官的工作与生活伙伴,它不仅是冰冷的科技工具,更能触动我们内心深处的细腻情感。正是在这样的期许下,华硕a豆14 Air香氛版翩然而至,它以一种前所未有的方式&#x…...
人机融合智能 | “人智交互”跨学科新领域
本文系统地提出基于“以人为中心AI(HCAI)”理念的人-人工智能交互(人智交互)这一跨学科新领域及框架,定义人智交互领域的理念、基本理论和关键问题、方法、开发流程和参与团队等,阐述提出人智交互新领域的意义。然后,提出人智交互研究的三种新范式取向以及它们的意义。最后,总结…...
【笔记】WSL 中 Rust 安装与测试完整记录
#工作记录 WSL 中 Rust 安装与测试完整记录 1. 运行环境 系统:Ubuntu 24.04 LTS (WSL2)架构:x86_64 (GNU/Linux)Rust 版本:rustc 1.87.0 (2025-05-09)Cargo 版本:cargo 1.87.0 (2025-05-06) 2. 安装 Rust 2.1 使用 Rust 官方安…...
