Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
9e322bc2
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,发现更多精彩内容 >>
提交
9e322bc2
编写于
5月 02, 2015
作者:
B
Brage Nilsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix instancing examples (see #6473)
上级
191bb16c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
8 deletion
+8
-8
examples/webgl_buffergeometry_instancing.html
examples/webgl_buffergeometry_instancing.html
+4
-4
examples/webgl_buffergeometry_instancing_dynamic.html
examples/webgl_buffergeometry_instancing_dynamic.html
+4
-4
未找到文件。
examples/webgl_buffergeometry_instancing.html
浏览文件 @
9e322bc2
...
@@ -145,7 +145,7 @@
...
@@ -145,7 +145,7 @@
var
offsets
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
3
),
3
,
1
,
false
);
var
offsets
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
3
),
3
,
1
,
false
);
for
(
var
i
=
0
,
ul
=
offsets
.
length
/
3
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
offsets
.
length
;
i
<
ul
;
i
++
)
{
offsets
.
setXYZ
(
i
,
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
);
offsets
.
setXYZ
(
i
,
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
);
...
@@ -155,7 +155,7 @@
...
@@ -155,7 +155,7 @@
var
colors
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
false
);
var
colors
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
false
);
for
(
var
i
=
0
,
ul
=
colors
.
length
/
4
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
colors
.
length
;
i
<
ul
;
i
++
)
{
colors
.
setXYZW
(
i
,
Math
.
random
(),
Math
.
random
(),
Math
.
random
(),
Math
.
random
()
);
colors
.
setXYZW
(
i
,
Math
.
random
(),
Math
.
random
(),
Math
.
random
(),
Math
.
random
()
);
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
var
orientationsStart
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
false
);
var
orientationsStart
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
false
);
for
(
var
i
=
0
,
ul
=
orientationsStart
.
length
/
4
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
orientationsStart
.
length
;
i
<
ul
;
i
++
)
{
vector
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
);
vector
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
);
vector
.
normalize
();
vector
.
normalize
();
...
@@ -180,7 +180,7 @@
...
@@ -180,7 +180,7 @@
var
orientationsEnd
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
false
);
var
orientationsEnd
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
false
);
for
(
var
i
=
0
,
ul
=
orientationsEnd
.
length
/
4
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
orientationsEnd
.
length
;
i
<
ul
;
i
++
)
{
vector
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
);
vector
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
);
vector
.
normalize
();
vector
.
normalize
();
...
...
examples/webgl_buffergeometry_instancing_dynamic.html
浏览文件 @
9e322bc2
...
@@ -213,7 +213,7 @@
...
@@ -213,7 +213,7 @@
var
offsets
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
3
),
3
,
1
,
false
);
var
offsets
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
3
),
3
,
1
,
false
);
var
vector
=
new
THREE
.
Vector4
();
var
vector
=
new
THREE
.
Vector4
();
for
(
var
i
=
0
,
ul
=
offsets
.
length
/
3
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
offsets
.
length
;
i
<
ul
;
i
++
)
{
var
x
=
Math
.
random
()
*
100
-
50
;
var
x
=
Math
.
random
()
*
100
-
50
;
var
y
=
Math
.
random
()
*
100
-
50
;
var
y
=
Math
.
random
()
*
100
-
50
;
var
z
=
Math
.
random
()
*
100
-
50
;
var
z
=
Math
.
random
()
*
100
-
50
;
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
orientations
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
true
);
orientations
=
new
THREE
.
InstancedBufferAttribute
(
new
Float32Array
(
instances
*
4
),
4
,
1
,
true
);
for
(
var
i
=
0
,
ul
=
orientations
.
length
/
4
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
orientations
.
length
;
i
<
ul
;
i
++
)
{
vector
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
);
vector
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
);
vector
.
normalize
();
vector
.
normalize
();
...
@@ -318,7 +318,7 @@
...
@@ -318,7 +318,7 @@
var
delta
=
(
time
-
lastTime
)
/
5000
;
var
delta
=
(
time
-
lastTime
)
/
5000
;
tmpQ
.
set
(
moveQ
.
x
*
delta
,
moveQ
.
y
*
delta
,
moveQ
.
z
*
delta
,
1
).
normalize
();
tmpQ
.
set
(
moveQ
.
x
*
delta
,
moveQ
.
y
*
delta
,
moveQ
.
z
*
delta
,
1
).
normalize
();
for
(
var
i
=
0
,
ul
=
orientations
.
length
/
4
;
i
<
ul
;
i
++
)
{
for
(
var
i
=
0
,
ul
=
orientations
.
length
;
i
<
ul
;
i
++
)
{
var
index
=
i
*
4
;
var
index
=
i
*
4
;
currentQ
.
set
(
orientations
.
array
[
index
],
orientations
.
array
[
index
+
1
],
orientations
.
array
[
index
+
2
],
orientations
.
array
[
index
+
3
]
);
currentQ
.
set
(
orientations
.
array
[
index
],
orientations
.
array
[
index
+
1
],
orientations
.
array
[
index
+
2
],
orientations
.
array
[
index
+
3
]
);
currentQ
.
multiply
(
tmpQ
);
currentQ
.
multiply
(
tmpQ
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录