Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
dff36c0e
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,体验更适合开发者的 AI 搜索 >>
提交
dff36c0e
编写于
10月 15, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Curve.Utils and Shape.Utils to CurveUtils and ShapeUtils.
上级
d0582f17
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
36 addition
and
36 deletion
+36
-36
src/extras/FontUtils.js
src/extras/FontUtils.js
+4
-4
src/extras/core/Path.js
src/extras/core/Path.js
+4
-4
src/extras/curves/ClosedSplineCurve3.js
src/extras/curves/ClosedSplineCurve3.js
+3
-3
src/extras/curves/CubicBezierCurve.js
src/extras/curves/CubicBezierCurve.js
+4
-4
src/extras/curves/CubicBezierCurve3.js
src/extras/curves/CubicBezierCurve3.js
+3
-3
src/extras/curves/QuadraticBezierCurve.js
src/extras/curves/QuadraticBezierCurve.js
+4
-4
src/extras/curves/QuadraticBezierCurve3.js
src/extras/curves/QuadraticBezierCurve3.js
+3
-3
src/extras/curves/SplineCurve.js
src/extras/curves/SplineCurve.js
+2
-2
src/extras/curves/SplineCurve3.js
src/extras/curves/SplineCurve3.js
+3
-3
src/extras/geometries/ExtrudeGeometry.js
src/extras/geometries/ExtrudeGeometry.js
+3
-3
src/extras/geometries/ShapeGeometry.js
src/extras/geometries/ShapeGeometry.js
+3
-3
未找到文件。
src/extras/FontUtils.js
浏览文件 @
dff36c0e
...
...
@@ -174,8 +174,8 @@ THREE.FontUtils = {
for
(
i2
=
1
,
divisions
=
this
.
divisions
;
i2
<=
divisions
;
i2
++
)
{
var
t
=
i2
/
divisions
;
THREE
.
Shape
.
Utils
.
b2
(
t
,
cpx0
,
cpx1
,
cpx
);
THREE
.
Shape
.
Utils
.
b2
(
t
,
cpy0
,
cpy1
,
cpy
);
THREE
.
ShapeUtils
.
b2
(
t
,
cpx0
,
cpx1
,
cpx
);
THREE
.
ShapeUtils
.
b2
(
t
,
cpy0
,
cpy1
,
cpy
);
}
...
...
@@ -206,8 +206,8 @@ THREE.FontUtils = {
for
(
i2
=
1
,
divisions
=
this
.
divisions
;
i2
<=
divisions
;
i2
++
)
{
var
t
=
i2
/
divisions
;
THREE
.
Shape
.
Utils
.
b3
(
t
,
cpx0
,
cpx1
,
cpx2
,
cpx
);
THREE
.
Shape
.
Utils
.
b3
(
t
,
cpy0
,
cpy1
,
cpy2
,
cpy
);
THREE
.
ShapeUtils
.
b3
(
t
,
cpx0
,
cpx1
,
cpx2
,
cpx
);
THREE
.
ShapeUtils
.
b3
(
t
,
cpy0
,
cpy1
,
cpy2
,
cpy
);
}
...
...
src/extras/core/Path.js
浏览文件 @
dff36c0e
...
...
@@ -253,8 +253,8 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
var
t
=
j
/
divisions
;
tx
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
cpx0
,
cpx1
,
cpx
);
ty
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
cpy0
,
cpy1
,
cpy
);
tx
=
THREE
.
ShapeUtils
.
b2
(
t
,
cpx0
,
cpx1
,
cpx
);
ty
=
THREE
.
ShapeUtils
.
b2
(
t
,
cpy0
,
cpy1
,
cpy
);
points
.
push
(
new
THREE
.
Vector2
(
tx
,
ty
)
);
...
...
@@ -591,7 +591,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
}
var
holesFirst
=
!
THREE
.
Shape
.
Utils
.
isClockWise
(
subPaths
[
0
].
getPoints
()
);
var
holesFirst
=
!
THREE
.
ShapeUtils
.
isClockWise
(
subPaths
[
0
].
getPoints
()
);
holesFirst
=
isCCW
?
!
holesFirst
:
holesFirst
;
// console.log("Holes first", holesFirst);
...
...
@@ -609,7 +609,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
tmpPath
=
subPaths
[
i
];
tmpPoints
=
tmpPath
.
getPoints
();
solid
=
THREE
.
Shape
.
Utils
.
isClockWise
(
tmpPoints
);
solid
=
THREE
.
ShapeUtils
.
isClockWise
(
tmpPoints
);
solid
=
isCCW
?
!
solid
:
solid
;
if
(
solid
)
{
...
...
src/extras/curves/ClosedSplineCurve3.js
浏览文件 @
dff36c0e
...
...
@@ -28,9 +28,9 @@ THREE.ClosedSplineCurve3 = THREE.Curve.create(
var
vector
=
new
THREE
.
Vector3
();
vector
.
x
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
x
,
point1
.
x
,
point2
.
x
,
point3
.
x
,
weight
);
vector
.
y
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
y
,
point1
.
y
,
point2
.
y
,
point3
.
y
,
weight
);
vector
.
z
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
z
,
point1
.
z
,
point2
.
z
,
point3
.
z
,
weight
);
vector
.
x
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
x
,
point1
.
x
,
point2
.
x
,
point3
.
x
,
weight
);
vector
.
y
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
y
,
point1
.
y
,
point2
.
y
,
point3
.
y
,
weight
);
vector
.
z
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
z
,
point1
.
z
,
point2
.
z
,
point3
.
z
,
weight
);
return
vector
;
...
...
src/extras/curves/CubicBezierCurve.js
浏览文件 @
dff36c0e
...
...
@@ -18,8 +18,8 @@ THREE.CubicBezierCurve.prototype.getPoint = function ( t ) {
var
tx
,
ty
;
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
);
tx
=
THREE
.
ShapeUtils
.
b3
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
,
this
.
v3
.
x
);
ty
=
THREE
.
ShapeUtils
.
b3
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
,
this
.
v3
.
y
);
return
new
THREE
.
Vector2
(
tx
,
ty
);
...
...
@@ -29,8 +29,8 @@ THREE.CubicBezierCurve.prototype.getTangent = function( t ) {
var
tx
,
ty
;
tx
=
THREE
.
Curve
.
Utils
.
tangentCubicBezier
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
,
this
.
v3
.
x
);
ty
=
THREE
.
Curve
.
Utils
.
tangentCubicBezier
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
,
this
.
v3
.
y
);
tx
=
THREE
.
CurveUtils
.
tangentCubicBezier
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
,
this
.
v3
.
x
);
ty
=
THREE
.
CurveUtils
.
tangentCubicBezier
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
,
this
.
v3
.
y
);
var
tangent
=
new
THREE
.
Vector2
(
tx
,
ty
);
tangent
.
normalize
();
...
...
src/extras/curves/CubicBezierCurve3.js
浏览文件 @
dff36c0e
...
...
@@ -17,9 +17,9 @@ THREE.CubicBezierCurve3 = THREE.Curve.create(
var
vector
=
new
THREE
.
Vector3
();
vector
.
x
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
,
this
.
v3
.
x
);
vector
.
y
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
,
this
.
v3
.
y
);
vector
.
z
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
this
.
v0
.
z
,
this
.
v1
.
z
,
this
.
v2
.
z
,
this
.
v3
.
z
);
vector
.
x
=
THREE
.
ShapeUtils
.
b3
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
,
this
.
v3
.
x
);
vector
.
y
=
THREE
.
ShapeUtils
.
b3
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
,
this
.
v3
.
y
);
vector
.
z
=
THREE
.
ShapeUtils
.
b3
(
t
,
this
.
v0
.
z
,
this
.
v1
.
z
,
this
.
v2
.
z
,
this
.
v3
.
z
);
return
vector
;
...
...
src/extras/curves/QuadraticBezierCurve.js
浏览文件 @
dff36c0e
...
...
@@ -19,8 +19,8 @@ THREE.QuadraticBezierCurve.prototype.getPoint = function ( t ) {
var
vector
=
new
THREE
.
Vector2
();
vector
.
x
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
);
vector
.
y
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
);
vector
.
x
=
THREE
.
ShapeUtils
.
b2
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
);
vector
.
y
=
THREE
.
ShapeUtils
.
b2
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
);
return
vector
;
...
...
@@ -31,8 +31,8 @@ THREE.QuadraticBezierCurve.prototype.getTangent = function( t ) {
var
vector
=
new
THREE
.
Vector2
();
vector
.
x
=
THREE
.
Curve
.
Utils
.
tangentQuadraticBezier
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
);
vector
.
y
=
THREE
.
Curve
.
Utils
.
tangentQuadraticBezier
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
);
vector
.
x
=
THREE
.
CurveUtils
.
tangentQuadraticBezier
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
);
vector
.
y
=
THREE
.
CurveUtils
.
tangentQuadraticBezier
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
);
// returns unit vector
...
...
src/extras/curves/QuadraticBezierCurve3.js
浏览文件 @
dff36c0e
...
...
@@ -16,9 +16,9 @@ THREE.QuadraticBezierCurve3 = THREE.Curve.create(
var
vector
=
new
THREE
.
Vector3
();
vector
.
x
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
);
vector
.
y
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
);
vector
.
z
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
this
.
v0
.
z
,
this
.
v1
.
z
,
this
.
v2
.
z
);
vector
.
x
=
THREE
.
ShapeUtils
.
b2
(
t
,
this
.
v0
.
x
,
this
.
v1
.
x
,
this
.
v2
.
x
);
vector
.
y
=
THREE
.
ShapeUtils
.
b2
(
t
,
this
.
v0
.
y
,
this
.
v1
.
y
,
this
.
v2
.
y
);
vector
.
z
=
THREE
.
ShapeUtils
.
b2
(
t
,
this
.
v0
.
z
,
this
.
v1
.
z
,
this
.
v2
.
z
);
return
vector
;
...
...
src/extras/curves/SplineCurve.js
浏览文件 @
dff36c0e
...
...
@@ -26,8 +26,8 @@ THREE.SplineCurve.prototype.getPoint = function ( t ) {
var
vector
=
new
THREE
.
Vector2
();
vector
.
x
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
x
,
point1
.
x
,
point2
.
x
,
point3
.
x
,
weight
);
vector
.
y
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
y
,
point1
.
y
,
point2
.
y
,
point3
.
y
,
weight
);
vector
.
x
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
x
,
point1
.
x
,
point2
.
x
,
point3
.
x
,
weight
);
vector
.
y
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
y
,
point1
.
y
,
point2
.
y
,
point3
.
y
,
weight
);
return
vector
;
...
...
src/extras/curves/SplineCurve3.js
浏览文件 @
dff36c0e
...
...
@@ -27,9 +27,9 @@ THREE.SplineCurve3 = THREE.Curve.create(
var
vector
=
new
THREE
.
Vector3
();
vector
.
x
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
x
,
point1
.
x
,
point2
.
x
,
point3
.
x
,
weight
);
vector
.
y
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
y
,
point1
.
y
,
point2
.
y
,
point3
.
y
,
weight
);
vector
.
z
=
THREE
.
Curve
.
Utils
.
interpolate
(
point0
.
z
,
point1
.
z
,
point2
.
z
,
point3
.
z
,
weight
);
vector
.
x
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
x
,
point1
.
x
,
point2
.
x
,
point3
.
x
,
weight
);
vector
.
y
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
y
,
point1
.
y
,
point2
.
y
,
point3
.
y
,
weight
);
vector
.
z
=
THREE
.
CurveUtils
.
interpolate
(
point0
.
z
,
point1
.
z
,
point2
.
z
,
point3
.
z
,
weight
);
return
vector
;
...
...
src/extras/geometries/ExtrudeGeometry.js
浏览文件 @
dff36c0e
...
...
@@ -135,7 +135,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
var
vertices
=
shapePoints
.
shape
;
var
holes
=
shapePoints
.
holes
;
var
reverse
=
!
THREE
.
Shape
.
Utils
.
isClockWise
(
vertices
);
var
reverse
=
!
THREE
.
ShapeUtils
.
isClockWise
(
vertices
);
if
(
reverse
)
{
...
...
@@ -147,7 +147,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
ahole
=
holes
[
h
];
if
(
THREE
.
Shape
.
Utils
.
isClockWise
(
ahole
)
)
{
if
(
THREE
.
ShapeUtils
.
isClockWise
(
ahole
)
)
{
holes
[
h
]
=
ahole
.
reverse
();
...
...
@@ -160,7 +160,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
}
var
faces
=
THREE
.
Shape
.
Utils
.
triangulateShape
(
vertices
,
holes
);
var
faces
=
THREE
.
Shape
Utils
.
triangulateShape
(
vertices
,
holes
);
/* Vertices */
...
...
src/extras/geometries/ShapeGeometry.js
浏览文件 @
dff36c0e
...
...
@@ -67,7 +67,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
var
vertices
=
shapePoints
.
shape
;
var
holes
=
shapePoints
.
holes
;
var
reverse
=
!
THREE
.
Shape
.
Utils
.
isClockWise
(
vertices
);
var
reverse
=
!
THREE
.
ShapeUtils
.
isClockWise
(
vertices
);
if
(
reverse
)
{
...
...
@@ -79,7 +79,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
hole
=
holes
[
i
];
if
(
THREE
.
Shape
.
Utils
.
isClockWise
(
hole
)
)
{
if
(
THREE
.
ShapeUtils
.
isClockWise
(
hole
)
)
{
holes
[
i
]
=
hole
.
reverse
();
...
...
@@ -91,7 +91,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
}
var
faces
=
THREE
.
Shape
.
Utils
.
triangulateShape
(
vertices
,
holes
);
var
faces
=
THREE
.
ShapeUtils
.
triangulateShape
(
vertices
,
holes
);
// Vertices
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录