提交 027e8c69 编写于 作者: M Mr.doob

Cube.js: Fixed a bug iregular sizes.

上级 f50f42dd
此差异已折叠。
......@@ -60,17 +60,20 @@ var Cube = function ( width, height, depth, segments_width, segments_height, mat
this.sides.pz && buildPlane( 'x', 'y', 1 * flip, - 1, width, height, depth_half, this.materials[ 4 ] ); // pz
this.sides.nz && buildPlane( 'x', 'y', - 1 * flip, - 1, width, height, - depth_half, this.materials[ 5 ] ); // nz
mergeVertices();
// mergeVertices();
function buildPlane( u, v, udir, vdir, width, height, depth, material ) {
var gridX = segments_width || 1,
var w,
gridX = segments_width || 1,
gridY = segments_height || 1,
gridX1 = gridX + 1,
gridY1 = gridY + 1,
width_half = width / 2,
height_half = height / 2,
segment_width = width / gridX,
segment_height = height / gridY,
offset = scope.vertices.length, w;
offset = scope.vertices.length;
if ( ( u == 'x' && v == 'y' ) || ( u == 'y' && v == 'x' ) ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册