当前位置: 首页 > news >正文

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单片机-实机演示(单多个数码管)

仿真链接&#xff1a; http://t.csdnimg.cn/QAPhx 目录 一.引脚位置 二.多个显示 三 扩展 一.引脚位置 注意P00 - >A ; 这个多个的在左边,右边的A到B是控制最右边那个单个的. 接下来上显示单个的代码 #include <reg52.h> #include <intrins.h> #define u…...

Pytorch深度学习实践笔记10(b站刘二大人)

&#x1f3ac;个人简介&#xff1a;一个全栈工程师的升级之路&#xff01; &#x1f4cb;个人专栏&#xff1a;pytorch深度学习 &#x1f380;CSDN主页 发狂的小花 &#x1f304;人生秘诀&#xff1a;学习的本质就是极致重复! 《PyTorch深度学习实践》完结合集_哔哩哔哩_bilibi…...

QT5.15.2及以上版本安装

更新时间&#xff1a;2024-05-20 安装qt5.15以上版本 系统&#xff1a;ubuntu20.04.06 本文安装&#xff1a;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 << "逆置前的字符串&#xff1a;" << a1 << endl;a1rerval(a1);…...

python给三维点上色,并添加颜色柱

python的matplotlib库给三维点上色&#xff0c;并添加颜色柱 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之解决:忘记登录密码(二百三十二)

简介&#xff1a; CSDN博客专家&#xff0c;专注Android/Linux系统&#xff0c;分享多mic语音方案、音视频、编解码等技术&#xff0c;与大家一起成长&#xff01; 优质专栏&#xff1a;Audio工程师进阶系列【原创干货持续更新中……】&#x1f680; 优质专栏&#xff1a;多媒…...

stream-并行流

定义 常规的流都是串行的流并行流就是并发的处理数据&#xff0c;一般要求被处理的数据互相不影响优点&#xff1a;数据多的时候速度更快&#xff0c;缺点&#xff1a;浪费系统资源&#xff0c;数据少的时候开启线程更耗费时间 模版 Stream<Integer> stream1 Stream.of…...

插件“猫抓”使用方法 - 浏览器下载m3u8视频 - 合并 - 视频检测下载 - 网课下载神器

前言 浏览器下载m3u8视频 - 合并 - 网课下载神器 chrome插件-猫抓 https://chrome.zzzmh.cn/info/jfedfbgedapdagkghmgibemcoggfppbb 步骤&#xff1a; P.s. 推荐大佬的学习视频&#xff01; 《WEB前端大师课》超级棒&#xff01; https://ke.qq.com/course/5892689#term_id…...

【quarkus系列】构建可执行文件native image

目录 序言为什么选择 Quarkus Native Image&#xff1f;性能优势便捷的云原生部署 搭建项目构建可执行文件方式一&#xff1a;配置GraalVM方式二&#xff1a;容器运行错误示例构建过程分析 创建docker镜像基于可执行文件命令式构建基于dockerfile构建方式一&#xff1a;构建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的证明

个人认为红色区域有问题&#xff0c;因为 deg ⁡ ( ϕ ( S j ) ) r \deg{\left( \phi\left( S_{j} \right) \right) r} deg(ϕ(Sj​))r&#xff0c;当 i ≥ r i \geq r i≥r时&#xff0c; s u b r e s i ( ϕ ( S j 1 ) , ϕ ( S j ) ) subres_{i}\left( \phi(S_{j 1}),\p…...

【Unity AR开发插件】如何快速地开发可热更的AR应用

预告 本专栏将介绍如何使用这个支持热更的AR开发插件&#xff0c;快速地开发AR应用。 Unity AR开发插件使用教程 更新 二、使用插件一键安装HybridCLR和ARCore 三、配置带HybridCLR的ARCore开发环境 四、制作热更数据-AR图片识别场景...

Divisibility Part1(整除理论1)

Divisibility Part1 学习本节的基础&#xff1a;任意个整数之间进行加、减、乘的混合运算之后的结果仍然是整数。之后将不申明地承认这句话的正确性并加以运用。 用一个不为 0 0 0的数去除另一个数所得的商却不一定是整数&#xff08; a a a除 b b b&#xff0c;写作 b a \frac…...

代码随想录算法训练营第三十七天 | 860.柠檬水找零、406.根据身高重建队列、452.用最少数量的箭引爆气球

目录 860.柠檬水找零 思路 代码 406.根据身高重建队列 思路 代码 452. 用最少数量的箭引爆气球 思路 代码 860.柠檬水找零 本题看上好像挺难&#xff0c;其实挺简单的&#xff0c;大家先尝试自己做一做。 代码随想录 思路 这题还有什么难不难的&#xff0c;这道题不是非…...

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、描述 本机&#xff08;Win10&#xff09;与虚拟机&#xff08;Ubuntu22.04.4&#xff09;上的BFTPD服务器建立FTP连接&#xff0c;执行一些基本操作。BFTPD安装教程&#xff1a;FTP协议——BFTPD安装&#xff08;Linux&#xff09;-CSDN博客 2、 步骤 启动BFTPD。启动文件…...

为什么需要分布式 ID?

目录 为什么需要分布式 ID 分布式 ID 的生成方法 分布式 ID 的应用场景 小结 在现代软件架构中&#xff0c;分布式系统架构变得越来越流行。在这些系统中&#xff0c;由于组件分散在不同的服务器、数据中心甚至不同的地理位置&#xff0c;因此要构建高性能、可扩展的应用系…...

用PyTorch从零复现PoolFormer:一个用平均池化替代自注意力的视觉Transformer

用PyTorch从零构建PoolFormer&#xff1a;揭秘平均池化如何颠覆视觉Transformer设计 当整个AI社区都在为Transformer的自注意力机制疯狂时&#xff0c;MetaFormer论文却提出了一个令人震惊的发现&#xff1a;模型性能的关键可能不在于复杂的注意力计算&#xff0c;而在于被长期…...

“冠珠·美乐童行”公益行动走进广州市增城区高滩小学,唱响爱、筑就美

在520爱家日十周年之际&#xff0c;冠珠瓷砖积极响应国家美育浸润与乡村教育振兴的政策号召&#xff0c;暖心开启 “冠珠美乐童行”公益行动。首站活动由冠珠瓷砖、广州市越秀山体育中心共同主办&#xff0c;以 “乐动童心美育同行” 为主题&#xff0c;走进广州市增城区高滩小…...

掌握Manim数学动画引擎:从零到一的完整攻略

掌握Manim数学动画引擎&#xff1a;从零到一的完整攻略 【免费下载链接】manim Animation engine for explanatory math videos 项目地址: https://gitcode.com/GitHub_Trending/ma/manim Manim是一款专为数学可视化设计的强大动画引擎&#xff0c;能够通过编程方式创建…...

Shader Graph边缘光原理与实战:从菲涅尔效应到世界空间法线

1. 为什么边缘光不是“加个描边”那么简单——从美术需求到Shader本质的错位“给模型加个边缘光”&#xff0c;听起来像Unity编辑器里拖个组件、点几下鼠标就能搞定的事。我第一次接到这个需求时&#xff0c;美术同学在评审会上甩出一张《原神》角色截图&#xff0c;指着雷电将…...

兄弟反目成仇?《易经》深挖人性:猜疑才是最大祸根

你有没有过这样的经历&#xff1f;关系最好的朋友或同事&#xff0c;因为一个误会&#xff0c;突然就成了“最熟悉的陌生人”。你解释&#xff0c;他觉得你掩饰&#xff1b;你沉默&#xff0c;他觉得你默认。最后&#xff0c;好好的关系&#xff0c;硬生生被“猜疑”这把刀&…...

[特殊字符]通用漏洞挖掘(黑盒篇)| 从一个登录框SQL注入,到拿下CNVD证书

&#x1f3af; 0x00 这篇文章能给你什么&#xff1f; 黑盒测试中 如何发现 SQL 注入&#xff08;手工 思路&#xff09; 万能密码 ≠ 全部&#xff0c;但有了它一定有问题 如何从“事件型漏洞”升级为“通用型漏洞” 利用 JS 指纹 在 FOFA 上批量找同款系统 CNVD 证书 的获…...

UDS_自动化脚本生成_10服务_V01

1、原子元素 1.1 会话原子 Session.Default() Session.Extended() Session.Programming() Session.Developer() 1.2 请求原子 10 01 10 02 10 03 10 76 10 81 10 82 10 83 10 F6 10 04 10 84 10 / 10 01 00 / 10 02 00 / 10 03 00 / 10 76 00 1.3 响应原子 50 01 00 32 01 F4 …...

Keil MDK构建时间戳记录方案与实现

1. 项目概述&#xff1a;Keil MDK构建时间戳记录方案在嵌入式开发中&#xff0c;项目构建&#xff08;Project Build&#xff09;的时间管理是个容易被忽视却至关重要的细节。当我们需要调试复杂工程时&#xff0c;准确记录构建开始时间可以帮助我们同步调试日志&#xff1b;而…...

边缘AI加速:CGRA架构与近似计算技术解析

1. 项目概述在边缘计算和人工智能快速发展的今天&#xff0c;如何设计高能效的硬件架构来支持复杂的神经网络推理任务&#xff0c;成为了一个关键挑战。传统的ASIC方案虽然性能优异&#xff0c;但缺乏灵活性&#xff1b;而通用处理器又难以满足能效要求。粗粒度可重构架构(CGRA…...

初创团队如何利用 Taotoken Token Plan 有效控制 AI 实验成本

&#x1f680; 告别海外账号与网络限制&#xff01;稳定直连全球优质大模型&#xff0c;限时半价接入中。 &#x1f449; 点击领取海量免费额度 初创团队如何利用 Taotoken Token Plan 有效控制 AI 实验成本 对于资源有限的初创团队而言&#xff0c;在产品原型和概念验证阶段&…...