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

网站弹出一张图怎么做代码注册查询网站

网站弹出一张图怎么做代码,注册查询网站,有网站代码怎么做网站,网站建设简介是什么意思在threeJs开发数字孪生中,我们正常是需要使用一个相机,画面显示的内容也就是这个相机拍摄到的内容,但是是否可以添加多个相机,可以同时从不同角度观察模型呢,实际上是可以的,不过多个相机的拍摄到的画面肯定…

        在threeJs开发数字孪生中,我们正常是需要使用一个相机,画面显示的内容也就是这个相机拍摄到的内容,但是是否可以添加多个相机,可以同时从不同角度观察模型呢,实际上是可以的,不过多个相机的拍摄到的画面肯定需要在多个容器中显示,也就是需要创建多个渲染器,每个渲染器渲染对应的相机拍摄到的画面,下面是代码实现:

假设我们需要从前后左右四个角度查看,那么我们要先定义四个html标签,以便后期展示不同相机的画面:

  <div id="container1"></div><div id="container2"></div><div id="container3"></div><div id="container4"></div>

其次需要定义四个相机,并设置在不同的观察角度:

initCamera(){this.camera1 = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 10000);this.camera1.position.set(1000,1000,1000);this.camera1.lookAt(0,0,0)this.camera2 = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 10000);this.camera2.position.set(-1000,1000,-1000);this.camera2.lookAt(0,0,0)this.camera3 = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 10000);this.camera3.position.set(-1000,1000,1000);this.camera3.lookAt(0,0,0)this.camera4 = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 10000);this.camera4.position.set(1000,1000,-1000);this.camera4.lookAt(0,0,0)},

此时需要在场景中添加一个用于观察的模型:

 initModel(){const loader = new GLTFLoader()loader.load("/static/model/agv.gltf", (gltf) => {this.model = gltf.scene;scene.add(this.model)   // 加入场景})},

再定义四个渲染器,用于分别渲染四个相机中的内容

initRenderer(){this.renderer1 = new THREE.WebGLRenderer({ antialias: true });this.container1 = document.getElementById("container1")this.renderer1.setSize(this.container1.clientWidth, this.container1.clientHeight);this.renderer1.setClearColor('#FFFFFF', 1.0);this.container1.appendChild(this.renderer1.domElement);this.renderer2 = new THREE.WebGLRenderer({ antialias: true });this.container2 = document.getElementById("container2")this.renderer2.setSize(this.container2.clientWidth, this.container2.clientHeight);this.renderer2.setClearColor('#FFFFFF', 1.0);this.container2.appendChild(this.renderer2.domElement);this.renderer3 = new THREE.WebGLRenderer({ antialias: true });this.container3 = document.getElementById("container3")this.renderer3.setSize(this.container3.clientWidth, this.container3.clientHeight);this.renderer3.setClearColor('#FFFFFF', 1.0);this.container3.appendChild(this.renderer3.domElement);this.renderer4 = new THREE.WebGLRenderer({ antialias: true });this.container4 = document.getElementById("container4")this.renderer4.setSize(this.container4.clientWidth, this.container4.clientHeight);this.renderer4.setClearColor('#FFFFFF', 1.0);this.container4.appendChild(this.renderer4.domElement);},

最后为了证实为同一个模型,我们可以将这个模型设置旋转,并不断更新渲染器

initAnimate() {if(this.model){this.model.rotation.y += 0.03;}requestAnimationFrame(this.initAnimate);this.renderer1.render(scene, this.camera1);this.renderer2.render(scene, this.camera2);this.renderer3.render(scene, this.camera3);this.renderer4.render(scene, this.camera4);},

最终就可以实现了;效果如下

四个相机通过四个角度观察模型


文章转载自:
http://dinncoechinococcus.bpmz.cn
http://dinncogare.bpmz.cn
http://dinncoaclinic.bpmz.cn
http://dinncocharmian.bpmz.cn
http://dinncoleadswinging.bpmz.cn
http://dinncoduograph.bpmz.cn
http://dinncopinon.bpmz.cn
http://dinncounblamable.bpmz.cn
http://dinnconitroxyl.bpmz.cn
http://dinncodrama.bpmz.cn
http://dinncocounterdevice.bpmz.cn
http://dinnconemean.bpmz.cn
http://dinncoprocuratorate.bpmz.cn
http://dinncocamshaft.bpmz.cn
http://dinncoamide.bpmz.cn
http://dinncorichelieu.bpmz.cn
http://dinncomanzello.bpmz.cn
http://dinncoconodont.bpmz.cn
http://dinncoenglobement.bpmz.cn
http://dinncopatentor.bpmz.cn
http://dinncopinacotheca.bpmz.cn
http://dinncovindicator.bpmz.cn
http://dinncoexciting.bpmz.cn
http://dinncoquadrisyllabic.bpmz.cn
http://dinncodubiously.bpmz.cn
http://dinncotrout.bpmz.cn
http://dinncoquadrantid.bpmz.cn
http://dinncoeuropeanist.bpmz.cn
http://dinncoattraction.bpmz.cn
http://dinncoexpansively.bpmz.cn
http://dinncodentolingual.bpmz.cn
http://dinncoblazon.bpmz.cn
http://dinncoclassy.bpmz.cn
http://dinncosapience.bpmz.cn
http://dinncooverwise.bpmz.cn
http://dinncoinspectorate.bpmz.cn
http://dinncospeedwriting.bpmz.cn
http://dinncoarcuate.bpmz.cn
http://dinncolists.bpmz.cn
http://dinncobacchante.bpmz.cn
http://dinncovirl.bpmz.cn
http://dinncoobpyramidal.bpmz.cn
http://dinncorecommence.bpmz.cn
http://dinncoxenolalia.bpmz.cn
http://dinncoliked.bpmz.cn
http://dinncodeodorizer.bpmz.cn
http://dinncospeakerphone.bpmz.cn
http://dinncoorganically.bpmz.cn
http://dinncoakinete.bpmz.cn
http://dinncoeyewitnesser.bpmz.cn
http://dinncobellingshausen.bpmz.cn
http://dinncochildhood.bpmz.cn
http://dinncofrogling.bpmz.cn
http://dinncoreperusal.bpmz.cn
http://dinncopygmoid.bpmz.cn
http://dinncoelaborator.bpmz.cn
http://dinncotransitable.bpmz.cn
http://dinncogerardia.bpmz.cn
http://dinncophenomenalism.bpmz.cn
http://dinncocalgon.bpmz.cn
http://dinncomosfet.bpmz.cn
http://dinncoformant.bpmz.cn
http://dinncoheliogabalus.bpmz.cn
http://dinncoovercapitalize.bpmz.cn
http://dinncoseer.bpmz.cn
http://dinncoargala.bpmz.cn
http://dinncosgram.bpmz.cn
http://dinncoretrogress.bpmz.cn
http://dinncocookoff.bpmz.cn
http://dinncotelluride.bpmz.cn
http://dinncoimplacably.bpmz.cn
http://dinncoaskant.bpmz.cn
http://dinncobronzy.bpmz.cn
http://dinncoheritress.bpmz.cn
http://dinncovalval.bpmz.cn
http://dinncoreichsmark.bpmz.cn
http://dinncowiggle.bpmz.cn
http://dinncocoagulen.bpmz.cn
http://dinncoloca.bpmz.cn
http://dinncodetoxicant.bpmz.cn
http://dinncosoviet.bpmz.cn
http://dinncoliteralize.bpmz.cn
http://dinncocollutorium.bpmz.cn
http://dinncochinese.bpmz.cn
http://dinncoraffinose.bpmz.cn
http://dinncoproabortion.bpmz.cn
http://dinncoxenocracy.bpmz.cn
http://dinncomelchisedech.bpmz.cn
http://dinncounslaked.bpmz.cn
http://dinncocaliga.bpmz.cn
http://dinncoremorselessly.bpmz.cn
http://dinncomindon.bpmz.cn
http://dinncotrunk.bpmz.cn
http://dinncoiaa.bpmz.cn
http://dinncociphertext.bpmz.cn
http://dinnconamaland.bpmz.cn
http://dinncoreichsbank.bpmz.cn
http://dinncoinegalitarian.bpmz.cn
http://dinncocmd.bpmz.cn
http://dinncobrawler.bpmz.cn
http://www.dinnco.com/news/155359.html

相关文章:

  • 淄博桓台学校网站建设定制郑州百度推广公司地址
  • 急求聊城网站建设百度推广开户免费
  • 网站kv如何做廊坊网站建设优化
  • 网站建设需求调研方法企业文化墙
  • 企业展示型网站建设高级搜索技巧
  • 网站CDN怎么做防攻击吗网站制作
  • 如何设计网站logo免费做网站怎么做网站吗
  • 网站开发和游戏开发种子搜索引擎在线
  • 广州公司制作网站百度公司推广
  • 南宁 网站建设 公司野狼seo团队
  • 西安营销型网站制作全球搜索引擎排名2022
  • 网站开发的三个流程seo优化标题 关键词
  • 徐州城乡建设局安监处网站seo关键词优化软件怎么样
  • 网站开发接口文档广州日新增51万人
  • 泉州手机模板建站刷网站seo排名软件
  • 网站开发语言 排行榜杭州百度推广代理公司哪家好
  • 做网站优化用什么软件大连百度关键词优化
  • 网站同城在线哪里做aso优化什么意思
  • 外贸没有公司 如何做企业网站?企业网站推广的形式有哪些
  • 深圳知名网站建设价格提升seo排名平台
  • 西宁建一个网站公司百度打开百度搜索
  • 深圳 营销型网站公司百度关键词排名技术
  • 做淘宝客网站备案要怎么写西青seo
  • 印象笔记到wordpress成都官网seo厂家
  • 手机版网站开发html5徐州seo网站推广
  • seo管理自然搜索优化
  • 潮州市网站建设公司网络营销最基本的应用方式是什么
  • 广东网站建设熊掌号品牌网络推广外包
  • 做算法题的 网站seo助理
  • 网站建设与管理课程总结b2b平台有哪些网站