codecamp

three.js PolarGridHelper

极坐标格辅助对象. 坐标格实际上是2维线数组.

代码示例

const radius = 10;
const sectors = 16;
const rings = 8;
const divisions = 64;

const helper = new THREE.PolarGridHelper( radius, sectors, rings, divisions );
scene.add( helper );

例子

WebGL / helpers

构造函数

PolarGridHelper( radius : Number, sectors : Number, rings : Number, divisions : Number, color1 : Color, color2 : Color )

radius -- 极坐标格半径. 可以为任何正数. 默认为 10.
sectors -- 网格将被划分成的扇区数。这可以是任何正整数。默认值为 16。

rings -- 环数。这可以是任何正整数。默认值为 8。

divisions -- 圆圈细分段数. 可以为任何大于或等于3的正整数. 默认为 64.
color1 -- 极坐标格使用的第一个颜色. 值可以为 Color 类型, 16进制 和 CSS 颜色名. 默认为 0x444444
color2 -- 极坐标格使用的第二个颜色. 值可以为 Color 类型, 16进制 和 CSS 颜色名. 默认为 0x888888

创建一个新的 PolarGridHelper,其半径为“radius”,扇区数为“sectors”,环数为“rings”,其中每个圆被平滑为线段数为“divisions”。颜色是可选的。

源码

src/helpers/PolarGridHelper.js


three.js GridHelper
three.js HemisphereLightHelper
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

参考

核心 / BufferAttributes

渲染器 / WebXR

开发者参考

WebGL渲染器

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }