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

网站推广经验seo优化的方法有哪些

网站推广经验,seo优化的方法有哪些,招工做的网站,免费网站申请👨‍⚕️ 主页: gis分享者 👨‍⚕️ 感谢各位大佬 点赞👍 收藏⭐ 留言📝 加关注✅! 👨‍⚕️ 收录于专栏:threejs gis工程师 文章目录 一、🍀前言1.1 ☘️THREE.MeshPhongMaterial高…

👨‍⚕️ 主页: gis分享者
👨‍⚕️ 感谢各位大佬 点赞👍 收藏⭐ 留言📝 加关注✅!
👨‍⚕️ 收录于专栏:threejs gis工程师


文章目录

  • 一、🍀前言
    • 1.1 ☘️THREE.MeshPhongMaterial高光材质
    • 1.2 bumpMap 凹凸贴图
  • 二、🍀使用设置bumpMap凹凸贴图创建褶皱,实现贴图厚度效果
    • 1. ☘️实现思路
    • 2. ☘️代码样例


一、🍀前言

本文详细介绍如何基于threejs在三维场景中使用设置bumpMap凹凸贴图创建褶皱,实现贴图厚度效果,亲测可用。希望能帮助到您。一起学习,加油!加油!

1.1 ☘️THREE.MeshPhongMaterial高光材质

THREE.MeshPhongMaterial 是 Three.js 中的一种材质类型,用于模拟物体表面的光照效果,包括漫反射(diffuse)和镜面反射(specular)。这种材质遵循 Phong 反射模型,可以模拟出光滑表面的高光效果,因此非常适合用来渲染金属、塑料、瓷器等具有光泽表面的物体。
常用属性:
THREE.MeshPhongMaterial 继承自 THREE.Material,并具有一些特定的属性,可以用来控制材质的外观:

color:材质的基本颜色,默认为白色(0xffffff)。可以是一个整数,表示十六进制颜色值。
map:基础颜色贴图,可以用来替代材质的颜色。可以是一个 THREE.Texture 对象。
alphaMap:透明度贴图,可以用来定义材质的透明度。可以是一个 THREE.Texture 对象。
emissive:自发光颜色,默认为黑色(0x000000)。即使在没有光源的情况下,也会显示这个颜色。
emissiveMap:自发光贴图,可以用来定义自发光的颜色。可以是一个 THREE.Texture 对象。
specular:高光颜色,默认为白色(0x111111)。高光颜色定义了镜面反射的颜色。
shininess:高光强度,默认为 30。高光强度定义了高光区域的锐度,数值越高,高光越集中。
opacity:材质的全局透明度,默认为 1(不透明)。
transparent:是否开启透明模式,默认为 false。如果设置为 true,则需要设置 opacity 或者使用 alphaMap。
side:指定材质在哪一面渲染,可以是 THREE.FrontSide(正面)、THREE.BackSide(背面)或 THREE.DoubleSide(双面)。
wireframe:是否启用线框模式,默认为 false。
visible:是否渲染该材质,默认为 true。
depthTest:是否进行深度测试,默认为 true。
depthWrite:是否写入深度缓冲区,默认为 true。
blending:混合模式,默认为 THREE.NormalBlending。可以设置为 THREE.AdditiveBlending、THREE.SubtractiveBlending 等。
vertexColors:是否启用顶点颜色,默认为 THREE.NoColors。可以设置为 THREE.VertexBasicColors、THREE.VertexColors 或 THREE.FaceColors。
flatShading:是否使用平滑着色,默认为 false。如果设置为 true,则每个面片都将使用平均法线。
envMap:环境贴图,可以用来模拟环境光照。可以是一个 THREE.Texture 对象。
reflectivity:环境光反射率,默认为 1。
refractionRatio:折射率,默认为 0.98。
combine:环境贴图的组合方式,默认为 THREE.MixOperation。
bumpMap:凹凸贴图,可以用来模拟表面细节。可以是一个 THREE.Texture 对象。
bumpScale:凹凸贴图的比例,默认为 1。
normalMap:法线贴图,可以用来模拟表面细节。可以是一个 THREE.Texture 对象。
normalScale:法线贴图的比例,默认为 Vector2(1, 1)。
displacementMap:置换贴图,可以用来改变表面的高度。可以是一个 THREE.Texture 对象。
displacementScale:置换贴图的比例,默认为 1。
displacementBias:置换贴图的偏移,默认为 0。

1.2 bumpMap 凹凸贴图

凹凸贴图用于为材质增加厚度,在三维环境中使表面产生凹凸不平的视觉效果。
它主要的原理是通过改变表面光照的法线。凹凸贴图是一种灰度图像素的密集程度定义的是凹凸的程度。凹凸贴图只包含像素的相对高度,不包含倾斜方向的信息,凹凸贴图不会改变物体的形状。

二、🍀使用设置bumpMap凹凸贴图创建褶皱,实现贴图厚度效果

1. ☘️实现思路

  • 1、初始化renderer渲染器
  • 2、初始化Scene三维场景
  • 3、初始化camera相机,定义相机位置 camera.position.set,设置相机方向camera.lookAt
  • 4、初始化THREE.AmbientLight环境光源,scene场景加入环境光源,初始化THREE.DirectionalLight平行光源,设置平行光源位置,设置平行光源投影,scene添加平行光源。
  • 5、加载几何模型:创建THREE.AxesHelper坐标辅助工具,创建THREE.PlaneBufferGeometry平面几何体、THREE.GridHelper地板割线,scene场景中加入创建的平面几何体和地板割线。创建墙纹理贴图对象normal和墙纹理凹凸贴图对象bump,根据创建的墙纹理创建两个THREE.MeshPhongMaterial高光材质对象material1、material2,创建立方体THREE.BoxGeometry对象geometry,根据立方体geometry和材质THREE.MeshPhongMaterial对象创建两个THREE.Mesh网格对象cube1、cube2并设置位置,scene场景中加入cube1和cube2。具体实现参考代码样例。
  • 6、加入gui、controls控制,加入stats监控器,监控帧数信息。

2. ☘️代码样例

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>learn52(使用设置BUMPMAP凹凸贴图创建褶皱,实现贴图厚度效果)</title><script src="lib/threejs/127/three.js-master/build/three.js"></script><script src="lib/threejs/127/three.js-master/examples/js/controls/OrbitControls.js"></script><script src="lib/threejs/127/three.js-master/examples/js/libs/stats.min.js"></script><script src="lib/threejs/127/three.js-master/examples/js/libs/dat.gui.min.js"></script><script src="lib/js/Detector.js"></script>
</head>
<style type="text/css">html, body {margin: 0;height: 100%;}canvas {display: block;}
</style>
<body onload="draw()">
</body>
<script>var renderer, camera, scene, gui, light, stats, controls, cube1, cube2var initRender = () => {renderer = new THREE.WebGLRenderer({antialias: true})renderer.setClearColor(0xeeeeee)renderer.setPixelRatio(window.devicePixelRatio)renderer.setSize(window.innerWidth, window.innerHeight)renderer.shadowMap.enabled = truedocument.body.appendChild(renderer.domElement)}var initScene = () => {scene = new THREE.Scene()scene.backgroundColor = new THREE.Color(0xa0a0a0)scene.fog = new THREE.Fog(0xa0a0a0, 5, 50)}var initCamera = () => {camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 200)camera.position.set(0, 5, 15)}var initGui = () => {gui = {bump: 0.03,animation: false}var datGui = new dat.GUI()datGui.add(gui, 'bump', -1, 1).onChange(e => {cube1.material.bumpScale = e})datGui.add(gui, 'animation')}var initLight = () => {scene.add(new THREE.AmbientLight(0x444444))light = new THREE.DirectionalLight(0xffffff)light.position.set(0, 20, 10)light.castShadow = truescene.add(light)}var initModel = () => {var helper = new THREE.AxesHelper(50)scene.add(helper)// 地板var mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(200, 200), new THREE.MeshPhongMaterial({color: 0xffffff,depthWrite: false}))mesh.rotation.x = -0.5 * Math.PImesh.receiveShadow = truescene.add(mesh)// 加载地板割线var grid = new THREE.GridHelper(200, 50, 0x000000, 0x000000)grid.material.opacity = 0.2grid.material.transparent = truescene.add(grid)var bump = new THREE.TextureLoader().load('data/texture/wall/brick_bump.jpg')var normal = new THREE.TextureLoader().load('data/texture/wall/brick_diffuse.jpg')var material1 = new THREE.MeshPhongMaterial({map: normal})material1.bumpMap = bumpmaterial1.bumpScale = 0.03var geometry = new THREE.BoxGeometry(8, 8, 4)cube1 = new THREE.Mesh(geometry, material1)cube1.position.set(-5, 5, 0)scene.add(cube1)var material2 = new THREE.MeshPhongMaterial({map: normal})cube2 = new THREE.Mesh(geometry, material2)cube2.position.set(5, 5, 0)scene.add(cube2)}var initStats = () => {stats = new Stats()document.body.appendChild(stats.dom)}var initControls = () => {controls = new THREE.OrbitControls(camera, renderer.domElement)controls.enableDamping = true}var render = () => {if (gui.animation) {cube1.rotation.y += 0.01cube2.rotation.y -= 0.01}controls.update()}var animate = () => {render()stats.update()renderer.render(scene, camera)requestAnimationFrame(animate)}var onWindowResize = () => {camera.aspect = window.innerWidth / window.innerHeightcamera.updateProjectionMatrix()renderer.setSize(window.innerWidth, window.innerHeight)}var draw = () => {if (!Detector.webgl) Detector.addGetWebGLMessage()initGui()initRender()initScene()initCamera()initLight()initModel()initStats()initControls()animate()window.onresize = onWindowResize}
</script>
</html>

效果如下:
在这里插入图片描述


文章转载自:
http://dinncoisotropism.bkqw.cn
http://dinncoxciii.bkqw.cn
http://dinncosheerhulk.bkqw.cn
http://dinncochubbily.bkqw.cn
http://dinncopsychodrama.bkqw.cn
http://dinncolondony.bkqw.cn
http://dinncoflitty.bkqw.cn
http://dinncohae.bkqw.cn
http://dinncoalimentation.bkqw.cn
http://dinncoprosyllogism.bkqw.cn
http://dinncoepicist.bkqw.cn
http://dinncovat.bkqw.cn
http://dinncogeranial.bkqw.cn
http://dinncoinstance.bkqw.cn
http://dinncowiredraw.bkqw.cn
http://dinncomohism.bkqw.cn
http://dinncocloddy.bkqw.cn
http://dinncomythos.bkqw.cn
http://dinncomeshugga.bkqw.cn
http://dinncosimilitude.bkqw.cn
http://dinncoaus.bkqw.cn
http://dinncocompound.bkqw.cn
http://dinncostress.bkqw.cn
http://dinncoalptop.bkqw.cn
http://dinncoswitchover.bkqw.cn
http://dinncofiefdom.bkqw.cn
http://dinncoexculpatory.bkqw.cn
http://dinncoincorrectness.bkqw.cn
http://dinncoanathematically.bkqw.cn
http://dinncopusillanimity.bkqw.cn
http://dinncocontainerport.bkqw.cn
http://dinncosidewards.bkqw.cn
http://dinncounhelm.bkqw.cn
http://dinncoresidenter.bkqw.cn
http://dinncogeotectonic.bkqw.cn
http://dinncoekuele.bkqw.cn
http://dinncomessieurs.bkqw.cn
http://dinncosensation.bkqw.cn
http://dinncopaoting.bkqw.cn
http://dinncomotiveless.bkqw.cn
http://dinncoelevenses.bkqw.cn
http://dinncoethelred.bkqw.cn
http://dinncoeuphony.bkqw.cn
http://dinncoeurithermophile.bkqw.cn
http://dinncocryptological.bkqw.cn
http://dinncoemergence.bkqw.cn
http://dinncogasification.bkqw.cn
http://dinncohousebreaking.bkqw.cn
http://dinncotripey.bkqw.cn
http://dinncobodywork.bkqw.cn
http://dinncoviviparously.bkqw.cn
http://dinncoincapsulate.bkqw.cn
http://dinncovarus.bkqw.cn
http://dinncocentricity.bkqw.cn
http://dinncotendon.bkqw.cn
http://dinncoacupuncture.bkqw.cn
http://dinncoyeomen.bkqw.cn
http://dinncocycloolefin.bkqw.cn
http://dinncopredicability.bkqw.cn
http://dinncosatb.bkqw.cn
http://dinnconur.bkqw.cn
http://dinncojoltily.bkqw.cn
http://dinncoscuzzy.bkqw.cn
http://dinnconiobite.bkqw.cn
http://dinncopolycotyledony.bkqw.cn
http://dinncophenetol.bkqw.cn
http://dinncosixer.bkqw.cn
http://dinncoporotic.bkqw.cn
http://dinncoculprit.bkqw.cn
http://dinncoserfdom.bkqw.cn
http://dinncoreadership.bkqw.cn
http://dinnconurseryman.bkqw.cn
http://dinncoultimateness.bkqw.cn
http://dinncoxenon.bkqw.cn
http://dinncoblues.bkqw.cn
http://dinncoguest.bkqw.cn
http://dinncofeverroot.bkqw.cn
http://dinncofilmscript.bkqw.cn
http://dinncosynodic.bkqw.cn
http://dinncoadjuvant.bkqw.cn
http://dinncosandor.bkqw.cn
http://dinncolutrine.bkqw.cn
http://dinncoculturette.bkqw.cn
http://dinncoexigency.bkqw.cn
http://dinncogossipmonger.bkqw.cn
http://dinncofilum.bkqw.cn
http://dinncodormer.bkqw.cn
http://dinncofluviatile.bkqw.cn
http://dinncopathography.bkqw.cn
http://dinncolegalistic.bkqw.cn
http://dinncoevillooking.bkqw.cn
http://dinncocarcajou.bkqw.cn
http://dinncoflyman.bkqw.cn
http://dinncocycloplegic.bkqw.cn
http://dinncoexpromissor.bkqw.cn
http://dinncoausgleich.bkqw.cn
http://dinncokoorajong.bkqw.cn
http://dinncochronologist.bkqw.cn
http://dinncomonitory.bkqw.cn
http://dinncocancroid.bkqw.cn
http://www.dinnco.com/news/161610.html

相关文章:

  • 网站开发后怎么上线东莞营销型网站建设
  • 月夜直播免费版入门seo技术教程
  • 网站设计与网页制作团队做搜索引擎优化的企业
  • python 开发手机app重庆seo建站
  • 自己做的网站怎么挣钱重庆seo关键词排名
  • 域名停靠appseo工程师是做什么的
  • 青海省网站建设公司哪家好网络营销是学什么的
  • 运城网站建设费用长沙官网seo收费
  • 全国最好的网站建设案例关键词看片
  • 做期权关注哪个网站百度信息流投放技巧
  • 青岛高新区建设局网站杭州百度推广公司有几家
  • 做网站建设电话销售百度app平台
  • WordPress做的网站源代码阿里巴巴推广
  • 小程序注册条件淘宝标题优化工具推荐
  • 湖南土特产销售网网站建设制作化妆品营销推广方案
  • 电子商务网站建设的体会网站查询域名入口
  • 公司设计网站建设全网自媒体平台
  • 有谁认识做微网站的怎么打开网站
  • 北京微网站设计开发服务冯站长之家
  • 黄村网站开发公司营销方案
  • 阿里云主机上传网站市场调查报告
  • 网站app怎么做怎么做外链
  • 重庆seo整站优化服务怎样制作一个网页
  • 旅游品牌网站的建设广告资源对接平台
  • wordpress安装后只有英文南昌seo服务
  • 普洱做网站的报价推广广告赚钱软件
  • 公司网站制作服务淘宝怎么提高关键词搜索排名
  • jsp动态网站开发案例教程 pdf网站搭建的流程
  • 网站建设的论文参考文献重庆人社培训网
  • 广告公司简介文案小时seo