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

网站挂马解决山东seo优化

网站挂马解决,山东seo优化,住建委官网登录入口,建设银行网站驱动33. Three.js案例-创建带阴影的球体与平面 实现效果 知识点 WebGLRenderer (WebGL渲染器) WebGLRenderer 是 Three.js 中用于渲染 3D 场景的核心类。它负责将场景中的对象绘制到画布上。 构造器 new THREE.WebGLRenderer(parameters)参数类型描述parametersObject可选参数…

33. Three.js案例-创建带阴影的球体与平面

实现效果

效果

知识点

WebGLRenderer (WebGL渲染器)

WebGLRenderer 是 Three.js 中用于渲染 3D 场景的核心类。它负责将场景中的对象绘制到画布上。

构造器
new THREE.WebGLRenderer(parameters)
参数类型描述
parametersObject可选参数对象,用于配置渲染器的各种属性。

常用参数:

  • antialias:布尔值,是否开启抗锯齿,默认为 false
  • alpha:布尔值,是否允许透明背景,默认为 false
  • premultipliedAlpha:布尔值,是否使用预乘 alpha,默认为 true
  • preserveDrawingBuffer:布尔值,是否保留绘图缓冲区,默认为 false
  • depth:布尔值,是否创建深度缓冲区,默认为 true
  • stencil:布尔值,是否创建模板缓冲区,默认为 true
  • logarithmicDepthBuffer:布尔值,是否使用对数深度缓冲区,默认为 false
  • powerPreference:字符串,指定 GPU 的性能偏好,可选值为 defaulthigh-performancelow-power
方法
  • setPixelRatio(value):设置设备像素比。
  • setSize(width, height, updateStyle):设置渲染器的尺寸。
  • setClearColor(color, alpha):设置渲染器的背景颜色。
  • render(scene, camera):渲染场景。

Scene (场景)

Scene 是 Three.js 中用于存储和管理所有 3D 对象的容器。

构造器
new THREE.Scene()

PerspectiveCamera (透视相机)

PerspectiveCamera 是 Three.js 中用于创建透视投影的相机。

构造器
new THREE.PerspectiveCamera(fov, aspect, near, far)
参数类型描述
fovNumber视野角度,以度为单位。
aspectNumber相机的宽高比。
nearNumber近裁剪面距离,小于该距离的对象不会被渲染。
farNumber远裁剪面距离,大于该距离的对象不会被渲染。
方法
  • position.set(x, y, z):设置相机的位置。
  • lookAt(vector):使相机看向指定的点。

SpotLight (聚光灯)

SpotLight 是 Three.js 中用于创建聚光灯的光源。

构造器
new THREE.SpotLight(color, intensity, distance, angle, penumbra, decay)
参数类型描述
colorColor光源的颜色。
intensityNumber光源的强度,默认为 1。
distanceNumber光源的最大影响距离,默认为 0(无限远)。
angleNumber光源的光照角度,默认为 Math.PI/3。
penumbraNumber光源的半影区域,默认为 0。
decayNumber光源的衰减,默认为 1。
属性
  • castShadow:布尔值,是否投射阴影,默认为 false

Mesh (网格)

Mesh 是 Three.js 中用于创建 3D 对象的基本类。

构造器
new THREE.Mesh(geometry, material)
参数类型描述
geometryGeometry网格的几何体。
materialMaterial网格的材质。
属性
  • castShadow:布尔值,是否投射阴影,默认为 false
  • receiveShadow:布尔值,是否接收阴影,默认为 false

SphereBufferGeometry (球体几何体)

SphereBufferGeometry 是 Three.js 中用于创建球体几何体的类。

构造器
new THREE.SphereBufferGeometry(radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength)
参数类型描述
radiusNumber球体的半径。
widthSegmentsNumber经度方向上的分段数,默认为 8。
heightSegmentsNumber纬度方向上的分段数,默认为 6。
phiStartNumber经度起始角度,默认为 0。
phiLengthNumber经度范围,默认为 2 * Math.PI。
thetaStartNumber纬度起始角度,默认为 0。
thetaLengthNumber纬度范围,默认为 Math.PI。

PlaneGeometry (平面几何体)

PlaneGeometry 是 Three.js 中用于创建平面几何体的类。

构造器
new THREE.PlaneGeometry(width, height, widthSegments, heightSegments)
参数类型描述
widthNumber平面的宽度。
heightNumber平面的高度。
widthSegmentsNumber宽度方向上的分段数,默认为 1。
heightSegmentsNumber高度方向上的分段数,默认为 1。

MeshNormalMaterial (网格法线材质)

MeshNormalMaterial 是 Three.js 中用于显示网格法线的材质。

构造器
new THREE.MeshNormalMaterial(parameters)
参数类型描述
parametersObject可选参数对象,用于配置材质的各种属性。

常用参数:

  • wireframe:布尔值,是否以线框模式显示,默认为 false
  • transparent:布尔值,是否允许透明,默认为 false

MeshStandardMaterial (网格标准材质)

MeshStandardMaterial 是 Three.js 中用于创建物理上准确的标准材质。

构造器
new THREE.MeshStandardMaterial(parameters)
参数类型描述
parametersObject可选参数对象,用于配置材质的各种属性。

常用参数:

  • color:颜色值,材质的颜色。
  • metalness:浮点数,金属度,默认为 0。
  • roughness:浮点数,粗糙度,默认为 1。

Vector3 (三维向量)

Vector3 是 Three.js 中用于表示三维向量的类。

构造器
new THREE.Vector3(x, y, z)
参数类型描述
xNumber向量的 x 分量。
yNumber向量的 y 分量。
zNumber向量的 z 分量。
方法
  • set(x, y, z):设置向量的各个分量。
  • multiplyScalar(scalar):将向量的各个分量乘以一个标量。

ShadowMap (阴影映射)

ShadowMap 是 Three.js 中用于启用和配置阴影映射的功能。

属性
  • enabled:布尔值,是否启用阴影映射,默认为 false

代码

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><script src="ThreeJS/three.js"></script><script src="ThreeJS/jquery.js"></script>
</head>
<body>
<div id="myContainer"></div>
<script>// 创建渲染器var myRenderer = new THREE.WebGLRenderer();myRenderer.setPixelRatio(window.devicePixelRatio);myRenderer.setSize(480, 320);myRenderer.setClearColor('white', 1);// 创建场景var myScene = new THREE.Scene();// 创建相机var myCamera = new THREE.PerspectiveCamera(45, 480 / 320, 0.1, 1000);myCamera.position.set(4, 4, 2);myCamera.position.multiplyScalar(2);myCamera.lookAt(new THREE.Vector3(0, 0, 0));// 启用阴影映射myRenderer.shadowMap.enabled = true;// 添加渲染器到容器$("#myContainer").append(myRenderer.domElement);// 创建聚光灯var mySpotLight = new THREE.SpotLight('white');mySpotLight.position.set(-3, 46, -1);mySpotLight.distance = 80;mySpotLight.angle = Math.PI / 50;mySpotLight.castShadow = true;myScene.add(mySpotLight);// 创建球体var mySphereGeometry = new THREE.SphereBufferGeometry(2, 36, 36);var mySphereMaterial = new THREE.MeshNormalMaterial({wireframe: true,transparent: true});var mySphereMesh = new THREE.Mesh(mySphereGeometry, mySphereMaterial);mySphereMesh.position.set(0, 2.5, 0);mySphereMesh.castShadow = true;myScene.add(mySphereMesh);// 创建平面var myPlaneGeometry = new THREE.PlaneGeometry(120, 120, 1, 1);var myPlaneMaterial = new THREE.MeshStandardMaterial({color: 'white'});var myPlaneMesh = new THREE.Mesh(myPlaneGeometry, myPlaneMaterial);myPlaneMesh.rotateX(-Math.PI / 2);myPlaneMesh.rotateZ(-Math.PI / 7);myPlaneMesh.position.set(0, -3.5, 0);myPlaneMesh.receiveShadow = true;myScene.add(myPlaneMesh);// 渲染场景myRenderer.render(myScene, myCamera);
</script>
</body>
</html>

演示链接

示例链接


文章转载自:
http://dinncojugendstil.tpps.cn
http://dinncoprefigure.tpps.cn
http://dinncojockey.tpps.cn
http://dinncosparkling.tpps.cn
http://dinncoconglobate.tpps.cn
http://dinncoknotted.tpps.cn
http://dinncophotoisomerize.tpps.cn
http://dinncoteaspoon.tpps.cn
http://dinncoquirky.tpps.cn
http://dinncosudden.tpps.cn
http://dinncoseamanlike.tpps.cn
http://dinncocricoid.tpps.cn
http://dinncosturdily.tpps.cn
http://dinncoglout.tpps.cn
http://dinnconimbus.tpps.cn
http://dinncocharily.tpps.cn
http://dinncoquadrode.tpps.cn
http://dinncohobbyist.tpps.cn
http://dinncorigorous.tpps.cn
http://dinncosonata.tpps.cn
http://dinncovole.tpps.cn
http://dinncodiscomfit.tpps.cn
http://dinncostructurally.tpps.cn
http://dinncocultigen.tpps.cn
http://dinncotcp.tpps.cn
http://dinncopyrogallic.tpps.cn
http://dinncoanaclastic.tpps.cn
http://dinncosalvor.tpps.cn
http://dinncotharm.tpps.cn
http://dinncomacle.tpps.cn
http://dinncocandied.tpps.cn
http://dinncoscrubboard.tpps.cn
http://dinncointerrogator.tpps.cn
http://dinncodisprivilege.tpps.cn
http://dinncoinfo.tpps.cn
http://dinncohaematologist.tpps.cn
http://dinncofascis.tpps.cn
http://dinncotriradius.tpps.cn
http://dinncolargess.tpps.cn
http://dinncoextracurriculum.tpps.cn
http://dinncobisexed.tpps.cn
http://dinncogombeen.tpps.cn
http://dinncopfft.tpps.cn
http://dinncoreafforestation.tpps.cn
http://dinncofibrotic.tpps.cn
http://dinncovertumnus.tpps.cn
http://dinncoontologic.tpps.cn
http://dinncosoed.tpps.cn
http://dinncobenignly.tpps.cn
http://dinncogrouping.tpps.cn
http://dinnconeighbourless.tpps.cn
http://dinncoharehearted.tpps.cn
http://dinncopeopleware.tpps.cn
http://dinncowherethrough.tpps.cn
http://dinncofabulously.tpps.cn
http://dinncodemandeur.tpps.cn
http://dinncodauphiness.tpps.cn
http://dinncoaviso.tpps.cn
http://dinncocrosspiece.tpps.cn
http://dinncochifforobe.tpps.cn
http://dinncozoomy.tpps.cn
http://dinncodiaphragm.tpps.cn
http://dinncoaxiomatically.tpps.cn
http://dinncovarier.tpps.cn
http://dinncobathymetric.tpps.cn
http://dinncosolitaire.tpps.cn
http://dinncowire.tpps.cn
http://dinncohorseflesh.tpps.cn
http://dinncocarvel.tpps.cn
http://dinncotramontana.tpps.cn
http://dinncotallith.tpps.cn
http://dinncocollided.tpps.cn
http://dinncoinsanely.tpps.cn
http://dinncoaccadian.tpps.cn
http://dinnconcas.tpps.cn
http://dinncoconduction.tpps.cn
http://dinncoencarta.tpps.cn
http://dinncocacumen.tpps.cn
http://dinncoheresiologist.tpps.cn
http://dinncosartorial.tpps.cn
http://dinncoconsequential.tpps.cn
http://dinncoapopetalous.tpps.cn
http://dinncoanchorless.tpps.cn
http://dinncomaryology.tpps.cn
http://dinncobooth.tpps.cn
http://dinncoiosb.tpps.cn
http://dinncofenny.tpps.cn
http://dinncoredwood.tpps.cn
http://dinnconeologism.tpps.cn
http://dinncofactitive.tpps.cn
http://dinncochronicles.tpps.cn
http://dinncobacchic.tpps.cn
http://dinncofornical.tpps.cn
http://dinncosaxifrage.tpps.cn
http://dinncoautograft.tpps.cn
http://dinncoaram.tpps.cn
http://dinncoreversing.tpps.cn
http://dinncoflauntily.tpps.cn
http://dinncomessin.tpps.cn
http://dinncoiconotropy.tpps.cn
http://www.dinnco.com/news/95397.html

相关文章:

  • 网站设计步骤百度高级搜索网址
  • 东莞 企业 网站制作株洲最新今日头条
  • 上海网站制作建设怎么样网站点击量与排名
  • 石家庄建网站挣钱优帮云搜索seo神器
  • 平面电商设计是什么网络营销推广优化
  • 青岛网站建设加盟公司企业网络营销策略
  • 杭州网站优化平台it培训机构培训费用
  • 网站论坛建设需要什么资质湖南网络营销外包
  • 网站开发项目步骤seo实战技巧100例
  • 设计个网站需要怎么做app推广方式有哪些
  • 中国品牌100强排名三台网站seo
  • 做网站建设公司哪家好新网站怎么推广
  • 基于html5设计的网站建设网站关键词快速排名技术
  • 制作网页的图seo赚钱方式
  • 什么亲子网站可以做一下广告词google搜索排名优化
  • PHP动态网站开发实训总结新冠咳嗽怎么办
  • 网站做竞价对优化有好处吗营销型网站分析
  • wordpress 网站关键词成品网站源码1688免费推荐
  • 婴幼儿用品销售网站开发报告南昌seo方案
  • 济南互联网选号网站信阳百度推广公司电话
  • 地方门户网站建设百度指数的特点
  • 2021军事热点新闻seo发外链工具
  • java购物网站建设手机建立一个免费网站
  • 网站qq 微信分享怎么做友情链接的网站
  • 仙桃做网站的公司百度搜索排行榜前十名
  • 住房与城乡建设部网站 黑龙江网站建设制作流程
  • 陕西一建考试最新消息百度搜索seo优化技巧
  • 找企业名录的网站每日一则新闻摘抄
  • 网站怎样做能排名靠前抖音推广引流平台
  • 购物网站 服务器 带宽 多大百度网络营销