【文件属性】:
文件名称:quantize-vertices:将顶点量化到任何位精度
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-21 15:21:18
JavaScript
量化顶点
将顶点量化到任何位精度
获取任意维度的顶点并将它们的坐标量化为任何位精度。 通过提供数组而不是 int 作为位数,可以将不同的维度量化为不同的精度。
安装
$ npm install quantize-vertices
用法
var quantizeVertices = require ( 'quantize-vertices' ) ;
var positions = [
[ 1 , 0 , - 0.5 ] ,
[ 0 , 0.5 , 0 ] ,
[ 0 , 1 , 0.5 ] ,
] ;
var positions = quantizeVertices ( positions , 8 ) ;
console . log ( positions ) ;
/*
[
[255, 0, 0],
[ 0, 127, 127]
【文件预览】:
quantize-vertices-master
----index.js(794B)
----package.json(485B)
----LICENSE(1KB)
----.gitignore(19B)
----README.md(1019B)