Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
4f6d3e99
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,发现更多精彩内容 >>
提交
4f6d3e99
编写于
8月 28, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
46e6c931
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
499 addition
and
538 deletion
+499
-538
build/three.js
build/three.js
+32
-69
build/three.min.js
build/three.min.js
+467
-469
未找到文件。
build/three.js
浏览文件 @
4f6d3e99
...
...
@@ -8805,6 +8805,8 @@ THREE.BufferAttribute = function ( array, itemSize ) {
this.array = array;
this.itemSize = itemSize;
this.needsUpdate = false;
};
THREE.BufferAttribute.prototype = {
...
...
@@ -9309,36 +9311,29 @@ THREE.BufferGeometry.prototype = {
computeVertexNormals: function () {
if ( this.attributes[ 'position' ] ) {
var i, il;
var j, jl;
var nVertexElements = this.attributes[ 'position' ].array.length;
var attributes = this.attributes;
if ( this.attributes[ 'normal' ] === undefined
) {
if ( attributes.position
) {
this.attributes[ 'normal' ] = {
var positions = attributes.position.array;
itemSize: 3,
array: new Float32Array( nVertexElements )
if ( attributes.normal === undefined ) {
}
;
attributes.normal = new THREE.BufferAttribute( new Float32Array( positions.length ), 3 )
;
} else {
// reset existing normals to zero
for (
i = 0, il = this.attributes[ 'normal' ]
.array.length; i < il; i ++ ) {
for (
var i = 0, il = attributes.normal
.array.length; i < il; i ++ ) {
this.attributes[ 'normal' ]
.array[ i ] = 0;
attributes.normal
.array[ i ] = 0;
}
}
var positions = this.attributes[ 'position' ].array;
var normals = this.attributes[ 'normal' ].array;
var normals = attributes.normal.array;
var vA, vB, vC, x, y, z,
...
...
@@ -9351,19 +9346,19 @@ THREE.BufferGeometry.prototype = {
// indexed elements
if (
this.attributes[ 'index' ]
) {
if (
attributes.index
) {
var indices =
this.attributes[ 'index' ]
.array;
var indices =
attributes.index
.array;
var offsets = ( this.offsets.length > 0 ? this.offsets : [ { start: 0, count: indices.length, index: 0 } ] );
for ( j = 0, jl = offsets.length; j < jl; ++ j ) {
for (
var
j = 0, jl = offsets.length; j < jl; ++ j ) {
var start = offsets[ j ].start;
var count = offsets[ j ].count;
var index = offsets[ j ].index;
for ( i = start, il = start + count; i < il; i += 3 ) {
for (
var
i = start, il = start + count; i < il; i += 3 ) {
vA = index + indices[ i ];
vB = index + indices[ i + 1 ];
...
...
@@ -9404,11 +9399,11 @@ THREE.BufferGeometry.prototype = {
}
// non-indexed elements (unconnected triangle soup)
} else {
for ( i = 0, il = positions.length; i < il; i += 9 ) {
// non-indexed elements (unconnected triangle soup)
for ( var i = 0, il = positions.length; i < il; i += 9 ) {
x = positions[ i ];
y = positions[ i + 1 ];
...
...
@@ -9447,7 +9442,7 @@ THREE.BufferGeometry.prototype = {
this.normalizeNormals();
this.normalsNeed
Update = true;
attributes.normal.needs
Update = true;
}
...
...
@@ -13053,11 +13048,9 @@ THREE.BufferGeometryLoader.prototype = {
for ( var key in attributes ) {
var attribute = attributes[ key ];
var typedArray = new self[ attribute.type ]( attribute.array );
geometry.attributes[ key ] = {
itemSize: attribute.itemSize,
array: new self[ attribute.type ]( attribute.array )
}
geometry.attributes[ key ] = new THREE.BufferAttribute( typedArray, attribute.itemSize );
}
...
...
@@ -20335,28 +20328,6 @@ THREE.WebGLRenderer = function ( parameters ) {
};
//
function initDirectBuffers( geometry ) {
var keys = Object.keys( geometry.attributes );
for ( var i = 0; i < keys.length; i ++ ) {
var name = keys[ i ];
var bufferType = ( name === 'index' ) ? _gl.ELEMENT_ARRAY_BUFFER : _gl.ARRAY_BUFFER;
var attribute = geometry.attributes[ name ];
attribute.buffer = _gl.createBuffer();
_gl.bindBuffer( bufferType, attribute.buffer );
_gl.bufferData( bufferType, attribute.array, _gl.STATIC_DRAW );
}
}
// Buffer setting
function setParticleBuffers ( geometry, hint, object ) {
...
...
@@ -21651,7 +21622,7 @@ THREE.WebGLRenderer = function ( parameters ) {
};
function setDirectBuffers( geometry
, hint
) {
function setDirectBuffers( geometry ) {
var attributes = geometry.attributes;
...
...
@@ -21662,19 +21633,19 @@ THREE.WebGLRenderer = function ( parameters ) {
var attributeName = keys[ i ];
var attributeItem = attributes[ attributeName ];
if ( attributeItem.
needsUpdate
) {
if ( attributeItem.
buffer === undefined
) {
if ( attributeName === 'index' ) {
attributeItem.buffer = _gl.createBuffer();
attributeItem.needsUpdate = true;
_gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, attributeItem.buffer );
_gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, attributeItem.array, hint );
}
} else
{
if ( attributeItem.needsUpdate === true )
{
_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
_gl.bufferData( _gl.ARRAY_BUFFER, attributeItem.array, hint );
var bufferType = ( attributeName === 'index' ) ? _gl.ELEMENT_ARRAY_BUFFER : _gl.ARRAY_BUFFER;
}
_gl.bindBuffer( bufferType, attributeItem.buffer );
_gl.bufferData( bufferType, attributeItem.array, _gl.STATIC_DRAW );
attributeItem.needsUpdate = false;
...
...
@@ -22960,7 +22931,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( geometry instanceof THREE.BufferGeometry ) {
initDirectBuffers( geometry );
//
} else if ( object instanceof THREE.Mesh ) {
...
...
@@ -23127,22 +23098,14 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( geometry instanceof THREE.BufferGeometry ) {
setDirectBuffers( geometry
, _gl.DYNAMIC_DRAW
);
setDirectBuffers( geometry );
} else if ( object instanceof THREE.Mesh ) {
// check all geometry groups
if ( geometry.buffersNeedUpdate || geometry.groupsNeedUpdate ) {
if ( geometry instanceof THREE.BufferGeometry ) {
initDirectBuffers( geometry );
} else if ( object instanceof THREE.Mesh ) {
initGeometryGroups(scene, object,geometry);
}
initGeometryGroups(scene, object,geometry);
}
...
...
build/three.min.js
浏览文件 @
4f6d3e99
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录