Threejs_14 制作圣誕賀卡

繼續跟著@老陳打碼學習!!!支持!!!??

效果圖

鏈接:https://pan.baidu.com/s/1Ft8U2HTeqmpyAeesL31iUg?
提取碼:6666?
使用到的 模型文件和資源等都為@老陳打碼提供!!!!!!!!!!!

如何做出這樣的一個效果呢?

1.構建項目文件

這里使用了vue3+vite的寫法。代碼是腳手架直接生成的,安裝一個gsap和three就行了

{"name": "threejs-vue","version": "0.0.0","private": true,"scripts": {"dev": "vite","build": "vite build","preview": "vite preview"},"dependencies": {"gsap": "^3.12.2","three": "^0.158.0","vue": "^3.3.4"},"devDependencies": {"@vitejs/plugin-vue": "^4.4.0","vite": "^4.4.11"}
}

2.引入相關依賴

引入我們threejs項目相關的依賴,控制器啊,gltf加載器啊,還有解壓工具,補間動畫庫等。

import { ref } from "vue";
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
import { Water } from "three/examples/jsm/objects/Water2";
import gsap from "gsap/gsap-core";

3.初始化場景

threejs的第一步,初始化一個場景,創建相機,引入控制器等。其中相機的位置等參數都是實現測好的,所以直接就寫好了。

//初始化場景
const scene = new THREE.Scene();
//初始化相機
const camera = new THREE.PerspectiveCamera(75,window.innerWidth / window.innerHeight,0.1,1000
);
camera.position.set(-3.23, 2.98, 4.06);
camera.updateProjectionMatrix();
//初始化渲染器
const renderer = new THREE.WebGLRenderer({//設置抗鋸齒antialias: true,
});
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);//初始化控制器
const controls = new OrbitControls(camera, renderer.domElement);
controls.target.set(-8, 2, 0);
// 
controls.enableDamping = true;// 渲染函數
function render() {requestAnimationFrame(render);renderer.render(scene, camera);controls.update();
}render();

4.添加模型

?1.初始化解壓模型

我們要用的模型文件是一個壓縮的文件,所以使用的時候,需要全局引用解壓模型。

//初始化解壓模型
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath("/public/draco/");
const gltfLoader = new GLTFLoader();
gltfLoader.setDRACOLoader(dracoLoader);

注意!!!! 這里面的("/public/draco/") draco后面必須要有這個/ 沒有的話會報錯。

?2.加載模型

將我們的模型加載,但是這時候我們運行發現,仍然是一片漆黑,所以我們需要加入我們的光源。

//加載模型
gltfLoader.load("/public/model/scene.glb", (gltf) => {const model = gltf.scene;model.traverse((child) => {if (child.name == "Plane") {child.visible = false;}if (child.isMesh) {child.castShadow = true;child.receiveShadow = true;}});scene.add(model);
});

5.添加光源

//初始化光源
const light = new THREE.DirectionalLight(0xffffff, 1);
light.position.set(0, 50, 0);
scene.add(light);

添加光源以后,一個基本的效果就出現了。

我們的效果圖里面,房間里是有燈光的,所以我們在房間里放入一個點光源,位置已經提前測好了,并且,房子的門口部分應該是要有陰影的,所以我們加入陰影。

//允許陰影
renderer.shadowMap.enabled = true;
// 設置物理的光照效果
renderer.physicallyCorrectLights = true;// 添加點光源
const pointLight = new THREE.PointLight(0xffffff, 100);
pointLight.position.set(0.1, 2.4, 0);
pointLight.castShadow = true;
scene.add(pointLight);

?

6.添加天空水面

1.創建水面

水面我們直接使用的threejs提供的水面效果,然后給他的position專門設置了一下,出現了這樣的效果。

//創建水面
const waterGeometry = new THREE.CircleGeometry(300, 32);
const water = new Water(waterGeometry, {textureWidth: 1024,textureHeight: 1024,color: 0xeeeeff,flowDirection: new THREE.Vector2(1, 1),scale: 100,
});
water.rotation.x = -Math.PI / 2;
water.position.y = -0.4;
scene.add(water);

2.添加天空紋理

//加載環境紋理(天空、水面)
let rgbeLoader = new RGBELoader();
rgbeLoader.load("/public/textures/sky.hdr", (textures) => {//由于天空是一個全景圖,所以給他加一個球體的映射 讓他包裹住整個場景textures.mapping = THREE.EquirectangularReflectionMapping;scene.background = textures;scene.environment = textures;
});

?天空的感覺已經出現了,但是會發現這個天空給我們的感覺有點不一樣,我們需要調節一下色調。

3.調節色調映射?

// 設置色調映射
renderer.toneMapping = THREE.ACESFilmicToneMapping;
// 設置色調映射輸出
renderer.outputEncoding = THREE.sRGBEncoding;
// 設置色調映射曝光
renderer.toneMappingExposure = 0.75;

現在感覺就還好一些

7.小樹燈光

在我們的效果圖中,三棵小樹旁邊是有燈光在跳動的,所以我們開始做小樹燈的效果。

1.創建點光源組,循環做創建

我們使用for循環 循環構建小球,并且各自設置他們的位置,實現小球的效果。

const pointLightGroup = new THREE.Group();
pointLightGroup.position.set(-8, 2.5, -1.5);
let radius = 3;
let pointLightArr = [];for (let i = 0; i < 3; i++) {// 創建球體 當燈泡const sphereGeometry = new THREE.SphereGeometry(0.2, 32, 32);const sphereMaterial = new THREE.MeshStandardMaterial({color: 0xffffff,emissive: 0xffffff,emissiveIntensity: 1,});const sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);pointLightArr.push(sphere);sphere.position.set(radius * Math.cos((i * 2 * Math.PI) / 3),Math.cos((i * 2 * Math.PI) / 3),radius * Math.sin((i * 2 * Math.PI) / 3));let pointLight = new THREE.PointLight(0xffffff, 1);sphere.add(pointLight);pointLightGroup.add(sphere);
}scene.add(pointLightGroup);

2.點光源組旋轉效果實現

效果圖中的點光源組是有旋轉的效果的,我們可以使用補間函數,結合數學公式進行點光源小球旋轉的實現。

// 使用補間函數 從0到2π 旋轉
let options = {angle: 0,
};
gsap.to(options, {//角度angle: Math.PI * 2,//周期duration: 10,repeat: -1,//線性ease: "linear",onUpdate: () => {pointLightGroup.rotation.y = options.angle;pointLightArr.forEach((item, index) => {item.position.set(radius * Math.cos((index * 2 * Math.PI) / 3),Math.cos((index * 2 * Math.PI) / 3 + options.angle * 5),radius * Math.sin((index * 2 * Math.PI) / 3));});},
});

8.滑輪滾動切換場景

在效果圖中,我們滾動滑輪的時候,場景就會隨之切換,相機的視角不是固定的,如何做到呢?

1.定義補間動畫移動相機函數

我們需要定義一個函數,用來移動相機的位置,方便我們真聽到滾輪事件的時候觸發。我們使用補間動畫來完成。

// 使用補間動畫移動相機
let timeLine1 = new gsap.timeline();
let timeLine2 = new gsap.timeline();// 定義相機移動函數
function translateCamera(position, target) {// 通過補間函數移動相機timeLine1.to(camera.position, {x: position.x,y: position.y,z: position.z,duration: 1,ease: "power2.inout",});// 聚焦到哪一點timeLine2.to(controls.target, {x: target.x,y: target.y,z: target.z,duration: 1,ease: "power2.inout",});
}

2.制作場景文字和相機位置

我們使用一個scenes數組來制作我們的幾個不同的視角場景和文字。

// 鼠標滑輪切換效果
let scenes = [{text: "圣誕快樂",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(-3.23, 3, 4.06),new THREE.Vector3(-8, 2, 0));},},{text: "感謝在這么大的世界里遇到了你",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(7, 0, 23), new THREE.Vector3(0, 0, 0));},},{text: "愿與你探尋世界的每一個角落",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(10, 3, 0), new THREE.Vector3(5, 2, 0));},},{text: "愿將天上的星星送給你",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(7, 0, 23), new THREE.Vector3(0, 0, 0));//makeHeart();},},{text: "加油~",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(-20, 1.3, 6.6),new THREE.Vector3(5, 2, 0));},},
];

3.鼠標滾輪事件

我們需要一個index 來做場景的記錄,方便我們知道我們移動到了哪個場景,為了后面的判斷。并且我們還需要一個防抖函數,來控制切換場景。不能一直切換。做一個短暫的開關,來保證我們的視覺感受。

// 用來做場景的記錄
const index = ref(0);// 防抖函數
let isAnimte = false;// 偵聽鼠標滾輪事件
window.addEventListener("wheel",(e) => {if (isAnimte) return;isAnimte = true;// 判斷滾輪的方向if (e.deltaY > 0) {index.value++;if (index.value > scenes.length - 1) {index.value = 0;// restoreHeart();}}scenes[index.value].callback();setTimeout(() => {isAnimte = false;}, 1000);},false
);

9.祝福文字顯示

使用css樣式進行文字的顯示,用定位的方式將他固定在左邊,使用transform進行高度的移動,來看到想看的內容。

<template><divclass="scenes"style="position: fixed;left: 0;top: 0;z-index: 10;pointer-events: none;transition: all 1s;":style="{ transform: `translate3d(0,${-index * 100}vh,0)` }"><div v-for="item in scenes" style="width: 100vw; height: 100vh"><h1 style="padding: 100px 50px; font-size: 50px; color: #fff">{{ item.text }}</h1></div></div>
</template>

10.滿天星星

我們來做最后一個效果,滿天星星,并且在文字切換到星星送給你的時候,匯聚成一個心形

1.創建星星群體

// 實例化創建漫天星星
let starsInstance = new THREE.InstancedMesh(new THREE.SphereGeometry(0.1, 32, 32),new THREE.MeshStandardMaterial({color: 0xffffff,emissive: 0xffffff,emissiveIntensity: 10,}),100
);

2.隨機分布到天空中

// 隨機分布到天空
let startArr = [];
let endArr = [];
for (let i = 0; i < 100; i++) {let x = Math.random() * 100 - 50;let y = Math.random() * 100 - 50;let z = Math.random() * 100 - 50;startArr.push(new THREE.Vector3(x, y, z));// endArr.push(new THREE.Vector3(x, y, z));let matrix = new THREE.Matrix4();matrix.setPosition(x, y, z);// i第幾個 matrix矩陣starsInstance.setMatrixAt(i, matrix);
}
scene.add(starsInstance);

3.使用貝塞爾曲線構建一個心形

?至于這個代碼為什么最后變成的是心形,涉及到canvas的內容,即將跟著@老陳打碼學習。

// 創建愛心路徑 貝塞爾曲線創建
let heartShape = new THREE.Shape();
heartShape.moveTo(25, 25);
heartShape.bezierCurveTo(25, 25, 20, 0, 0, 0);
heartShape.bezierCurveTo(-30, 0, -30, 35, -30, 35);
heartShape.bezierCurveTo(-30, 55, -10, 77, 25, 95);
heartShape.bezierCurveTo(60, 77, 80, 55, 80, 35);
heartShape.bezierCurveTo(80, 35, 80, 0, 50, 0);
heartShape.bezierCurveTo(35, 0, 25, 25, 25, 25);

?4.設置點的坐標

for (let i = 0; i < 100; i++) {// threejs的方法let point = heartShape.getPoint(i / 100);endArr.push(new THREE.Vector3(point.x, point.y, point.z));
}

5.構建星星函數

// 創建愛心動畫
function makeHeart() {// 創建一個愛心let params = {time: 0,};gsap.to(params, {time: 1,duration: 1,onUpdate: () => {let time = params.time;for (let i = 0; i < 100; i++) {let x = startArr[i].x + (endArr[i].x - startArr[i].x) * time;let y = startArr[i].y + (endArr[i].y - startArr[i].y) * time;let z = startArr[i].z + (endArr[i].z - startArr[i].z) * time;let matrix = new THREE.Matrix4();matrix.setPosition(x, y, z);starsInstance.setMatrixAt(i, matrix);}starsInstance.instanceMatrix.needsUpdate = true;},});
}

?我們會發現效果上面,圖形很大,所以我們對其進行縮小處理

// 根據愛心路徑獲取點
// 設置中心
let center = new THREE.Vector3(0, 2, 10);
for (let i = 0; i < 100; i++) {let point = heartShape.getPoint(i / 100);endArr.push(new THREE.Vector3(point.x * 0.1 + center.x,point.y * 0.1 + center.y,center.z));
}

?6.重置心形函數

我們也需要在過去這個場景之后,將這個原型還原為之前的樣子。

function restoreHeart() {let params = {time: 0,};gsap.to(params, {time: 1,duration: 1,onUpdate: () => {let time = params.time;for (let i = 0; i < 100; i++) {let x = endArr[i].x + (startArr[i].x - endArr[i].x) * time;let y = endArr[i].y + (startArr[i].y - endArr[i].y) * time;let z = endArr[i].z + (startArr[i].z - endArr[i].z) * time;let matrix = new THREE.Matrix4();matrix.setPosition(x, y, z);starsInstance.setMatrixAt(i, matrix);}starsInstance.instanceMatrix.needsUpdate = true;},});
}

我們要在偵聽函數中,當index == 0 的時候 調用這個

// 偵聽鼠標滾輪事件
window.addEventListener("wheel",(e) => {if (isAnimte) return;isAnimte = true;// 判斷滾輪的方向if (e.deltaY > 0) {index.value++;if (index.value > scenes.length - 1) {index.value = 0;restoreHeart();}}scenes[index.value].callback();setTimeout(() => {isAnimte = false;}, 1000);},false
);

我們的作品基本上就完成了。

全部代碼

App.vue

<template><divclass="scenes"style="position: fixed;left: 0;top: 0;z-index: 10;pointer-events: none;transition: all 1s;":style="{ transform: `translate3d(0,${-index * 100}vh,0)` }"><div v-for="item in scenes" style="width: 100vw; height: 100vh"><h1 style="padding: 100px 50px; font-size: 50px; color: #fff">{{ item.text }}</h1></div> </div>
</template><script setup>
import { ref } from "vue";
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
import { Water } from "three/examples/jsm/objects/Water2";
import gsap from "gsap/gsap-core";//初始化場景
const scene = new THREE.Scene();
//初始化相機
const camera = new THREE.PerspectiveCamera(75,window.innerWidth / window.innerHeight,0.1,1000
);
camera.position.set(-3.23, 2.98, 4.06);
camera.updateProjectionMatrix();
//初始化渲染器
const renderer = new THREE.WebGLRenderer({//設置抗鋸齒antialias: true,
});
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);// 設置色調映射
renderer.toneMapping = THREE.ACESFilmicToneMapping;
// 設置色調映射輸出
renderer.outputEncoding = THREE.sRGBEncoding;
// 設置色調映射曝光
renderer.toneMappingExposure = 0.75;
//允許陰影
renderer.shadowMap.enabled = true;
// 設置物理的光照效果
renderer.physicallyCorrectLights = true;//初始化控制器
const controls = new OrbitControls(camera, renderer.domElement);
controls.target.set(-8, 2, 0);
//
controls.enableDamping = true;//初始化解壓模型
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath("/public/draco/");
const gltfLoader = new GLTFLoader();
gltfLoader.setDRACOLoader(dracoLoader);//加載環境紋理(天空、水面)
let rgbeLoader = new RGBELoader();
rgbeLoader.load("/public/textures/sky.hdr", (textures) => {//由于天空是一個全景圖,所以給他加一個球體的映射 讓他包裹住整個場景textures.mapping = THREE.EquirectangularReflectionMapping;scene.background = textures;scene.environment = textures;
});//加載模型
gltfLoader.load("/public/model/scene.glb", (gltf) => {const model = gltf.scene;model.traverse((child) => {if (child.name == "Plane") {child.visible = false;}if (child.isMesh) {child.castShadow = true;child.receiveShadow = true;}});scene.add(model);
});//創建水面
const waterGeometry = new THREE.CircleGeometry(300, 32);
const water = new Water(waterGeometry, {textureWidth: 1024,textureHeight: 1024,color: 0xeeeeff,flowDirection: new THREE.Vector2(1, 1),scale: 100,
});
water.rotation.x = -Math.PI / 2;
water.position.y = -0.4;
scene.add(water);//初始化光源
const light = new THREE.DirectionalLight(0xffffff, 1);
light.position.set(0, 50, 0);
scene.add(light);// 添加點光源
const pointLight = new THREE.PointLight(0xffffff, 100);
pointLight.position.set(0.1, 2.4, 0);
pointLight.castShadow = true;
scene.add(pointLight);// 創建點光源組
const pointLightGroup = new THREE.Group();
pointLightGroup.position.set(-8, 2.5, -1.5);
let radius = 3;
let pointLightArr = [];for (let i = 0; i < 3; i++) {// 創建球體 當燈泡const sphereGeometry = new THREE.SphereGeometry(0.2, 32, 32);const sphereMaterial = new THREE.MeshStandardMaterial({color: 0xffffff,emissive: 0xffffff,emissiveIntensity: 1,});const sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);pointLightArr.push(sphere);sphere.position.set(radius * Math.cos((i * 2 * Math.PI) / 3),Math.cos((i * 2 * Math.PI) / 3),radius * Math.sin((i * 2 * Math.PI) / 3));let pointLight = new THREE.PointLight(0xffffff, 1);sphere.add(pointLight);pointLightGroup.add(sphere);
}
// 使用補間函數 從0到2π 旋轉
let options = {angle: 0,
};
gsap.to(options, {//角度angle: Math.PI * 2,//周期duration: 10,repeat: -1,//線性ease: "linear",onUpdate: () => {pointLightGroup.rotation.y = options.angle;pointLightArr.forEach((item, index) => {item.position.set(radius * Math.cos((index * 2 * Math.PI) / 3),Math.cos((index * 2 * Math.PI) / 3 + options.angle * 5),radius * Math.sin((index * 2 * Math.PI) / 3));});},
});scene.add(pointLightGroup);
// 渲染函數
function render() {requestAnimationFrame(render);renderer.render(scene, camera);controls.update();
}render();// 使用補間動畫移動相機
let timeLine1 = new gsap.timeline();
let timeLine2 = new gsap.timeline();// 定義相機移動函數
function translateCamera(position, target) {// 通過補間函數移動相機timeLine1.to(camera.position, {x: position.x,y: position.y,z: position.z,duration: 1,ease: "power2.inout",});// 聚焦到哪一點timeLine2.to(controls.target, {x: target.x,y: target.y,z: target.z,duration: 1,ease: "power2.inout",});
}// 鼠標滑輪切換效果
let scenes = [{text: "圣誕快樂",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(-3.23, 3, 4.06),new THREE.Vector3(-8, 2, 0));},},{text: "感謝在這么大的世界里遇到了你",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(7, 0, 23), new THREE.Vector3(0, 0, 0));},},{text: "愿與你探尋世界的每一個角落",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(10, 3, 0), new THREE.Vector3(5, 2, 0));},},{text: "愿將天上的星星送給你",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(7, 0, 23), new THREE.Vector3(0, 0, 0));makeHeart();},},{text: "加油~",callback: () => {// 執行函數切換位置translateCamera(new THREE.Vector3(-20, 1.3, 6.6),new THREE.Vector3(5, 2, 0));},},
];// 用來做場景的記錄
const index = ref(0);// 防抖函數
let isAnimte = false;// 偵聽鼠標滾輪事件
window.addEventListener("wheel",(e) => {if (isAnimte) return;isAnimte = true;// 判斷滾輪的方向if (e.deltaY > 0) {index.value++;if (index.value > scenes.length - 1) {index.value = 0;restoreHeart();}}scenes[index.value].callback();setTimeout(() => {isAnimte = false;}, 1000);},false
);// 實例化創建漫天星星
let starsInstance = new THREE.InstancedMesh(new THREE.SphereGeometry(0.1, 32, 32),new THREE.MeshStandardMaterial({color: 0xffffff,emissive: 0xffffff,emissiveIntensity: 10,}),100
);// 隨機分布到天空
let startArr = [];
let endArr = [];
for (let i = 0; i < 100; i++) {let x = Math.random() * 100 - 50;let y = Math.random() * 100 - 50;let z = Math.random() * 100 - 50;startArr.push(new THREE.Vector3(x, y, z));// endArr.push(new THREE.Vector3(x, y, z));let matrix = new THREE.Matrix4();matrix.setPosition(x, y, z);// i第幾個 matrix矩陣starsInstance.setMatrixAt(i, matrix);
}
scene.add(starsInstance);// 創建愛心路徑 貝塞爾曲線創建
let heartShape = new THREE.Shape();
heartShape.moveTo(25, 25);
heartShape.bezierCurveTo(25, 25, 20, 0, 0, 0);
heartShape.bezierCurveTo(-30, 0, -30, 35, -30, 35);
heartShape.bezierCurveTo(-30, 55, -10, 77, 25, 95);
heartShape.bezierCurveTo(60, 77, 80, 55, 80, 35);
heartShape.bezierCurveTo(80, 35, 80, 0, 50, 0);
heartShape.bezierCurveTo(35, 0, 25, 25, 25, 25);// 根據愛心路徑獲取點
// 設置中心
let center = new THREE.Vector3(0, 2, 10);
for (let i = 0; i < 100; i++) {let point = heartShape.getPoint(i / 100);endArr.push(new THREE.Vector3(point.x * 0.1 + center.x,point.y * 0.1 + center.y,center.z));
}for (let i = 0; i < 100; i++) {// threejs的方法let point = heartShape.getPoint(i / 100);endArr.push(new THREE.Vector3(point.x, point.y, point.z));
}// 創建愛心動畫
function makeHeart() {// 創建一個愛心let params = {time: 0,};gsap.to(params, {time: 1,duration: 1,onUpdate: () => {let time = params.time;for (let i = 0; i < 100; i++) {let x = startArr[i].x + (endArr[i].x - startArr[i].x) * time;let y = startArr[i].y + (endArr[i].y - startArr[i].y) * time;let z = startArr[i].z + (endArr[i].z - startArr[i].z) * time;let matrix = new THREE.Matrix4();matrix.setPosition(x, y, z);starsInstance.setMatrixAt(i, matrix);}starsInstance.instanceMatrix.needsUpdate = true;},});
}function restoreHeart() {let params = {time: 0,};gsap.to(params, {time: 1,duration: 1,onUpdate: () => {let time = params.time;for (let i = 0; i < 100; i++) {let x = endArr[i].x + (startArr[i].x - endArr[i].x) * time;let y = endArr[i].y + (startArr[i].y - endArr[i].y) * time;let z = endArr[i].z + (startArr[i].z - endArr[i].z) * time;let matrix = new THREE.Matrix4();matrix.setPosition(x, y, z);starsInstance.setMatrixAt(i, matrix);}starsInstance.instanceMatrix.needsUpdate = true;},});
}
</script><style>
* {margin: 0;padding: 0;
}
canvas {width: 100vw;height: 100vh;position: fixed;left: 0;top: 0;
}
</style>

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/167072.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/167072.shtml
英文地址,請注明出處:http://en.pswp.cn/news/167072.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【騰訊云云上實驗室】探索保護數據之盾背后的安全監控機制

當今數字化時代&#xff0c;數據安全成為了企業和個人最為關注的重要議題之一。隨著數據規模的不斷增長和數據應用的廣泛普及&#xff0c;如何保護數據的安全性和隱私性成為了迫切的需求。 今天&#xff0c;我將帶領大家一起探索騰訊云云上實驗室所推出的向量數據庫&#xff0c…

新版PY系列離線燒錄器,支持PY002A/002B/003/030/071等MCU各封裝,不同 FLASH 大小型號

PY系列離線燒錄器&#xff0c;目前支持PY32F002A/002B/002/003/030/071/072/040/403/303 各封裝、不同 FLASH 大小型號。PY離線燒錄器需要搭配上位機軟件使用&#xff0c;上位機軟件可以在芯嶺技術官網上下載&#xff0c;還包括了離線燒錄器的使用說明。PY離線燒錄器使用MINI U…

金融機構如何高效率考勤?這個技巧幫了大忙!

在現代社會&#xff0c;隨著科技的不斷發展&#xff0c;人臉識別技術作為一種高效、便捷的身份驗證手段&#xff0c;逐漸應用于各個領域&#xff0c;其中之一便是人臉考勤系統。 傳統的考勤方式存在一系列問題&#xff0c;如卡片打卡容易被冒用、簽到表容易造假等&#xff0c;而…

CTFUB-web前置技能-HTTP協議

burp抓包,抓第二次的 修改請求方式為CTFHUB

算法筆記:OPTICS 聚類

1 基本介紹 OPTICS(Ordering points to identify the clustering structure)是一基于密度的聚類算法 OPTICS算法是DBSCAN的改進版本 在DBCSAN算法中需要輸入兩個參數&#xff1a; ? 和 MinPts &#xff0c;選擇不同的參數會導致最終聚類的結果千差萬別&#xff0c;因此DBCSAN…

線上PDF文件展示

場景&#xff1a; 請求到的PDF&#xff08;url鏈接&#xff09;&#xff0c;將其展示在頁面上 插件&#xff1a; pdfobject &#xff08;我使用的版本&#xff1a; "pdfobject": "^2.2.12" &#xff09; 下載插件就不多說了&#xff0c;下面將其引入&a…

【Clang Static Analyzer 代碼靜態檢測工具詳細使用教程】

Clang Static Analyzer sudo apt-get install clang-tools scan-build cmake .. scan-build make -j4 編譯完成之后會在終端提示在哪里查看報錯文檔: scan-build: 55 bugs found. scan-build: Run scan-view /tmp/scan-build-2023-11-24-150637-6472-1 to examine bug report…

Liunx Ubuntu Server 安裝配置 Docker

1. 安裝Docker 1.1 更新軟件包列表 sudo apt update1.2 添加Docker存儲庫 sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-a…

Django QuerySet.order_by SQL注入漏洞(CVE-2021-35042)

漏洞描述 Django 于 2021年7月1日發布了一個安全更新&#xff0c;修復了函數QuerySet.order_by中的 SQL 注入漏洞。 參考鏈接&#xff1a; Django security releases issued: 3.2.5 and 3.1.13 | Weblog | Django 該漏洞需要開發人員使用order_by功能。此外&#xff0c;還可…

加入華為云鯤鵬極簡開發創造營,激活創造力,探索無限可能!

數字經濟時代&#xff0c;速度、效率、質量安全已成為各行業告訴拓新發展的關鍵&#xff0c;華為云不斷打磨敏捷安全開發的軟件平臺&#xff0c;為更高效率的生產力變革積蓄能量。 在剛剛過去不久的2023華為全聯接大會上&#xff0c;華為最新發布了華為云CodeArts與鯤鵬DevKit…

關于配置文件中秘鑰信息加密實現方案的一些思考

關于配置文件中秘鑰信息加密實現方案的一些思考 背景實現方案 背景 配置信息文件中(代碼中), 不應該有明文的秘鑰信息. 需要找一種方案去做加密處理. 實現方案 我們可以在項目指定目錄上傳一份加密/解密程序, 例如: jasypt-gui.jar. 啟動時: 配置JVM參數, 對加密的信息進行解…

2023 Unite 大會關于“Muse“ AI 大模型訓練

Unity Muse 借助強大的 AI 能力幫助你探索、構思和迭代&#xff0c;其中包括紋理和精靈兩項功能&#xff0c;可將自然語言和視覺輸入轉化為可用資產。 將 AI 引入 Unity Editor 中的 Muse 提供了更快將想法轉化為實物的選項。您可以調整并使用文本提示、圖案、顏色和草圖&…

周總結2023-11-24

文章目錄 前言&#xff1a;工作&#xff1a;學習&#xff1a;生活&#xff1a; 前言&#xff1a; 保持激情&#xff0c;日日向上&#xff0c;激發內驅力。 工作&#xff1a; 1117上周未完成的計劃&#xff1a; 數模轉換模塊的數據處理分析HAL庫的學習IMU知識點匯總 1124本…

【采坑分享】導出文件流responseType:“blob“如何提示報錯信息

目錄 前言&#xff1a; 采坑之路 總結&#xff1a; 前言&#xff1a; 近日&#xff0c;項目中踩了一個坑分享一下經驗&#xff0c;也避免下次遇到方便解決。項目基于vue2axioselement-ui&#xff0c;業務中導出按鈕需要直接下載接口中的文件流。正常是沒有問題&#xff0c;但…

為什么在Pycharm中使用Pandas畫圖,卻不顯示?

問題描述&#xff1a; 在 Pycharm 中使用 Pandas 的 plot() 方法畫圖&#xff0c;卻不顯示圖像&#xff0c;源代碼如下&#xff1a; import pandas as pd import numpy as np# 從文件中讀取數據 starbucks pd.read_csv(./file_csv/directory.csv)# 按照國家分組&#xff0c;…

想問問各位大佬,網絡安全這個專業普通人學習會有前景嗎?

網絡安全是一個非常廣泛的領域&#xff0c;涉及到許多不同的崗位。這些崗位包括安全服務、安全運維、滲透測試、web安全、安全開發和安全售前等。每個崗位都有自己的要求和特點&#xff0c;您可以根據自己的興趣和能力來選擇最適合您的崗位。 滲透測試/Web安全工程師主要負責模…

對 .NET程序2G虛擬地址緊張崩潰 的最后一次反思

一&#xff1a;背景 1. 講故事 最近接連遇到了幾起 2G 虛擬地址緊張 導致的程序崩潰&#xff0c;基本上 90% 都集中在醫療行業&#xff0c;真的很無語&#xff0c;他們用的都是一些上古的 XP&#xff0c;Windows7 x86&#xff0c;我也知道技術人很難也基本無法推動硬件系統和…

抖音獲客策略:讓你的品牌在短視頻平臺一鳴驚人!

一、背景介紹 隨著移動互聯網的快速發展&#xff0c;抖音作為一款流行的短視頻平臺&#xff0c;已經成為越來越多企業的獲客渠道。抖音用戶規模龐大&#xff0c;日活用戶數量不斷增長&#xff0c;為企業提供了廣闊的市場空間。本文將介紹抖音獲客策略&#xff0c;幫助企業更好…

UNETR++:深入研究高效和準確的3D醫學圖像分割

論文&#xff1a;https://arxiv.org/abs/2212.04497 代碼&#xff1a;GitHub - Amshaker/unetr_plus_plus: UNETR: Delving into Efficient and Accurate 3D Medical Image Segmentation 機構&#xff1a;Mohamed Bin Zayed University of Artificial Intelligence1, Univers…

哦?是嗎|兜兜轉轉,最后還是選擇了蓋雅排班系統

在之前發布的和「人效案例集」中&#xff0c;我們為大家呈現了很多關于人效提升的理論方法&#xff0c;以及各家企業的人效提升提升實踐。 回過頭來&#xff0c;我們發現&#xff1a;排班管理滲透于人效九宮格之中&#xff0c;也因此成為很多企業人效提升的一個重要中介&#x…