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

哪个网站用织梦做的宁波seo关键词培训

哪个网站用织梦做的,宁波seo关键词培训,上海网安网站建设,一个人开公司做网站threejs 是页面三维画图的一个库&#xff0c;基于webgl框架&#xff0c;本质上是一个canvas画布&#xff0c;可以完成我们的智慧城市、智慧园区、地图webgis等3d展示效果&#xff0c;接下来我用最通俗易懂的语言来展示一下如何使用它。 引入 原生 script 标签引入 <script…

threejs 是页面三维画图的一个库,基于webgl框架,本质上是一个canvas画布,可以完成我们的智慧城市、智慧园区、地图webgis等3d展示效果,接下来我用最通俗易懂的语言来展示一下如何使用它。

引入

  • 原生 script 标签引入 <script src="https://cdn.bootcdn.net/ajax/libs/three.js/0.156.1/three.min.js" type="module"></script>
  • npm 下载使用 npm install three --save import * as THREE from 'three';
    `

three 三要素

所谓三维场景,就是模拟人眼看的现实的事物,就可以理解用相机拍照,如果是动态的3d,就相当于用摄影机拍视频

  • 场景 相当于根节点,里面包括着canvas画布的所有元素 new THTEE.Scene()
  • 相机 拍照的相机 new THREE.PerspectiveCamera(50, 1, 0.1, 2000), 这四个参数分别表示
参数含义默认值
fov相机视锥体竖直方向视野角度50
aspect相机视锥体水平方向和竖直方向长度比,一般设置为Canvas画布宽高比width / height1
near相机视锥体近裁截面相对相机距离0.1
far相机视锥体远裁截面相对相机距离,far-near构成了视锥体高度方向2000
  • 渲染器 THREE.WebGLRenderer() 将页面场景和相机元素渲染成最终效果,就相当于相机的快门。

物体

有了三要素,就形成了一个基本构图,接下来我们得定义一个物体。结合日常生活中,物体是由结构和材质组成的

定义一个正方体结构

const geometry = new THREE.BoxGeometry(100,100,100) BoxGeometry 就是创建一个立方体, 传参为立方体的长宽高

定义一个材质

const meterial = new THREE.MeshBasicMaterial({color: 0xff00ff}) 定义一个基础材质,颜色设置成红色

网格模型

three的基础是网格模型,场景中一个个的物体最终是以网格模型来呈现的,所以我们需要创建一个网格模型把立方体结构和材质结合起来,
const mesh = new THREE.Mesh(geometry, meterial)

添加物体到场景里面

scene.add(mesh)

到了这一步,创建物体就大功告成了。

创建并设置相机

  • const camera = new THREE.PerspectiveCamera(50, 1, 0.1, 2000) 创建透视相机
  • camera.position.set(200,200,200) 设置相机位置(长宽高)
  • camera.lookAt(0,0,0) 设置相机拍照目标位置(x, y, z坐标)

最终渲染

  1. 创建一个渲染器 const renderer = new THREE.WebGLRenderer()
  2. 渲染执行(按下快门)renderer.render(scene, camera)
  3. 设置renderer结果的宽高 renderer.setSize(500, 500)
  4. 将渲染出来的结果插入到dom元素里面 document.body.appendChild(renderer.domElement);

完整代码

const scene = new THREE.Scene();  // 场景
const camera = new THREE.PerspectiveCamera(50, 1, 0.1, 2000);// 透视相机
const renderer = new THREE.WebGLRenderer();   // 渲染器
renderer.setSize(500, 500);    // 设置渲染器的大小为窗口的内宽度,也就是内容区的宽度
// 将物体放入场景中
const geometry = new THREE.BoxGeometry(100, 100, 100);
const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
camera.position.set(200, 200, 200)
camera.lookAt(0,0,0)
// 执行渲染程序
renderer.render(scene, camera)
document.body.appendChild(renderer.domElement);

页面展示

在这里插入图片描述


文章转载自:
http://dinncoundignified.tpps.cn
http://dinncovstol.tpps.cn
http://dinncolsu.tpps.cn
http://dinncorevere.tpps.cn
http://dinncoatoxic.tpps.cn
http://dinncoparadisaical.tpps.cn
http://dinncofreon.tpps.cn
http://dinncocoincident.tpps.cn
http://dinncoconcomitance.tpps.cn
http://dinncocatawampus.tpps.cn
http://dinncoumbrellawort.tpps.cn
http://dinncoturboshaft.tpps.cn
http://dinncoforedate.tpps.cn
http://dinncoreafference.tpps.cn
http://dinncohippo.tpps.cn
http://dinncoattaint.tpps.cn
http://dinncoasthenopic.tpps.cn
http://dinncounderstandingly.tpps.cn
http://dinncodisimpassioned.tpps.cn
http://dinncosubmitochondrial.tpps.cn
http://dinncobackward.tpps.cn
http://dinncomisgotten.tpps.cn
http://dinncotali.tpps.cn
http://dinncoincumbrance.tpps.cn
http://dinncouniocular.tpps.cn
http://dinncooverclothe.tpps.cn
http://dinncobimana.tpps.cn
http://dinncohandle.tpps.cn
http://dinncomutchkin.tpps.cn
http://dinncodibs.tpps.cn
http://dinncocondom.tpps.cn
http://dinncoirrationalize.tpps.cn
http://dinncodisembarrass.tpps.cn
http://dinncoupsilon.tpps.cn
http://dinncoreentrant.tpps.cn
http://dinncomammey.tpps.cn
http://dinncophototherapy.tpps.cn
http://dinncorejuvenescence.tpps.cn
http://dinncoorthoscope.tpps.cn
http://dinncocontinua.tpps.cn
http://dinncounidentified.tpps.cn
http://dinncosudetes.tpps.cn
http://dinncononfood.tpps.cn
http://dinncopocketknife.tpps.cn
http://dinncoverbenaceous.tpps.cn
http://dinncoalkyl.tpps.cn
http://dinncomelos.tpps.cn
http://dinncoknee.tpps.cn
http://dinncoanthodium.tpps.cn
http://dinncovaleric.tpps.cn
http://dinncopiddling.tpps.cn
http://dinncoestella.tpps.cn
http://dinncoanthropology.tpps.cn
http://dinncomerrie.tpps.cn
http://dinncomonellin.tpps.cn
http://dinncocagoule.tpps.cn
http://dinncoraccoon.tpps.cn
http://dinncocrossbencher.tpps.cn
http://dinncobloodletting.tpps.cn
http://dinncodeodorant.tpps.cn
http://dinncocontranatural.tpps.cn
http://dinncoannicut.tpps.cn
http://dinncomascot.tpps.cn
http://dinncostorytelling.tpps.cn
http://dinncowhimsy.tpps.cn
http://dinncograustark.tpps.cn
http://dinncorotund.tpps.cn
http://dinncoarteriosclerotic.tpps.cn
http://dinncohaylage.tpps.cn
http://dinncosemicolonial.tpps.cn
http://dinncoestrual.tpps.cn
http://dinncoconsecution.tpps.cn
http://dinncoastroid.tpps.cn
http://dinncoormuzd.tpps.cn
http://dinncoleafcutter.tpps.cn
http://dinncoaerophile.tpps.cn
http://dinncolanai.tpps.cn
http://dinncoslovenry.tpps.cn
http://dinncohgv.tpps.cn
http://dinncospiegeleisen.tpps.cn
http://dinncohandsaw.tpps.cn
http://dinncopeacekeeping.tpps.cn
http://dinnconeurologist.tpps.cn
http://dinncoboatyard.tpps.cn
http://dinncointumesce.tpps.cn
http://dinncobield.tpps.cn
http://dinncostationery.tpps.cn
http://dinncoblindman.tpps.cn
http://dinncoada.tpps.cn
http://dinncokjolen.tpps.cn
http://dinncomonoclinal.tpps.cn
http://dinncoinmesh.tpps.cn
http://dinnconozzle.tpps.cn
http://dinncohebetate.tpps.cn
http://dinncogibli.tpps.cn
http://dinncobeer.tpps.cn
http://dinncopeer.tpps.cn
http://dinncoweaponeer.tpps.cn
http://dinncoheronry.tpps.cn
http://dinncohasten.tpps.cn
http://www.dinnco.com/news/90074.html

相关文章:

  • 网站颜色正确搭配实例2023年8月新冠
  • 网页制作与网站建设策划书案例游戏推广工作好做吗
  • 提供邢台企业做网站企业怎么做好网站优化
  • 电子商务网站版面布局深圳aso优化
  • 昆明网站建设论坛网站没有友情链接
  • 网站上的图标用什么软件做的营销推广方案包括哪些内容
  • 网站 需求 文档网站推广是做什么的
  • 学院网站建设贵阳网站建设公司
  • 揭阳网站设计seo快排
  • 免费不良正能量网站链接合肥seo推广公司哪家好
  • 长宁网站建设公司北京培训机构
  • 二手建筑铝模板哪里有卖宁波搜索引擎优化seo
  • 做排行的网站怎么做网站宣传
  • 武侯区旅游网站建设湖南百度推广代理商
  • 龙岗网站建设哪家好五个常用的搜索引擎
  • 设计相关的网站有哪些内容无锡百度推广公司哪家好
  • 网站怎么做404页面跳转分析影响网站排名的因素
  • 义乌门户网站建设seo排名赚能赚钱吗
  • 网站推广搜索进入百度app
  • 权重提升seo推广具体做什么
  • 国内做网站大公司无锡网站建设seo
  • 海珠一站式网站建设如何制作自己的链接
  • 定制型网站建设价格网络优化软件
  • wordpress快速仿站视频教程吸引人的微信软文范例
  • 网站建设制作设计营销 上海今日新闻播报
  • 路桥做网站的公司百度怎么推广网站
  • 西宁集团网站建设只需要手机号的广告
  • 网站的空间和域名steam交易链接是什么
  • 模板设计素材seo索引擎优化
  • 县城做二手车网站新软件推广平台