Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
10543ca3
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,发现更多精彩内容 >>
提交
10543ca3
编写于
3月 15, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed TypedVector* to ProxyVector*.
上级
a0e73443
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
47 addition
and
168 deletion
+47
-168
examples/js/wip/PlaneBufferGeometry.js
examples/js/wip/PlaneBufferGeometry.js
+2
-2
examples/js/wip/PlaneGeometry6.js
examples/js/wip/PlaneGeometry6.js
+29
-0
examples/js/wip/PlaneGeometryB2.js
examples/js/wip/PlaneGeometryB2.js
+0
-151
examples/misc_geometry2_sandbox.html
examples/misc_geometry2_sandbox.html
+5
-4
src/core/BufferGeometryManipulator.js
src/core/BufferGeometryManipulator.js
+3
-3
src/math/ProxyVector2.js
src/math/ProxyVector2.js
+3
-3
src/math/ProxyVector3.js
src/math/ProxyVector3.js
+3
-3
utils/build/includes/common.json
utils/build/includes/common.json
+2
-2
未找到文件。
examples/js/wip/Plane
GeometryB
.js
→
examples/js/wip/Plane
BufferGeometry
.js
浏览文件 @
10543ca3
...
...
@@ -3,7 +3,7 @@
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
*/
THREE
.
Plane
GeometryB
=
function
(
width
,
height
,
widthSegments
,
heightSegments
)
{
THREE
.
Plane
BufferGeometry
=
function
(
width
,
height
,
widthSegments
,
heightSegments
)
{
THREE
.
BufferGeometry
.
call
(
this
);
...
...
@@ -90,4 +90,4 @@ THREE.PlaneGeometryB = function ( width, height, widthSegments, heightSegments )
};
THREE
.
Plane
GeometryB
.
prototype
=
Object
.
create
(
THREE
.
BufferGeometry
.
prototype
);
THREE
.
Plane
BufferGeometry
.
prototype
=
Object
.
create
(
THREE
.
BufferGeometry
.
prototype
);
examples/js/wip/PlaneGeometry6.js
0 → 100644
浏览文件 @
10543ca3
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
PlaneGeometry6
=
function
(
width
,
height
,
widthSegments
,
heightSegments
)
{
THREE
.
PlaneBufferGeometry
.
call
(
this
,
width
,
height
,
widthSegments
,
heightSegments
);
var
indices
=
this
.
attributes
.
index
.
array
;
var
vertices
=
this
.
attributes
.
position
.
array
;
var
normals
=
this
.
attributes
.
normal
.
array
;
var
uvs
=
this
.
attributes
.
uv
.
array
;
this
.
indices
=
indices
;
this
.
vertices
=
[];
this
.
normals
=
[];
this
.
uvs
=
[];
for
(
var
i
=
0
,
l
=
vertices
.
length
/
3
;
i
<
l
;
i
++
)
{
this
.
vertices
.
push
(
new
THREE
.
ProxyVector3
(
vertices
,
i
*
3
)
);
this
.
normals
.
push
(
new
THREE
.
ProxyVector3
(
normals
,
i
*
3
)
);
this
.
uvs
.
push
(
new
THREE
.
ProxyVector2
(
uvs
,
i
*
2
)
);
}
};
THREE
.
PlaneGeometry6
.
prototype
=
Object
.
create
(
THREE
.
PlaneBufferGeometry
.
prototype
);
\ No newline at end of file
examples/js/wip/PlaneGeometryB2.js
已删除
100644 → 0
浏览文件 @
a0e73443
/**
* @author mrdoob / http://mrdoob.com/
* based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
*/
THREE
.
PlaneGeometryB2
=
function
(
width
,
height
,
widthSegments
,
heightSegments
)
{
THREE
.
BufferGeometry
.
call
(
this
);
this
.
parameters
=
{
width
:
width
,
height
:
height
,
widthSegments
:
widthSegments
,
heightSegments
:
heightSegments
};
var
width_half
=
width
/
2
;
var
height_half
=
height
/
2
;
var
gridX
=
widthSegments
||
1
;
var
gridY
=
heightSegments
||
1
;
var
gridX1
=
gridX
+
1
;
var
gridY1
=
gridY
+
1
;
var
segment_width
=
width
/
gridX
;
var
segment_height
=
height
/
gridY
;
var
vertices
=
new
Float32Array
(
gridX1
*
gridY1
*
3
);
var
normals
=
new
Float32Array
(
gridX1
*
gridY1
*
3
);
var
uvs
=
new
Float32Array
(
gridX1
*
gridY1
*
2
);
var
offset
=
0
;
var
offset2
=
0
;
for
(
var
iy
=
0
;
iy
<
gridY1
;
iy
++
)
{
var
y
=
iy
*
segment_height
-
height_half
;
for
(
var
ix
=
0
;
ix
<
gridX1
;
ix
++
)
{
var
x
=
ix
*
segment_width
-
width_half
;
vertices
[
offset
]
=
x
;
vertices
[
offset
+
1
]
=
-
y
;
normals
[
offset
+
2
]
=
1
;
uvs
[
offset2
]
=
ix
/
gridX
;
uvs
[
offset2
+
1
]
=
1
-
(
iy
/
gridY
);
offset
+=
3
;
offset2
+=
2
;
}
}
offset
=
0
;
var
indices
=
new
Uint16Array
(
gridX
*
gridY
*
6
);
for
(
var
iy
=
0
;
iy
<
gridY
;
iy
++
)
{
for
(
var
ix
=
0
;
ix
<
gridX
;
ix
++
)
{
var
a
=
ix
+
gridX1
*
iy
;
var
b
=
ix
+
gridX1
*
(
iy
+
1
);
var
c
=
(
ix
+
1
)
+
gridX1
*
(
iy
+
1
);
var
d
=
(
ix
+
1
)
+
gridX1
*
iy
;
indices
[
offset
]
=
a
;
indices
[
offset
+
1
]
=
b
;
indices
[
offset
+
2
]
=
d
;
indices
[
offset
+
3
]
=
b
;
indices
[
offset
+
4
]
=
c
;
indices
[
offset
+
5
]
=
d
;
offset
+=
6
;
}
}
this
.
attributes
[
'
index
'
]
=
{
array
:
indices
,
itemSize
:
1
};
this
.
attributes
[
'
position
'
]
=
{
array
:
vertices
,
itemSize
:
3
};
this
.
attributes
[
'
normal
'
]
=
{
array
:
normals
,
itemSize
:
3
};
this
.
attributes
[
'
uv
'
]
=
{
array
:
uvs
,
itemSize
:
2
};
this
.
vertices
=
[];
this
.
normals
=
[];
this
.
uvs
=
[];
for
(
var
i
=
0
,
l
=
vertices
.
length
/
3
;
i
<
l
;
i
++
)
{
this
.
vertices
.
push
(
new
THREE
.
TypedVector3
(
vertices
,
i
*
3
)
);
this
.
normals
.
push
(
new
THREE
.
TypedVector3
(
normals
,
i
*
3
)
);
this
.
uvs
.
push
(
new
THREE
.
TypedVector2
(
uvs
,
i
*
2
)
);
}
};
THREE
.
PlaneGeometryB2
.
prototype
=
Object
.
create
(
THREE
.
BufferGeometry
.
prototype
);
//
THREE
.
TypedVector2
=
function
(
array
,
offset
)
{
this
.
array
=
array
;
this
.
offset
=
offset
;
};
THREE
.
TypedVector2
.
prototype
=
Object
.
create
(
THREE
.
Vector2
.
prototype
);
Object
.
defineProperties
(
THREE
.
TypedVector2
.
prototype
,
{
'
x
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
]
=
v
;
}
},
'
y
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
+
1
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
+
1
]
=
v
;
}
}
}
);
THREE
.
TypedVector3
=
function
(
array
,
offset
)
{
this
.
array
=
array
;
this
.
offset
=
offset
;
};
THREE
.
TypedVector3
.
prototype
=
Object
.
create
(
THREE
.
Vector3
.
prototype
);
Object
.
defineProperties
(
THREE
.
TypedVector3
.
prototype
,
{
'
x
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
]
=
v
;
}
},
'
y
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
+
1
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
+
1
]
=
v
;
}
},
'
z
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
+
2
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
+
2
]
=
v
;
}
}
}
);
examples/misc_geometry2_sandbox.html
浏览文件 @
10543ca3
...
...
@@ -18,8 +18,6 @@
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/wip/PlaneGeometry.js"
></script>
<script
src=
"js/wip/PlaneGeometryB.js"
></script>
<script
src=
"js/wip/PlaneGeometryB2.js"
></script>
<script
src=
"js/wip/Geometry2.js"
></script>
<script
src=
"js/wip/BoxGeometry2.js"
></script>
...
...
@@ -35,6 +33,9 @@
<script
src=
"js/wip/IndexedGeometry5.js"
></script>
<script
src=
"js/wip/IndexedPlaneGeometry5.js"
></script>
<script
src=
"js/wip/PlaneBufferGeometry.js"
></script>
<script
src=
"js/wip/PlaneGeometry6.js"
></script>
<script
src=
"js/libs/stats.min.js"
></script>
<script>
...
...
@@ -70,8 +71,8 @@
// addGeometries( 'PlaneGeometry2', 'BoxGeometry2', 0 );
// addGeometries( 'PlaneGeometry3', 'BoxGeometry2', 0 );
addGeometries
(
'
PlaneGeometry5
'
,
'
BoxGeometry2
'
,
0
);
addGeometries
(
'
Plane
GeometryB
'
,
'
BoxGeometry2
'
,
0
);
addGeometries
(
'
PlaneGeometry
B2
'
,
'
BoxGeometry2
'
,
0
);
addGeometries
(
'
Plane
BufferGeometry
'
,
'
BoxGeometry2
'
,
0
);
addGeometries
(
'
PlaneGeometry
6
'
,
'
BoxGeometry2
'
,
0
);
//
...
...
src/core/BufferGeometryManipulator.js
浏览文件 @
10543ca3
...
...
@@ -13,9 +13,9 @@ THREE.BufferGeometryManipulator = function ( bufferGeometry ) {
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
this
.
vertices
.
push
(
new
THREE
.
Typed
Vector3
(
attributes
.
position
.
array
,
i
*
3
)
);
this
.
normals
.
push
(
new
THREE
.
Typed
Vector3
(
attributes
.
normal
.
array
,
i
*
3
)
);
this
.
uvs
.
push
(
new
THREE
.
Typed
Vector2
(
attributes
.
uv
.
array
,
i
*
2
)
);
this
.
vertices
.
push
(
new
THREE
.
Proxy
Vector3
(
attributes
.
position
.
array
,
i
*
3
)
);
this
.
normals
.
push
(
new
THREE
.
Proxy
Vector3
(
attributes
.
normal
.
array
,
i
*
3
)
);
this
.
uvs
.
push
(
new
THREE
.
Proxy
Vector2
(
attributes
.
uv
.
array
,
i
*
2
)
);
}
...
...
src/math/
Typed
Vector2.js
→
src/math/
Proxy
Vector2.js
浏览文件 @
10543ca3
...
...
@@ -2,16 +2,16 @@
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
Typed
Vector2
=
function
(
array
,
offset
)
{
THREE
.
Proxy
Vector2
=
function
(
array
,
offset
)
{
this
.
array
=
array
;
this
.
offset
=
offset
;
};
THREE
.
Typed
Vector2
.
prototype
=
Object
.
create
(
THREE
.
Vector2
.
prototype
);
THREE
.
Proxy
Vector2
.
prototype
=
Object
.
create
(
THREE
.
Vector2
.
prototype
);
Object
.
defineProperties
(
THREE
.
Typed
Vector2
.
prototype
,
{
Object
.
defineProperties
(
THREE
.
Proxy
Vector2
.
prototype
,
{
'
x
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
]
=
v
;
}
...
...
src/math/
Typed
Vector3.js
→
src/math/
Proxy
Vector3.js
浏览文件 @
10543ca3
...
...
@@ -2,16 +2,16 @@
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
Typed
Vector3
=
function
(
array
,
offset
)
{
THREE
.
Proxy
Vector3
=
function
(
array
,
offset
)
{
this
.
array
=
array
;
this
.
offset
=
offset
;
};
THREE
.
Typed
Vector3
.
prototype
=
Object
.
create
(
THREE
.
Vector3
.
prototype
);
THREE
.
Proxy
Vector3
.
prototype
=
Object
.
create
(
THREE
.
Vector3
.
prototype
);
Object
.
defineProperties
(
THREE
.
Typed
Vector3
.
prototype
,
{
Object
.
defineProperties
(
THREE
.
Proxy
Vector3
.
prototype
,
{
'
x
'
:
{
get
:
function
()
{
return
this
.
array
[
this
.
offset
];
},
set
:
function
(
v
)
{
this
.
array
[
this
.
offset
]
=
v
;
}
...
...
utils/build/includes/common.json
浏览文件 @
10543ca3
...
...
@@ -5,8 +5,8 @@
"src/math/Vector2.js"
,
"src/math/Vector3.js"
,
"src/math/Vector4.js"
,
"src/math/
Typed
Vector2.js"
,
"src/math/
Typed
Vector3.js"
,
"src/math/
Proxy
Vector2.js"
,
"src/math/
Proxy
Vector3.js"
,
"src/math/Euler.js"
,
"src/math/Line3.js"
,
"src/math/Box2.js"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录