Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
61a407f3
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,发现更多精彩内容 >>
提交
61a407f3
编写于
9月 30, 2011
作者:
Z
zz85
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated Curve.js, Updated builds
上级
c2e0d05e
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
552 addition
and
494 deletion
+552
-494
build/Three.js
build/Three.js
+468
-464
examples/canvas_geometry_subdivison.html
examples/canvas_geometry_subdivison.html
+2
-4
src/core/Geometry.js
src/core/Geometry.js
+4
-23
src/extras/core/Curve.js
src/extras/core/Curve.js
+78
-0
src/extras/geometries/ExtrudeGeometry.js
src/extras/geometries/ExtrudeGeometry.js
+0
-3
未找到文件。
build/Three.js
浏览文件 @
61a407f3
此差异已折叠。
点击以展开。
examples/canvas_geometry_subdivison.html
浏览文件 @
61a407f3
...
...
@@ -106,9 +106,9 @@
//PlaneGeometry not supported
// quick fix for duplicated vertices
// /
geometry.checkDupVertices( true );
geometry
.
checkDupVertices
(
true
);
console
.
log
(
geometry
);
//
console.log(geometry);
smooth
=
createSubdivision
(
geometry
,
2
);
...
...
@@ -131,8 +131,6 @@
context
.
fillText
(
i
,
0
,
0
);
};
...
...
src/core/Geometry.js
浏览文件 @
61a407f3
...
...
@@ -14,7 +14,7 @@ THREE.Geometry = function () {
this
.
faces
=
[];
this
.
edges
=
[];
//
this.edges = [];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
...
...
@@ -487,9 +487,7 @@ THREE.Geometry.prototype = {
// to triangles: a,b,d / b,c,d
// shared edge is: b,d
// should shared edge be included?
// comment out if not
// add edge B-D only if you wish to slice a face4
// hash = edge_hash( face.b, face.d );
// addToMap( vfMap, hash, i );
...
...
@@ -513,6 +511,7 @@ THREE.Geometry.prototype = {
this
.
vfMap
=
vfMap
;
this
.
edges
=
[];
var
numOfEdges
=
0
;
for
(
i
in
vfMap
)
{
...
...
@@ -525,25 +524,7 @@ THREE.Geometry.prototype = {
//console.log('vfMap', vfMap, 'this.edges',this.edges, 'numOfEdges', numOfEdges);
// Not sure what the below does.
// for( i = 0, il = this.edges.length; i < il; i ++ ) {
//
// edge = this.edges[ i ];
//
// v1 = edge.vertexIndices[ 0 ];
// v2 = edge.vertexIndices[ 1 ];
//
// edge.faceIndices = vfMap[ edge_hash( v1, v2 ) ].array;
//
// for( j = 0; j < edge.faceIndices.length; j ++ ) {
//
// faceIndex = edge.faceIndices[ j ];
// edge.faces.push( this.faces[ faceIndex ] );
//
// }
//
// }
return
vfMap
;
},
...
...
src/extras/core/Curve.js
浏览文件 @
61a407f3
...
...
@@ -4,12 +4,19 @@
*
* This file contains following classes:
*
* -- 2d classes --
* THREE.Curve
* THREE.LineCurve
* THREE.QuadraticBezierCurve
* THREE.CubicBezierCurve
* THREE.SplineCurve
* THREE.ArcCurve
*
* -- 3d classes --
* THREE.LineCurve3
* THREE.QuadraticBezierCurve3
* THREE.CubicBezierCurve3
* THREE.SplineCurve3
*
**/
...
...
@@ -660,3 +667,74 @@ THREE.QuadraticBezierCurve3 = THREE.Curve.create(
}
);
/**************************************************************
* Cubic Bezier 3D curve
**************************************************************/
THREE
.
CubicBezierCurve3
=
THREE
.
Curve
.
create
(
function
(
v0
,
v1
,
v2
,
v3
)
{
this
.
v0
=
v0
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v3
=
v3
;
},
function
(
t
)
{
var
tx
,
ty
,
tz
;
tx
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
,
this
.
v3
.
x
);
ty
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
,
this
.
v3
.
y
);
tz
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
this
.
v0
.
z
,
this
.
v1
.
z
,
this
.
v2
.
z
,
this
.
v3
.
z
);
return
new
THREE
.
Vector3
(
tx
,
ty
,
tz
);
}
);
/**************************************************************
* Spline 3D curve
**************************************************************/
THREE
.
SplineCurve3
=
THREE
.
Curve
.
create
(
function
(
points
/* array of Vector3 */
)
{
this
.
points
=
points
;
},
function
(
t
)
{
var
v
=
new
THREE
.
Vector3
();
var
c
=
[];
var
points
=
this
.
points
,
point
,
intPoint
,
weight
;
point
=
(
points
.
length
-
1
)
*
t
;
intPoint
=
Math
.
floor
(
point
);
weight
=
point
-
intPoint
;
c
[
0
]
=
intPoint
==
0
?
intPoint
:
intPoint
-
1
;
c
[
1
]
=
intPoint
;
c
[
2
]
=
intPoint
>
points
.
length
-
2
?
intPoint
:
intPoint
+
1
;
c
[
3
]
=
intPoint
>
points
.
length
-
3
?
intPoint
:
intPoint
+
2
;
v
.
x
=
THREE
.
Curve
.
Utils
.
interpolate
(
points
[
c
[
0
]
].
x
,
points
[
c
[
1
]
].
x
,
points
[
c
[
2
]
].
x
,
points
[
c
[
3
]
].
x
,
weight
);
v
.
y
=
THREE
.
Curve
.
Utils
.
interpolate
(
points
[
c
[
0
]
].
y
,
points
[
c
[
1
]
].
y
,
points
[
c
[
2
]
].
y
,
points
[
c
[
3
]
].
y
,
weight
);
v
.
z
=
THREE
.
Curve
.
Utils
.
interpolate
(
points
[
c
[
0
]
].
z
,
points
[
c
[
1
]
].
z
,
points
[
c
[
2
]
].
z
,
points
[
c
[
3
]
].
z
,
weight
);
return
v
;
}
);
src/extras/geometries/ExtrudeGeometry.js
浏览文件 @
61a407f3
...
...
@@ -54,9 +54,6 @@ THREE.ExtrudeGeometry = function( shapes, options ) {
}
// UVs to be added
// How can we create UVs on this?
this
.
computeCentroids
();
this
.
computeFaceNormals
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录