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

郑州加盟做网站安徽建工网

郑州加盟做网站,安徽建工网,php网站模板源码,上海建设摩托车官网报价由于ply文件是第三方提供的#xff0c;threejs无法用绝路路径的方式显示ply 所以想通过webapi把ply通过url地址的方式给threejs 1.webapi部分 /// summary/// 获取PLY文件/// /summary/// returns/returns[HttpPost(Name GetPlythreejs无法用绝路路径的方式显示ply 所以想通过webapi把ply通过url地址的方式给threejs  1.webapi部分 /// summary/// 获取PLY文件/// /summary/// returns/returns[HttpPost(Name GetPly)]public async TaskIActionResult GetPly(GlueFileModel gfm){ string fileExt Path.GetExtension(gfm.PlyFile); //绝对路径的ply文件 例如D:\test\test.ply//获取文件的ContentTypevar provider new FileExtensionContentTypeProvider();//var memi provider.Mappings[fileExt];var memi application/octet-stream;var fileBytes System.IO.File.ReadAllBytes(gpm.PlyFile);string fileName Path.GetFileName(gpm.PlyFile);return File(fileBytes, memi, fileName);} 2.Vue部分取得ply文件 let pa { No: , PlyFile: D:/test/test.ply }//let pa { No: , PlyFile: GluePlyResultFile.value }let plyUrl await axios.post(global_const.WEBAPI Python/GetPly, pa, { responseType: blob }).then(function (response) {console.log(response);plyUrl window.URL.createObjectURL(new Blob([response.data]));return plyUrl//response.data;}).catch(function (error) {//ElMessage.error(cmd 命令执行异常 error)console.log(error);}); 3.threejs中load ply方法  //let s ../src/assets/ply/Result.plylet s plyUrl;loader.load(s,function (geometry) {console.log(loader.load );console.log(geometry);geometry.computeVertexNormals();const pos geometry.attributes.position;const count 10;// pos.count;const colorsArr [];for (let i 0; i count; i) {const percent i / count; //点索引值相对所有点数量的百分比//根据顶点位置顺序大小设置颜色渐变// 红色分量从0到1变化蓝色分量从1到0变化colorsArr.push(percent, 0, 1 - percent); //蓝色到红色渐变色}//类型数组创建顶点颜色color数据//const colors new Float32Array(colorsArr);// 设置几何体attributes属性的颜色color属性//geometry.attributes.color new THREE.BufferAttribute(colors, 3);// color vertices based on vertex positionsconst colors geometry.getAttribute(position).array.slice();console.log(colors,colors)for (let i 0, l colors.length; i l; i) {if (colors[i] 0) colors[i] 0.5;else colors[i] 0;}geometry.setAttribute(color, new THREE.BufferAttribute(colors, 3, false));const material2 new THREE.PointsMaterial({ size: 0.01, vertexColors: true });//THREE.VertexColors//const material.vertexColors true;let mesh2 new THREE.Points(geometry, material2);mesh2.position.x 1;//0;mesh2.position.y 2;//-1;mesh2.position.z 3;//0;mesh2.scale.multiplyScalar(0.4);mesh2.castShadow true;mesh2.receiveShadow true;scene.add(mesh2);scene.background new THREE.Color(0x52645b);console.log(loader.load OK);},function (xhr) {//console.log((xhr.loaded / xhr.total) * 100 % loaded);},function (err) {console.error(err);});
http://www.w-s-a.com/news/207823/

相关文章:

  • 网站免费正能量软件下载wordpress 多本小说
  • 临淄网站制作价格低长沙谷歌seo收费
  • 吴江公司网站建设电话免费的那种软件
  • 大淘客网站如何做seo网络广告设计公司
  • 厦门网络营销顾问湘潭网站seo
  • asp.net个人网站淮南 搭建一个企业展示网站
  • 备案关闭网站wordpress 替换
  • 台州建设网站制作wordpress乱码
  • 互联网时代 网站建设做交互设计的网站
  • 网站屏蔽中文浏览器湘潭做网站广告的公司
  • 好看的单页面网站模板免费下载手机网站经典案例
  • 优秀网站建设平台建筑模板工厂价格尺寸
  • 合肥微信网站建设旅游景区网站模板
  • 一个只做百合的网站wordpress文章和博客的区别
  • 编写网站策划方案网站哪里有
  • 网站做得好的公司国家防疫政策最新调整
  • 设计优秀的企业网站做行测的网站
  • 提供做网站公司有哪些关键词优化诊断
  • 建站合肥网络公司seo免费建手机商城网站吗
  • 设计师投资做项目网站外贸网站建设工作室
  • 无聊的网站wordpress的alt属性插件
  • 个股期权系统网站开发小清新wordpress模板
  • 全中文网站开发建筑公司企业愿景文案
  • 广州网站建设正规公司建设银行信用卡中心网站
  • 哪个网站是专门做封面素材怎么制作app平台
  • 网站开发 平均工资商标注册在哪个部门申请
  • 做外贸需要自己的网站吗营销型网站建设市场分析
  • 绍兴网站制作推广wordpress 无法自动升级
  • 阿里云建站数据库用什么app制作开发费用多少
  • 中国住房和城乡建设部网站资质查询中小开网站