Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
2b1a17e6
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b1a17e6
编写于
3月 27, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
4312d652
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
613 addition
and
549 deletion
+613
-549
build/three.js
build/three.js
+40
-8
build/three.min.js
build/three.min.js
+533
-533
build/three.module.js
build/three.module.js
+40
-8
未找到文件。
build/three.js
浏览文件 @
2b1a17e6
...
...
@@ -15363,6 +15363,7 @@
};
this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );
this.mergeVertices();
}
...
...
@@ -20099,7 +20100,8 @@
this.forceContextLoss = function () {
extensions.get( 'WEBGL_lose_context' ).loseContext();
var extension = extensions.get( 'WEBGL_lose_context' );
if ( extension ) extension.loseContext();
};
...
...
@@ -24274,11 +24276,15 @@
var indices = [];
var vertices = [];
var normals = [];
var uvs = [];
var EPS = 0.00001;
var pu = new Vector3(), pv = new Vector3(), normal = new Vector3();
var i, j;
// generate vertices and uvs
// generate vertices
, normals
and uvs
var sliceCount = slices + 1;
...
...
@@ -24293,6 +24299,33 @@
var p = func( u, v );
vertices.push( p.x, p.y, p.z );
// approximate tangent vectors via finite differences
if ( u - EPS >= 0 ) {
pu.subVectors( p, func( u - EPS, v ) );
} else {
pu.subVectors( func( u + EPS, v ), p );
}
if ( v - EPS >= 0 ) {
pv.subVectors( p, func( u, v - EPS ) );
} else {
pv.subVectors( func( u, v + EPS ), p );
}
// cross product of tangent vectors returns surface normal
normal.crossVectors( pu, pv ).normalize();
normals.push( normal.x, normal.y, normal.z );
uvs.push( u, v );
}
...
...
@@ -24323,12 +24356,9 @@
this.setIndex( indices );
this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
// generate normals
this.computeVertexNormals();
}
ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
...
...
@@ -25182,7 +25212,6 @@
var vertex = new Vector3();
var normal = new Vector3();
var uv = new Vector2();
var P1 = new Vector3();
var P2 = new Vector3();
...
...
@@ -25320,6 +25349,7 @@
};
this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) );
this.mergeVertices();
}
...
...
@@ -27028,6 +27058,7 @@
};
this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) );
this.mergeVertices();
}
...
...
@@ -27170,6 +27201,7 @@
};
this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) );
this.mergeVertices();
}
...
...
@@ -27823,7 +27855,6 @@
// helper variables
var index = 0;
var indexOffset = 0;
var indexArray = [];
var halfHeight = height / 2;
var groupStart = 0;
...
...
@@ -28126,6 +28157,7 @@
};
this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) );
this.mergeVertices();
}
...
...
build/three.min.js
浏览文件 @
2b1a17e6
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/three.module.js
浏览文件 @
2b1a17e6
...
...
@@ -15357,6 +15357,7 @@ function PlaneGeometry( width, height, widthSegments, heightSegments ) {
};
this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );
this.mergeVertices();
}
...
...
@@ -20093,7 +20094,8 @@ function WebGLRenderer( parameters ) {
this.forceContextLoss = function () {
extensions.get( 'WEBGL_lose_context' ).loseContext();
var extension = extensions.get( 'WEBGL_lose_context' );
if ( extension ) extension.loseContext();
};
...
...
@@ -24268,11 +24270,15 @@ function ParametricBufferGeometry( func, slices, stacks ) {
var indices = [];
var vertices = [];
var normals = [];
var uvs = [];
var EPS = 0.00001;
var pu = new Vector3(), pv = new Vector3(), normal = new Vector3();
var i, j;
// generate vertices and uvs
// generate vertices
, normals
and uvs
var sliceCount = slices + 1;
...
...
@@ -24287,6 +24293,33 @@ function ParametricBufferGeometry( func, slices, stacks ) {
var p = func( u, v );
vertices.push( p.x, p.y, p.z );
// approximate tangent vectors via finite differences
if ( u - EPS >= 0 ) {
pu.subVectors( p, func( u - EPS, v ) );
} else {
pu.subVectors( func( u + EPS, v ), p );
}
if ( v - EPS >= 0 ) {
pv.subVectors( p, func( u, v - EPS ) );
} else {
pv.subVectors( func( u, v + EPS ), p );
}
// cross product of tangent vectors returns surface normal
normal.crossVectors( pu, pv ).normalize();
normals.push( normal.x, normal.y, normal.z );
uvs.push( u, v );
}
...
...
@@ -24317,12 +24350,9 @@ function ParametricBufferGeometry( func, slices, stacks ) {
this.setIndex( indices );
this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
// generate normals
this.computeVertexNormals();
}
ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
...
...
@@ -25176,7 +25206,6 @@ function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments,
var vertex = new Vector3();
var normal = new Vector3();
var uv = new Vector2();
var P1 = new Vector3();
var P2 = new Vector3();
...
...
@@ -25314,6 +25343,7 @@ function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) {
};
this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) );
this.mergeVertices();
}
...
...
@@ -27022,6 +27052,7 @@ function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLen
};
this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) );
this.mergeVertices();
}
...
...
@@ -27164,6 +27195,7 @@ function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, the
};
this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) );
this.mergeVertices();
}
...
...
@@ -27817,7 +27849,6 @@ function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments
// helper variables
var index = 0;
var indexOffset = 0;
var indexArray = [];
var halfHeight = height / 2;
var groupStart = 0;
...
...
@@ -28120,6 +28151,7 @@ function CircleGeometry( radius, segments, thetaStart, thetaLength ) {
};
this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) );
this.mergeVertices();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录