摘要: vue中加载pdf文件 方案一: 直接调用事件即可 openPdf { window.open('/assets/BJBVerse.pdf') }, 方案二: npm install vue-pdf --save <template> <div> <pdf v-for="i in numPages" 阅读全文
posted @ 2023-07-13 17:43 web与webGL 阅读(799) 评论(0) 推荐(0) 编辑
摘要: threejs webgl性能优化 WEBGL性能优化的方法有很多,以下是一些常见的方法: 减少渲染次数:在WEBGL中,渲染次数越少,性能越好。因此,您可以通过减少渲染次数来提高性能。例如,使用批处理技术将多个对象合并为一个批处理对象进行渲染。 WebGL 中的渲染次数越少,性能越好。这是因为在渲 阅读全文
posted @ 2023-05-16 16:30 web与webGL 阅读(832) 评论(0) 推荐(0) 编辑
摘要: js深拷贝 js深拷贝 在JavaScript中,有多种方法可以实现对象的深拷贝,下面介绍几种常用的方式: 手动遍历对象进行复制 function deepCopy(obj) { if (typeof obj !== 'object' || obj null) { return obj; } let newOb 阅读全文
posted @ 2023-05-16 16:26 web与webGL 阅读(152) 评论(0) 推荐(0) 编辑
摘要: threejs相机动画 import * as dat from "dat.gui"; import { GUI } from "../../utils/lil-gui.module.min.js"; import TWEEN from "@tweenjs/tween.js"; const gui 阅读全文
posted @ 2023-05-05 12:06 web与webGL 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 前端加入摄像机人脸识别(mediapipe) import { Camera} from "@mediapipe/camera_utils"; import {FaceMesh} from "@mediapipe/face_mesh"; // <script src="https://cdn.jsd 阅读全文
posted @ 2023-04-07 10:58 web与webGL 阅读(539) 评论(0) 推荐(0) 编辑
摘要: canvas实现图片镜像翻转的2种方式 原文引用:https://www.qetool.com/scripts/view/23387.html 1. 通过canvas自带的画布方法进行翻转 var img = new Image(); //这个就是 img标签的dom对象 img.src = './ 阅读全文
posted @ 2023-04-07 10:37 web与webGL 阅读(575) 评论(0) 推荐(0) 编辑
摘要: https://www.stubbornhuang.com/2363/ 阅读全文
posted @ 2023-03-27 18:47 web与webGL 阅读(52) 评论(0) 推荐(0) 编辑
摘要: threejs坐标转换 世界坐标转局部坐标 //head为需要改变的bone的父节点 let head=this.scene.getObjectByName('head'); const v3 = new THREE.Vector3(); head.getWorldPosition(v3); let 阅读全文
posted @ 2023-03-27 17:59 web与webGL 阅读(282) 评论(0) 推荐(0) 编辑
摘要: threejs加载带材质的fbx格式模型 loadFBX() { let manager = new LoadingManager(); manager.addHandler(/\.tga$/i, new TGALoader()); const fbxLoader = new FBXLoader(m 阅读全文
posted @ 2023-03-24 18:34 web与webGL 阅读(956) 评论(0) 推荐(0) 编辑
摘要: three初始化加载模,居中且大小固定 方案一: 动态居中模型位置,缩放到一定大小 modelCenter(object) { let scale = this.modelSize(object); object.scale.set(scale, scale, scale); let box = n 阅读全文
posted @ 2023-03-24 11:16 web与webGL 阅读(245) 评论(0) 推荐(0) 编辑
摘要: three.js加载环境贴图 HDR的全称是High Dynamic Range,即高动态范围;动态范围是指图像中所包含的从“最亮”至“最暗”的比值,也就是图像从“最亮”到“最暗”之间灰度划分的等级数;动态范围越大,所能表示的层次越丰富,所包含的色彩空间也越广。那高动态范围(HDR)顾名思义就是从“ 阅读全文
posted @ 2023-03-22 14:03 web与webGL 阅读(645) 评论(0) 推荐(0) 编辑
摘要: threejs点击事件(不同大小的画布) 一、直接是window宽高的画布,点击交互的方案 onClick(event) { event.preventDefault(); this.mouse.x = (event.clientX / window.innerWidth) * 2 - 1; thi 阅读全文
posted @ 2023-03-22 14:01 web与webGL 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 箭头函数与普通函数的区别 一.外形不同:箭头函数使用箭头定义,普通函数中没有代码实例如下: // 普通函数 function func(){ // code } // 箭头函数 let func=()=>{ // code } 二.箭头函数都是匿名函数普通函数可以有匿名函数,也可以有具体名函数,但是 阅读全文
posted @ 2023-03-22 13:57 web与webGL 阅读(29) 评论(0) 推荐(0) 编辑
摘要: typescript学习总结 qq学习讨论群:910316886 https://blog.csdn.net/m0_61044901/article/details/125274523 <!-- 安装: npm i -g typescript tsc -v (查看typescript版本) c盘用户 阅读全文
posted @ 2022-12-03 01:47 web与webGL 阅读(53) 评论(0) 推荐(0) 编辑
摘要: canvas绘制圆角矩形 Canvas并没有提供绘制圆角矩形的方法,但是通过观察,我们可以发现,其实我们可以将圆角矩形分为四段,可以通过使用arcTo来实现 我们假设起点为x,y.绘制的矩形宽高为w,h.圆角的半径为r;所以将起点设置在(x+r,y)处,然后acrTo(x+w,y,x+w,y+h,r 阅读全文
posted @ 2022-11-22 11:43 web与webGL 阅读(602) 评论(0) 推荐(0) 编辑