Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0ab16a09
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,发现更多精彩内容 >>
提交
0ab16a09
编写于
4月 28, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated loaders and examples to new BufferAttribute pattern.
上级
780f9f8c
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
91 addition
and
91 deletion
+91
-91
examples/index.html
examples/index.html
+1
-0
examples/js/loaders/AWDLoader.js
examples/js/loaders/AWDLoader.js
+4
-4
examples/js/loaders/UTF8Loader.js
examples/js/loaders/UTF8Loader.js
+18
-22
examples/js/loaders/ctm/CTMLoader.js
examples/js/loaders/ctm/CTMLoader.js
+5
-5
examples/webgl_buffergeometry.html
examples/webgl_buffergeometry.html
+9
-9
examples/webgl_buffergeometry_custom_attributes_particles.html
...les/webgl_buffergeometry_custom_attributes_particles.html
+11
-11
examples/webgl_buffergeometry_lines.html
examples/webgl_buffergeometry_lines.html
+5
-5
examples/webgl_buffergeometry_lines_indexed.html
examples/webgl_buffergeometry_lines_indexed.html
+5
-4
examples/webgl_buffergeometry_particles.html
examples/webgl_buffergeometry_particles.html
+5
-5
examples/webgl_buffergeometry_rawshader.html
examples/webgl_buffergeometry_rawshader.html
+2
-2
examples/webgl_buffergeometry_uint.html
examples/webgl_buffergeometry_uint.html
+10
-8
examples/webgl_gpgpu_birds.html
examples/webgl_gpgpu_birds.html
+3
-3
examples/webgl_interactive_buffergeometry.html
examples/webgl_interactive_buffergeometry.html
+8
-8
src/extras/helpers/EdgesHelper.js
src/extras/helpers/EdgesHelper.js
+1
-1
src/extras/helpers/WireframeHelper.js
src/extras/helpers/WireframeHelper.js
+3
-3
src/objects/Sprite.js
src/objects/Sprite.js
+1
-1
未找到文件。
examples/index.html
浏览文件 @
0ab16a09
...
...
@@ -169,6 +169,7 @@
"
webgl_lines_sphere
"
,
"
webgl_lines_splines
"
,
"
webgl_loader_assimp2json
"
,
"
webgl_loader_awd
"
,
"
webgl_loader_collada
"
,
"
webgl_loader_collada_keyframe
"
,
"
webgl_loader_collada_skinning
"
,
...
...
examples/js/loaders/AWDLoader.js
浏览文件 @
0ab16a09
...
...
@@ -735,7 +735,7 @@ THREE.AWDLoader = (function (){
// ------------------
if
(
str_type
===
1
)
{
attrib
=
new
THREE
.
Float32Attribute
(
str_len
/
12
,
3
);
attrib
=
new
THREE
.
Float32Attribute
(
(
str_len
/
12
)
*
3
,
3
);
buffer
=
attrib
.
array
;
geom
.
addAttribute
(
'
position
'
,
attrib
);
...
...
@@ -754,7 +754,7 @@ THREE.AWDLoader = (function (){
// -----------------
else
if
(
str_type
===
2
)
{
attrib
=
new
THREE
.
Uint16Attribute
(
str_len
/
2
,
1
);
attrib
=
new
THREE
.
Uint16Attribute
(
(
str_len
/
2
)
,
1
);
geom
.
addAttribute
(
'
index
'
,
attrib
);
geom
.
offsets
.
push
({
...
...
@@ -778,7 +778,7 @@ THREE.AWDLoader = (function (){
// -------------------
else
if
(
str_type
===
3
)
{
attrib
=
new
THREE
.
Float32Attribute
(
str_len
/
8
,
2
);
attrib
=
new
THREE
.
Float32Attribute
(
(
str_len
/
8
)
*
2
,
2
);
buffer
=
attrib
.
array
;
geom
.
addAttribute
(
'
uv
'
,
attrib
);
...
...
@@ -794,7 +794,7 @@ THREE.AWDLoader = (function (){
// NORMALS
else
if
(
str_type
===
4
)
{
attrib
=
new
THREE
.
Float32Attribute
(
str_len
/
12
,
3
);
attrib
=
new
THREE
.
Float32Attribute
(
(
str_len
/
12
)
*
3
,
3
);
geom
.
addAttribute
(
'
normal
'
,
attrib
);
buffer
=
attrib
.
array
idx
=
0
...
...
examples/js/loaders/UTF8Loader.js
浏览文件 @
0ab16a09
...
...
@@ -28,19 +28,15 @@ THREE.UTF8Loader.prototype.load = function ( jsonUrl, callback, options ) {
THREE
.
UTF8Loader
.
BufferGeometryCreator
=
function
()
{
};
THREE
.
UTF8Loader
.
BufferGeometryCreator
.
prototype
.
create
=
function
(
attribArray
,
ind
exArray
)
{
THREE
.
UTF8Loader
.
BufferGeometryCreator
.
prototype
.
create
=
function
(
attribArray
,
ind
ices
)
{
var
ntris
=
ind
exArray
.
length
/
3
;
var
ntris
=
ind
ices
.
length
/
3
;
var
geometry
=
new
THREE
.
BufferGeometry
();
var
positions
=
new
THREE
.
Float32Attribute
(
ntris
*
3
,
3
);
var
normals
=
new
THREE
.
Float32Attribute
(
ntris
*
3
,
3
);
var
uvs
=
new
THREE
.
Float32Attribute
(
ntris
*
3
,
2
);
var
positionsArray
=
positions
.
array
;
var
normalsArray
=
normals
.
array
;
var
uvsArray
=
uvs
.
array
;
var
positions
=
new
Float32Array
(
ntris
*
3
*
3
);
var
normals
=
new
Float32Array
(
ntris
*
3
*
3
);
var
uvs
=
new
Float32Array
(
ntris
*
3
*
2
);
var
i
,
j
,
offset
;
var
x
,
y
,
z
;
...
...
@@ -60,9 +56,9 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
y
=
attribArray
[
i
+
1
];
z
=
attribArray
[
i
+
2
];
positions
Array
[
j
++
]
=
x
;
positions
Array
[
j
++
]
=
y
;
positions
Array
[
j
++
]
=
z
;
positions
[
j
++
]
=
x
;
positions
[
j
++
]
=
y
;
positions
[
j
++
]
=
z
;
}
...
...
@@ -76,8 +72,8 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
u
=
attribArray
[
i
];
v
=
attribArray
[
i
+
1
];
uvs
Array
[
j
++
]
=
u
;
uvs
Array
[
j
++
]
=
v
;
uvs
[
j
++
]
=
u
;
uvs
[
j
++
]
=
v
;
}
...
...
@@ -92,18 +88,18 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
y
=
attribArray
[
i
+
1
];
z
=
attribArray
[
i
+
2
];
normals
Array
[
j
++
]
=
x
;
normals
Array
[
j
++
]
=
y
;
normals
Array
[
j
++
]
=
z
;
normals
[
j
++
]
=
x
;
normals
[
j
++
]
=
y
;
normals
[
j
++
]
=
z
;
}
geometry
.
addAttribute
(
'
index
'
,
indexArray
,
1
);
geometry
.
addAttribute
(
'
position
'
,
positions
);
geometry
.
addAttribute
(
'
normal
'
,
n
ormals
);
geometry
.
addAttribute
(
'
uv
'
,
uvs
);
geometry
.
addAttribute
(
'
index
'
,
new
THREE
.
Uint32Attribute
(
indices
,
1
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
normal
'
,
n
ew
THREE
.
Float32Attribute
(
normals
,
3
)
);
geometry
.
addAttribute
(
'
uv
'
,
new
THREE
.
Float32Attribute
(
uvs
,
2
)
);
geometry
.
offsets
.
push
(
{
start
:
0
,
count
:
ind
exArray
.
length
,
index
:
0
}
);
geometry
.
offsets
.
push
(
{
start
:
0
,
count
:
ind
ices
.
length
,
index
:
0
}
);
geometry
.
computeBoundingSphere
();
...
...
examples/js/loaders/ctm/CTMLoader.js
浏览文件 @
0ab16a09
...
...
@@ -211,17 +211,17 @@ THREE.CTMLoader.prototype.createModel = function ( file, callback ) {
colors
=
file
.
body
.
attrMaps
[
0
].
attr
;
}
this
.
addAttribute
(
'
index
'
,
new
THREE
.
Uint32Attribute
(
indices
.
length
,
1
).
set
(
indices
)
);
this
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
.
length
,
3
).
set
(
positions
)
);
this
.
addAttribute
(
'
index
'
,
new
THREE
.
Uint32Attribute
(
indices
,
1
)
);
this
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
if
(
normals
!==
undefined
)
this
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32Attribute
(
normals
.
length
,
3
).
set
(
normals
)
);
this
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32Attribute
(
normals
,
3
)
);
if
(
uvs
!==
undefined
)
this
.
addAttribute
(
'
uv
'
,
new
THREE
.
Float32Attribute
(
uvs
.
length
,
2
).
set
(
uvs
)
);
this
.
addAttribute
(
'
uv
'
,
new
THREE
.
Float32Attribute
(
uvs
,
2
)
);
if
(
colors
!==
undefined
)
this
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
.
length
,
4
).
set
(
colors
)
);
this
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
4
)
);
}
...
...
examples/webgl_buffergeometry.html
浏览文件 @
0ab16a09
...
...
@@ -82,11 +82,6 @@
var
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
index
'
,
new
Uint16Array
(
triangles
*
3
),
1
);
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
geometry
.
addAttribute
(
'
normal
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
geometry
.
addAttribute
(
'
color
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
// break geometry into
// chunks of 21,845 triangles (3 unique vertices per triangle)
// for indices to fit into 16 bit integer number
...
...
@@ -94,7 +89,7 @@
var
chunkSize
=
21845
;
var
indices
=
geometry
.
getAttribute
(
'
index
'
).
array
;
var
indices
=
new
Uint16Array
(
triangles
*
3
)
;
for
(
var
i
=
0
;
i
<
indices
.
length
;
i
++
)
{
...
...
@@ -102,9 +97,9 @@
}
var
positions
=
geometry
.
getAttribute
(
'
position
'
).
array
;
var
normals
=
geometry
.
getAttribute
(
'
normal
'
).
array
;
var
colors
=
geometry
.
getAttribute
(
'
color
'
).
array
;
var
positions
=
new
Float32Array
(
triangles
*
3
*
3
)
;
var
normals
=
new
Float32Array
(
triangles
*
3
*
3
)
;
var
colors
=
new
Float32Array
(
triangles
*
3
*
3
)
;
var
color
=
new
THREE
.
Color
();
...
...
@@ -200,6 +195,11 @@
}
geometry
.
addAttribute
(
'
index
'
,
new
THREE
.
Uint16Attribute
(
indices
,
1
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32Attribute
(
normals
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
3
)
);
var
offsets
=
triangles
/
chunkSize
;
for
(
var
i
=
0
;
i
<
offsets
;
i
++
)
{
...
...
examples/webgl_buffergeometry_custom_attributes_particles.html
浏览文件 @
0ab16a09
...
...
@@ -137,17 +137,9 @@
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
particles
*
3
),
3
);
geometry
.
addAttribute
(
'
customColor
'
,
new
Float32Array
(
particles
*
3
),
3
);
geometry
.
addAttribute
(
'
size
'
,
new
Float32Array
(
particles
),
1
);
var
positions
=
geometry
.
getAttribute
(
'
position
'
).
array
;
var
values_color
=
geometry
.
getAttribute
(
'
customColor
'
).
array
;
values_size
=
geometry
.
getAttribute
(
'
size
'
).
array
;
sphere
=
new
THREE
.
ParticleSystem
(
geometry
,
shaderMaterial
);
// sphere.sortParticles = true;
var
positions
=
new
Float32Array
(
particles
*
3
);
var
values_color
=
new
Float32Array
(
particles
*
3
);
values_size
=
new
Float32Array
(
particles
);
var
color
=
new
THREE
.
Color
(
0xffaa00
);;
...
...
@@ -170,6 +162,14 @@
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
customColor
'
,
new
THREE
.
Float32Attribute
(
values_color
,
3
)
);
geometry
.
addAttribute
(
'
size
'
,
new
THREE
.
Float32Attribute
(
values_size
,
1
)
);
sphere
=
new
THREE
.
ParticleSystem
(
geometry
,
shaderMaterial
);
// sphere.sortParticles = true;
scene
.
add
(
sphere
);
renderer
=
new
THREE
.
WebGLRenderer
();
...
...
examples/webgl_buffergeometry_lines.html
浏览文件 @
0ab16a09
...
...
@@ -69,11 +69,8 @@
var
geometry
=
new
THREE
.
BufferGeometry
();
var
material
=
new
THREE
.
LineBasicMaterial
({
vertexColors
:
true
});
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
segments
*
3
),
3
);
geometry
.
addAttribute
(
'
color
'
,
new
Float32Array
(
segments
*
3
),
3
);
var
positions
=
geometry
.
getAttribute
(
'
position
'
).
array
;
var
colors
=
geometry
.
getAttribute
(
'
color
'
).
array
;
var
positions
=
new
Float32Array
(
segments
*
3
);
var
colors
=
new
Float32Array
(
segments
*
3
);
var
r
=
800
;
...
...
@@ -97,6 +94,9 @@
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
3
)
);
geometry
.
computeBoundingSphere
();
mesh
=
new
THREE
.
Line
(
geometry
,
material
);
...
...
examples/webgl_buffergeometry_lines_indexed.html
浏览文件 @
0ab16a09
...
...
@@ -69,7 +69,8 @@
var
colors
=
[];
var
indices_array
=
[];
// --------------------------------
//
var
iteration_count
=
4
;
var
rangle
=
60
*
Math
.
PI
/
180.0
;
...
...
@@ -181,9 +182,9 @@
);
// --------------------------------
geometry
.
addAttribute
(
'
index
'
,
new
Uint16Array
(
indices_array
),
1
);
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
positions
),
3
);
geometry
.
addAttribute
(
'
color
'
,
new
Float32Array
(
colors
),
3
);
geometry
.
addAttribute
(
'
index
'
,
new
THREE
.
Uint16Attribute
(
indices_array
,
1
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
3
)
);
geometry
.
computeBoundingSphere
();
mesh
=
new
THREE
.
Line
(
geometry
,
material
,
THREE
.
LinePieces
);
...
...
examples/webgl_buffergeometry_particles.html
浏览文件 @
0ab16a09
...
...
@@ -69,11 +69,8 @@
var
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
particles
*
3
),
3
);
geometry
.
addAttribute
(
'
color
'
,
new
Float32Array
(
particles
*
3
),
3
);
var
positions
=
geometry
.
getAttribute
(
'
position
'
).
array
;
var
colors
=
geometry
.
getAttribute
(
'
color
'
).
array
;
var
positions
=
new
Float32Array
(
particles
*
3
);
var
colors
=
new
Float32Array
(
particles
*
3
);
var
color
=
new
THREE
.
Color
();
...
...
@@ -105,6 +102,9 @@
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
3
)
);
geometry
.
computeBoundingSphere
();
//
...
...
examples/webgl_buffergeometry_rawshader.html
浏览文件 @
0ab16a09
...
...
@@ -113,7 +113,7 @@
var
geometry
=
new
THREE
.
BufferGeometry
();
var
vertices
=
new
THREE
.
Float32Attribute
(
triangles
*
3
,
3
);
var
vertices
=
new
THREE
.
Float32Attribute
(
triangles
*
3
*
3
,
3
);
for
(
var
i
=
0
;
i
<
vertices
.
length
;
i
++
)
{
...
...
@@ -123,7 +123,7 @@
geometry
.
addAttribute
(
'
position
'
,
vertices
);
var
colors
=
new
THREE
.
Float32Attribute
(
triangles
*
3
,
4
);
var
colors
=
new
THREE
.
Float32Attribute
(
triangles
*
3
*
4
,
4
);
for
(
var
i
=
0
;
i
<
colors
.
length
;
i
++
)
{
...
...
examples/webgl_buffergeometry_uint.html
浏览文件 @
0ab16a09
...
...
@@ -82,12 +82,9 @@
var
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
index
'
,
new
Uint32Array
(
triangles
*
3
),
1
);
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
geometry
.
addAttribute
(
'
normal
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
geometry
.
addAttribute
(
'
color
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
var
indices
=
geometry
.
getAttribute
(
'
index
'
).
array
;
var
indices
=
new
Uint32Array
(
triangles
*
3
);
for
(
var
i
=
0
;
i
<
indices
.
length
;
i
++
)
{
...
...
@@ -95,9 +92,9 @@
}
var
positions
=
geometry
.
getAttribute
(
'
position
'
).
array
;
var
normals
=
geometry
.
getAttribute
(
'
normal
'
).
array
;
var
colors
=
geometry
.
getAttribute
(
'
color
'
).
array
;
var
positions
=
new
Float32Array
(
triangles
*
3
*
3
)
;
var
normals
=
new
Float32Array
(
triangles
*
3
*
3
)
;
var
colors
=
new
Float32Array
(
triangles
*
3
*
3
)
;
var
color
=
new
THREE
.
Color
();
...
...
@@ -193,6 +190,11 @@
}
geometry
.
addAttribute
(
'
index
'
,
new
THREE
.
Uint32Attribute
(
indices
,
1
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32Attribute
(
normals
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
3
)
);
geometry
.
computeBoundingSphere
();
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
examples/webgl_gpgpu_birds.html
浏览文件 @
0ab16a09
...
...
@@ -382,9 +382,9 @@
THREE
.
BufferGeometry
.
call
(
this
);
var
vertices
=
new
THREE
.
Float32Attribute
(
points
,
3
);
var
birdColors
=
new
THREE
.
Float32Attribute
(
points
,
3
);
var
references
=
new
THREE
.
Float32Attribute
(
points
,
2
);
var
vertices
=
new
THREE
.
Float32Attribute
(
points
*
3
,
3
);
var
birdColors
=
new
THREE
.
Float32Attribute
(
points
*
3
,
3
);
var
references
=
new
THREE
.
Float32Attribute
(
points
*
2
,
2
);
var
birdVertex
=
new
THREE
.
Float32Attribute
(
points
,
1
);
this
.
addAttribute
(
'
position
'
,
vertices
);
...
...
examples/webgl_interactive_buffergeometry.html
浏览文件 @
0ab16a09
...
...
@@ -84,13 +84,9 @@
var
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
geometry
.
addAttribute
(
'
normal
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
geometry
.
addAttribute
(
'
color
'
,
new
Float32Array
(
triangles
*
3
*
3
),
3
);
var
positions
=
geometry
.
getAttribute
(
'
position
'
).
array
;
var
normals
=
geometry
.
getAttribute
(
'
normal
'
).
array
;
var
colors
=
geometry
.
getAttribute
(
'
color
'
).
array
;
var
positions
=
new
Float32Array
(
triangles
*
3
*
3
);
var
normals
=
new
Float32Array
(
triangles
*
3
*
3
);
var
colors
=
new
Float32Array
(
triangles
*
3
*
3
);
var
color
=
new
THREE
.
Color
();
...
...
@@ -186,6 +182,10 @@
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
normal
'
,
new
THREE
.
Float32Attribute
(
normals
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32Attribute
(
colors
,
3
)
);
geometry
.
computeBoundingSphere
();
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
@@ -204,7 +204,7 @@
mouse
=
new
THREE
.
Vector2
();
var
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
position
'
,
new
Float32Array
(
4
*
3
),
3
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
4
*
3
,
3
)
);
var
material
=
new
THREE
.
LineBasicMaterial
(
{
color
:
0xffffff
,
linewidth
:
2
,
transparent
:
true
}
);
...
...
src/extras/helpers/EdgesHelper.js
浏览文件 @
0ab16a09
...
...
@@ -48,7 +48,7 @@ THREE.EdgesHelper = function ( object, hex ) {
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
,
3
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
*
3
,
3
)
);
var
coords
=
geometry
.
attributes
.
position
.
array
;
...
...
src/extras/helpers/WireframeHelper.js
浏览文件 @
0ab16a09
...
...
@@ -46,7 +46,7 @@ THREE.WireframeHelper = function ( object, hex ) {
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
,
3
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
*
3
,
3
)
);
var
coords
=
geometry
.
attributes
.
position
.
array
;
...
...
@@ -106,7 +106,7 @@ THREE.WireframeHelper = function ( object, hex ) {
}
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
,
3
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
*
3
,
3
)
);
var
coords
=
geometry
.
attributes
.
position
.
array
;
...
...
@@ -130,7 +130,7 @@ THREE.WireframeHelper = function ( object, hex ) {
var
numEdges
=
vertices
.
length
/
3
;
var
numTris
=
numEdges
/
3
;
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
,
3
)
);
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32Attribute
(
numEdges
*
2
*
3
,
3
)
);
var
coords
=
geometry
.
attributes
.
position
.
array
;
...
...
src/objects/Sprite.js
浏览文件 @
0ab16a09
...
...
@@ -5,7 +5,7 @@
THREE
.
Sprite
=
(
function
()
{
var
vertices
=
new
THREE
.
Float32Attribute
(
3
,
3
);
var
vertices
=
new
THREE
.
Float32Attribute
(
3
*
3
,
3
);
vertices
.
set
(
[
-
0.5
,
-
0.5
,
0
,
0.5
,
-
0.5
,
0
,
0.5
,
0.5
,
0
]
);
var
geometry
=
new
THREE
.
BufferGeometry
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录