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

软件设计开发流程图廊坊关键词seo排名方案

软件设计开发流程图,廊坊关键词seo排名方案,毕设做购物网站,邯郸市建设局网站three.js实现电子围栏效果#xff08;纹理贴图#xff09; 实现步骤 围栏的坐标坐标转换为几何体顶点#xff0c;uv顶点坐标加载贴图#xff0c;移动 图例 代码 templatediv classappdiv refcanvesRef classcanvas-…three.js实现电子围栏效果纹理贴图 实现步骤 围栏的坐标坐标转换为几何体顶点uv顶点坐标加载贴图移动 图例 代码 templatediv classappdiv refcanvesRef classcanvas-wrap/div/div /templatescript setup import { ref, onMounted } from vue; import * as THREE from three; import { OrbitControls } from three/addons/controls/OrbitControls.js;const canvesRef ref(null); const canvasWidth window.innerWidth; const canvasHeight window.innerHeight; let scene; let camera; let renderer; let axesHelper; let cameraControls;init(); render(); function init() {// 场景scene new THREE.Scene();// 模型addModel();// 相机camera new THREE.PerspectiveCamera(75,canvasWidth / canvasHeight,0.1,3000);camera.position.set(300, 300, 300);// camera.lookAt(0, 0, 0);// 坐标辅助对象axesHelper new THREE.AxesHelper(200);scene.add(axesHelper);// 渲染器//antialias - 是否执行抗锯齿。默认为false.renderer new THREE.WebGLRenderer();renderer.setSize(canvasWidth, canvasHeight);// 相机轨道控制器cameraControls new OrbitControls(camera, renderer.domElement); } function addModel() {// 坐标const points [[0, 0, 0],[0, 0, 200],[200, 0, 200],[200, 0, 0],[0, 0, 0],];const height 30; // 高度const color1 #ff00ff; // 颜色// 围栏距离 累加const pointDistance [];// 围栏总长度const distance points.reduce((totalDistance, point, index) {let segmentDistance 0;if (index 0) {let lastPoint new THREE.Vector3(...points[index - 1]);let currPoint new THREE.Vector3(...point);segmentDistance lastPoint.distanceTo(currPoint);}totalDistance segmentDistance;pointDistance.push(totalDistance);return totalDistance;}, 0);// console.log(distance, pointDistance);// 几何体const geometry new THREE.BufferGeometry(); // 缓冲几何体const posArr [];const uvArr [];// 遍历坐标// posArr 几何体顶点points.forEach((point, index) {if (index 0) return;const lastPoint points[index - 1];// 三角面1posArr.push(...lastPoint);uvArr.push(pointDistance[index - 1] / distance, 0);posArr.push(...point);uvArr.push(pointDistance[index] / distance, 0);posArr.push(lastPoint[0], lastPoint[1] height, lastPoint[2]);uvArr.push(pointDistance[index - 1] / distance, 1);// 三角面2posArr.push(...point);uvArr.push(pointDistance[index] / distance, 0);posArr.push(point[0], point[1] height, point[2]);uvArr.push(pointDistance[index] / distance, 1);posArr.push(lastPoint[0], lastPoint[1] height, lastPoint[2]);uvArr.push(pointDistance[index - 1] / distance, 1);});console.log(posArr, uvArr);geometry.setAttribute(position,new THREE.BufferAttribute(new Float32Array(posArr), 3));geometry.setAttribute(uv,new THREE.BufferAttribute(new Float32Array(uvArr), 2));// 纹理const texture new THREE.TextureLoader().load(../src/assets/img/icon.png);texture.wrapS THREE.RepeatWrapping;texture.wrapT THREE.RepeatWrapping;// 材质const material new THREE.MeshBasicMaterial({// color: color1,map: texture,transparent: true,opacity: 1,depthWrite: false,side: THREE.DoubleSide,});// 创建围栏const mesh new THREE.Mesh(geometry, material);scene.add(mesh);texture.repeat.set(10, 1); // 平铺textrue_offset(texture, top, 5); } function textrue_offset(texture, direction right, speed 0.5) {// 开始时间const start Date.now();const h () {requestAnimationFrame(h);const now Date.now();const offset ((now - start) / 1000) * speed;switch (direction) {case left:texture.offset new THREE.Vector2(offset, 0); //纹理偏移break;case right:texture.offset new THREE.Vector2(-offset, 0);break;case top:texture.offset new THREE.Vector2(0, -offset);break;case left:texture.offset new THREE.Vector2(0, offset);break;}};h(); } function render() {renderer.render(scene, camera);requestAnimationFrame(render); } onMounted(() {canvesRef.value.appendChild(renderer.domElement); }); /scriptstyle langscss scoped .app {position: relative; } /style
http://www.w-s-a.com/news/164703/

相关文章:

  • 南山住房和建设局网站网站被k 多久恢复
  • 阿里买域名 电脑做网站做简历哪个网站好
  • 个人网站免费服务器单页网站的域名
  • 网站设计简单讲解小店怎么做网站
  • 校园网站的意义wordpress去除更新
  • 网站开发用python吗常用的网页开发工具有哪些
  • 北京市住房建设投资建设网站做商城网站要哪些流程
  • seo网站改版杭州建设局官网
  • 物流网站建设策划书泰然建设网站
  • 百度做网站的费用采集发布wordpress
  • 网站运维公司有哪些防录屏网站怎么做
  • 昆明做网站seo的网站制作专业
  • 聊城制作手机网站公司wordpress 头条
  • 商城微网站模板一般电商网站做集群
  • winserver2008上用iis发布网站嵊州网站制作
  • 网站内页权重怎么查辽宁建设工程信息网怎么上传业绩
  • 丰都网站建设价格镇江网站制作费用
  • app手机网站建设黄网站建设定制开发服务
  • 百度网盘app下载徐州优化网站建设
  • 附近网站电脑培训班展台设计方案介绍
  • 河南便宜网站建设价格低上海高端室内设计
  • 保险网站有哪些平台wordpress会员vip购买扩展
  • 网站怎么做图片转换广州车陂网站建设公司
  • 下载flash网站网站设计书的结构
  • 水利建设公共服务平台网站放心网络营销定制
  • 设计网站过程wordpress+分页静态
  • 临海网站制作好了如何上线如果安装wordpress
  • 长沙 学校网站建设网站制作价格上海
  • 九江网站推广徽hyhyk1国家住房部和城乡建设部 网站首页
  • 阿克苏网站建设咨询动漫设计与制作属于什么大类