中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

黃岡最專業(yè)的公司網(wǎng)站建設(shè)平臺(tái)西安百度seo代理

黃岡最專業(yè)的公司網(wǎng)站建設(shè)平臺(tái),西安百度seo代理,企業(yè)建網(wǎng)站好,做交友網(wǎng)站掙錢(qián)嗎👨??? 主頁(yè): gis分享者 👨??? 感謝各位大佬 點(diǎn)贊👍 收藏? 留言📝 加關(guān)注?! 👨??? 收錄于專欄:threejs gis工程師 文章目錄 一、🍀前言1.1 ??THREE.CircleGeometry 圓形…

👨??? 主頁(yè): gis分享者
👨??? 感謝各位大佬 點(diǎn)贊👍 收藏? 留言📝 加關(guān)注?!
👨??? 收錄于專欄:threejs gis工程師

文章目錄

  • 一、🍀前言
    • 1.1 ??THREE.CircleGeometry 圓形幾何體
  • 二、🍀創(chuàng)建THREE.CircleGeometry 二維平面圓形幾何體
    • 1. ??實(shí)現(xiàn)思路
    • 2. ??代碼樣例


一、🍀前言

本文詳細(xì)介紹如何基于threejs在三維場(chǎng)景中創(chuàng)建THREE.CircleGeometry 二維平面圓形幾何體,親測(cè)可用。希望能幫助到您。一起學(xué)習(xí),加油!加油!

1.1 ??THREE.CircleGeometry 圓形幾何體

THREE.CircleGeometry是歐式幾何的一個(gè)簡(jiǎn)單形狀,它由圍繞著一個(gè)中心點(diǎn)的三角分段的數(shù)量所構(gòu)造,由給定的半徑來(lái)延展。 同時(shí)它也可以用于創(chuàng)建規(guī)則多邊形,其分段數(shù)量取決于該規(guī)則多邊形的邊數(shù)。
構(gòu)造函數(shù):
CircleGeometry(radius : Float, segments : Integer, thetaStart : Float, thetaLength : Float)
radius — 圓形的半徑,默認(rèn)值為1
segments — 分段(三角面)的數(shù)量,最小值為3,默認(rèn)值為8。
thetaStart — 第一個(gè)分段的起始角度,默認(rèn)為0。(three o’clock position)
thetaLength — 圓形扇區(qū)的中心角,通常被稱為“θ”(西塔)。默認(rèn)值是2*Pi,這使其成為一個(gè)完整的圓。
屬性:
.parameters : Object
一個(gè)包含著構(gòu)造函數(shù)中每個(gè)參數(shù)的對(duì)象。在對(duì)象實(shí)例化之后,對(duì)該屬性的任何修改都不會(huì)改變這個(gè)幾何體。

二、🍀創(chuàng)建THREE.CircleGeometry 二維平面圓形幾何體

1. ??實(shí)現(xiàn)思路

  • 1、初始化renderer渲染器
  • 2、初始化Scene三維場(chǎng)景scene。
  • 3、初始化PerspectiveCamera透視相機(jī)camera,定義相機(jī)位置 camera.position,設(shè)置相機(jī)方向camera.lookAt。
  • 4、初始化THREE.SpotLight聚光燈光源spotLight,設(shè)置spotLight的位置信息,場(chǎng)景scene中添加spotLight。
  • 5、加載幾何模型:創(chuàng)建THREE.MeshNormalMaterial法向量材質(zhì)meshMaterial,創(chuàng)建THREE.MeshBasicMaterial基礎(chǔ)材質(zhì)wireFrameMat,設(shè)置wireFrameMat基礎(chǔ)材質(zhì)的線框wireframe為true,通過(guò)THREE.SceneUtils.createMultiMaterialObject方法傳入THREE.CircleGeometry圓形幾何體geom和meshMaterial、wireFrameMat材質(zhì)等參數(shù)創(chuàng)建平面幾何體網(wǎng)格組circle,scene場(chǎng)景中添加circle。具體代碼參考代碼樣例。
  • 6、加入gui控制,控制創(chuàng)建的圓形幾何體半徑、分段數(shù)、起始角度、圓形扇區(qū)的中心角。加入stats監(jiān)控器,監(jiān)控幀數(shù)信息。

2. ??代碼樣例

<!DOCTYPE html><html><head><title>THREE.CircleGeometry 二維平面圓形幾何體</title><script type="text/javascript" src="../libs/three.js"></script><script type="text/javascript" src="../libs/stats.js"></script><script type="text/javascript" src="../libs/dat.gui.js"></script><style>body {/* set margin to 0 and overflow to hidden, to go fullscreen */margin: 0;overflow: hidden;}</style>
</head>
<body><div id="Stats-output">
</div>
<!-- Div which will hold the Output -->
<div id="WebGL-output">
</div><!-- Javascript code that runs our Three.js examples -->
<script type="text/javascript">// once everything is loaded, we run our Three.js stuff.function init() {var stats = initStats();// create a scene, that will hold all our elements such as objects, cameras and lights.var scene = new THREE.Scene();// create a camera, which defines where we're looking at.var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);// create a render and set the sizevar webGLRenderer = new THREE.WebGLRenderer();webGLRenderer.setClearColor(new THREE.Color(0xEEEEEE, 1.0));webGLRenderer.setSize(window.innerWidth, window.innerHeight);webGLRenderer.shadowMapEnabled = true;var circle = createMesh(new THREE.CircleGeometry(4, 10, 0.3 * Math.PI * 2, 0.3 * Math.PI * 2));// add the sphere to the scenescene.add(circle);// position and point the camera to the center of the scenecamera.position.x = -20;camera.position.y = 30;camera.position.z = 40;camera.lookAt(new THREE.Vector3(10, 0, 0));// add spotlight for the shadowsvar spotLight = new THREE.SpotLight(0xffffff);spotLight.position.set(-40, 60, -10);scene.add(spotLight);// add the output of the renderer to the html elementdocument.getElementById("WebGL-output").appendChild(webGLRenderer.domElement);// call the render functionvar step = 0;// setup the control guivar controls = new function () {// we need the first child, since it's a multimaterialthis.radius = 4;this.thetaStart = 0.3 * Math.PI * 2;this.thetaLength = 0.3 * Math.PI * 2;this.segments = 10;this.redraw = function () {// remove the old planescene.remove(circle);// create a new onecircle = createMesh(new THREE.CircleGeometry(controls.radius, controls.segments, controls.thetaStart, controls.thetaLength));// add it to the scene.scene.add(circle);};};var gui = new dat.GUI();gui.add(controls, 'radius', 0, 40).onChange(controls.redraw);gui.add(controls, 'segments', 0, 40).onChange(controls.redraw);gui.add(controls, 'thetaStart', 0, 2 * Math.PI).onChange(controls.redraw);gui.add(controls, 'thetaLength', 0, 2 * Math.PI).onChange(controls.redraw);render();function createMesh(geom) {// assign two materialsvar meshMaterial = new THREE.MeshNormalMaterial();meshMaterial.side = THREE.DoubleSide;var wireFrameMat = new THREE.MeshBasicMaterial();wireFrameMat.wireframe = true;// create a multimaterialvar mesh = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial, wireFrameMat]);return mesh;}function render() {stats.update();circle.rotation.y = step += 0.01;// render using requestAnimationFramerequestAnimationFrame(render);webGLRenderer.render(scene, camera);}function initStats() {var stats = new Stats();stats.setMode(0); // 0: fps, 1: ms// Align top-leftstats.domElement.style.position = 'absolute';stats.domElement.style.left = '0px';stats.domElement.style.top = '0px';document.getElementById("Stats-output").appendChild(stats.domElement);return stats;}}window.onload = init;
</script>
</body>
</html>

效果如下:
在這里插入圖片描述

http://www.risenshineclean.com/news/50445.html

相關(guān)文章:

  • wordpress做一個(gè)視頻網(wǎng)站嗎刷網(wǎng)站排名軟件
  • 在線做網(wǎng)站索引線下?tīng)I(yíng)銷推廣方式都有哪些
  • 合肥搭建網(wǎng)站網(wǎng)絡(luò)營(yíng)銷的基本特征有哪七個(gè)
  • 怎么用joomla做網(wǎng)站新公司怎么做網(wǎng)絡(luò)推廣
  • 自己做網(wǎng)站 做什么好以營(yíng)銷推廣為主題的方案
  • wordpress 30天唐山seo推廣公司
  • 網(wǎng)站建設(shè)步驟大全石家莊seo推廣
  • 有哪些做網(wǎng)站的品牌天津百度推廣排名優(yōu)化
  • 做網(wǎng)站的費(fèi)用入賬優(yōu)化公司組織架構(gòu)
  • 申請(qǐng)制作網(wǎng)站seo教程百度網(wǎng)盤(pán)
  • 百家號(hào)和網(wǎng)站同步做凡科建站客服電話
  • 做設(shè)計(jì)找圖有哪些網(wǎng)站有哪些問(wèn)題能打開(kāi)各種網(wǎng)站的瀏覽器
  • 做家庭影院的有哪些網(wǎng)站網(wǎng)站優(yōu)化方案范文
  • 銘萬(wàn)做的網(wǎng)站百度論壇
  • 網(wǎng)站建設(shè)崗位工作范圍網(wǎng)絡(luò)優(yōu)化工程師吃香嗎
  • 做網(wǎng)站銷售東西 需要什么資質(zhì)抖音廣告推廣
  • 武漢建筑工程有限公司搜索引擎seo關(guān)鍵詞優(yōu)化效果
  • 簡(jiǎn)單的購(gòu)物網(wǎng)站源碼百度推廣充值必須5000嗎
  • 做調(diào)查賺錢(qián)的網(wǎng)站又哪些品牌傳播方案
  • 福州做網(wǎng)站公司淘寶seo排名優(yōu)化
  • 手機(jī)網(wǎng)站如何做營(yíng)銷b2c有哪些電商平臺(tái)
  • 江蘇網(wǎng)站建設(shè)定制新浪微博指數(shù)查詢
  • h5互動(dòng)的網(wǎng)站百度快照和廣告的區(qū)別
  • 電子軟件開(kāi)發(fā)工資多少錢(qián)成都seo優(yōu)化公司
  • 同城購(gòu)物網(wǎng)站建設(shè)泰州百度關(guān)鍵詞優(yōu)化
  • 如何查詢網(wǎng)站的備案信息國(guó)際實(shí)時(shí)新聞
  • 創(chuàng)衛(wèi)網(wǎng)站 建設(shè) 方案青島seo經(jīng)理
  • 河北 石家莊 網(wǎng)站建設(shè)青島百度競(jìng)價(jià)
  • 可做外鏈的視頻網(wǎng)站銀川seo
  • vue做的網(wǎng)站多么鄭州網(wǎng)絡(luò)推廣哪個(gè)好