Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4ce780c4
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
4ce780c4
编写于
10月 17, 2017
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Curves: Added type property
上级
458d7845
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
43 addition
and
10 deletion
+43
-10
docs/api/extras/curves/CatmullRomCurve3.html
docs/api/extras/curves/CatmullRomCurve3.html
+1
-1
examples/webgl_geometry_extrude_shapes.html
examples/webgl_geometry_extrude_shapes.html
+1
-1
examples/webgl_geometry_extrude_splines.html
examples/webgl_geometry_extrude_splines.html
+1
-1
examples/webgl_geometry_spline_editor.html
examples/webgl_geometry_spline_editor.html
+3
-3
src/extras/core/Curve.js
src/extras/core/Curve.js
+2
-0
src/extras/core/CurvePath.js
src/extras/core/CurvePath.js
+2
-1
src/extras/core/Font.js
src/extras/core/Font.js
+2
-0
src/extras/core/Path.js
src/extras/core/Path.js
+3
-0
src/extras/core/Shape.js
src/extras/core/Shape.js
+2
-0
src/extras/core/ShapePath.js
src/extras/core/ShapePath.js
+2
-0
src/extras/curves/ArcCurve.js
src/extras/curves/ArcCurve.js
+2
-0
src/extras/curves/CatmullRomCurve3.js
src/extras/curves/CatmullRomCurve3.js
+6
-3
src/extras/curves/CubicBezierCurve.js
src/extras/curves/CubicBezierCurve.js
+2
-0
src/extras/curves/CubicBezierCurve3.js
src/extras/curves/CubicBezierCurve3.js
+2
-0
src/extras/curves/EllipseCurve.js
src/extras/curves/EllipseCurve.js
+2
-0
src/extras/curves/LineCurve.js
src/extras/curves/LineCurve.js
+2
-0
src/extras/curves/LineCurve3.js
src/extras/curves/LineCurve3.js
+2
-0
src/extras/curves/QuadraticBezierCurve.js
src/extras/curves/QuadraticBezierCurve.js
+2
-0
src/extras/curves/QuadraticBezierCurve3.js
src/extras/curves/QuadraticBezierCurve3.js
+2
-0
src/extras/curves/SplineCurve.js
src/extras/curves/SplineCurve.js
+2
-0
未找到文件。
docs/api/extras/curves/CatmullRomCurve3.html
浏览文件 @
4ce780c4
...
@@ -63,7 +63,7 @@ var curveObject = new THREE.Line( geometry, material );
...
@@ -63,7 +63,7 @@ var curveObject = new THREE.Line( geometry, material );
<h3>
[property:Boolean closed]
</h3>
<h3>
[property:Boolean closed]
</h3>
<div>
The curve will loop back onto itself when this is true. False by default
</div>
<div>
The curve will loop back onto itself when this is true. False by default
</div>
<h3>
[property:String
t
ype]
</h3>
<h3>
[property:String
cureT
ype]
</h3>
<div>
Possible values are `centripetal` (default), `chordal` and `catmullrom`.
</div>
<div>
Possible values are `centripetal` (default), `chordal` and `catmullrom`.
</div>
<h3>
[property:float tension]
</h3>
<h3>
[property:float tension]
</h3>
...
...
examples/webgl_geometry_extrude_shapes.html
浏览文件 @
4ce780c4
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
new
THREE
.
Vector3
(
60
,
-
100
,
-
60
)
new
THREE
.
Vector3
(
60
,
-
100
,
-
60
)
]
);
]
);
closedSpline
.
t
ype
=
'
catmullrom
'
;
closedSpline
.
curveT
ype
=
'
catmullrom
'
;
closedSpline
.
closed
=
true
;
closedSpline
.
closed
=
true
;
var
extrudeSettings
=
{
var
extrudeSettings
=
{
...
...
examples/webgl_geometry_extrude_splines.html
浏览文件 @
4ce780c4
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
new
THREE
.
Vector3
(
0
,
-
40
,
40
)
new
THREE
.
Vector3
(
0
,
-
40
,
40
)
]
);
]
);
sampleClosedSpline
.
t
ype
=
'
catmullrom
'
;
sampleClosedSpline
.
curveT
ype
=
'
catmullrom
'
;
sampleClosedSpline
.
closed
=
true
;
sampleClosedSpline
.
closed
=
true
;
// Keep a dictionary of Curve instances
// Keep a dictionary of Curve instances
...
...
examples/webgl_geometry_spline_editor.html
浏览文件 @
4ce780c4
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
}
}
var
curve
=
new
THREE
.
CatmullRomCurve3
(
positions
);
var
curve
=
new
THREE
.
CatmullRomCurve3
(
positions
);
curve
.
t
ype
=
'
catmullrom
'
;
curve
.
curveT
ype
=
'
catmullrom
'
;
curve
.
mesh
=
new
THREE
.
Line
(
geometry
.
clone
(),
new
THREE
.
LineBasicMaterial
(
{
curve
.
mesh
=
new
THREE
.
Line
(
geometry
.
clone
(),
new
THREE
.
LineBasicMaterial
(
{
color
:
0xff0000
,
color
:
0xff0000
,
opacity
:
0.35
,
opacity
:
0.35
,
...
@@ -268,7 +268,7 @@
...
@@ -268,7 +268,7 @@
splines
.
uniform
=
curve
;
splines
.
uniform
=
curve
;
curve
=
new
THREE
.
CatmullRomCurve3
(
positions
);
curve
=
new
THREE
.
CatmullRomCurve3
(
positions
);
curve
.
t
ype
=
'
centripetal
'
;
curve
.
curveT
ype
=
'
centripetal
'
;
curve
.
mesh
=
new
THREE
.
Line
(
geometry
.
clone
(),
new
THREE
.
LineBasicMaterial
(
{
curve
.
mesh
=
new
THREE
.
Line
(
geometry
.
clone
(),
new
THREE
.
LineBasicMaterial
(
{
color
:
0x00ff00
,
color
:
0x00ff00
,
opacity
:
0.35
,
opacity
:
0.35
,
...
@@ -278,7 +278,7 @@
...
@@ -278,7 +278,7 @@
splines
.
centripetal
=
curve
;
splines
.
centripetal
=
curve
;
curve
=
new
THREE
.
CatmullRomCurve3
(
positions
);
curve
=
new
THREE
.
CatmullRomCurve3
(
positions
);
curve
.
t
ype
=
'
chordal
'
;
curve
.
curveT
ype
=
'
chordal
'
;
curve
.
mesh
=
new
THREE
.
Line
(
geometry
.
clone
(),
new
THREE
.
LineBasicMaterial
(
{
curve
.
mesh
=
new
THREE
.
Line
(
geometry
.
clone
(),
new
THREE
.
LineBasicMaterial
(
{
color
:
0x0000ff
,
color
:
0x0000ff
,
opacity
:
0.35
,
opacity
:
0.35
,
...
...
src/extras/core/Curve.js
浏览文件 @
4ce780c4
...
@@ -39,6 +39,8 @@ import { Matrix4 } from '../../math/Matrix4.js';
...
@@ -39,6 +39,8 @@ import { Matrix4 } from '../../math/Matrix4.js';
function
Curve
()
{
function
Curve
()
{
this
.
type
=
'
Curve
'
;
this
.
arcLengthDivisions
=
200
;
this
.
arcLengthDivisions
=
200
;
}
}
...
...
src/extras/core/CurvePath.js
浏览文件 @
4ce780c4
...
@@ -17,8 +17,9 @@ function CurvePath() {
...
@@ -17,8 +17,9 @@ function CurvePath() {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
curves
=
[]
;
this
.
type
=
'
CurvePath
'
;
this
.
curves
=
[];
this
.
autoClose
=
false
;
// Automatically closes the path
this
.
autoClose
=
false
;
// Automatically closes the path
}
}
...
...
src/extras/core/Font.js
浏览文件 @
4ce780c4
...
@@ -9,6 +9,8 @@ import { ShapePath } from './ShapePath.js';
...
@@ -9,6 +9,8 @@ import { ShapePath } from './ShapePath.js';
function
Font
(
data
)
{
function
Font
(
data
)
{
this
.
type
=
'
Font
'
;
this
.
data
=
data
;
this
.
data
=
data
;
}
}
...
...
src/extras/core/Path.js
浏览文件 @
4ce780c4
...
@@ -11,6 +11,9 @@ import { CurvePath } from './CurvePath.js';
...
@@ -11,6 +11,9 @@ import { CurvePath } from './CurvePath.js';
function
Path
(
points
)
{
function
Path
(
points
)
{
CurvePath
.
call
(
this
);
CurvePath
.
call
(
this
);
this
.
type
=
'
Path
'
;
this
.
currentPoint
=
new
Vector2
();
this
.
currentPoint
=
new
Vector2
();
if
(
points
)
{
if
(
points
)
{
...
...
src/extras/core/Shape.js
浏览文件 @
4ce780c4
...
@@ -16,6 +16,8 @@ function Shape() {
...
@@ -16,6 +16,8 @@ function Shape() {
Path
.
apply
(
this
,
arguments
);
Path
.
apply
(
this
,
arguments
);
this
.
type
=
'
Shape
'
;
this
.
holes
=
[];
this
.
holes
=
[];
}
}
...
...
src/extras/core/ShapePath.js
浏览文件 @
4ce780c4
...
@@ -9,6 +9,8 @@ import { ShapeUtils } from '../ShapeUtils.js';
...
@@ -9,6 +9,8 @@ import { ShapeUtils } from '../ShapeUtils.js';
function
ShapePath
()
{
function
ShapePath
()
{
this
.
type
=
'
ShapePath
'
;
this
.
subPaths
=
[];
this
.
subPaths
=
[];
this
.
currentPath
=
null
;
this
.
currentPath
=
null
;
...
...
src/extras/curves/ArcCurve.js
浏览文件 @
4ce780c4
...
@@ -5,6 +5,8 @@ function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {
...
@@ -5,6 +5,8 @@ function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {
EllipseCurve
.
call
(
this
,
aX
,
aY
,
aRadius
,
aRadius
,
aStartAngle
,
aEndAngle
,
aClockwise
);
EllipseCurve
.
call
(
this
,
aX
,
aY
,
aRadius
,
aRadius
,
aStartAngle
,
aEndAngle
,
aClockwise
);
this
.
type
=
'
ArcCurve
'
;
}
}
ArcCurve
.
prototype
=
Object
.
create
(
EllipseCurve
.
prototype
);
ArcCurve
.
prototype
=
Object
.
create
(
EllipseCurve
.
prototype
);
...
...
src/extras/curves/CatmullRomCurve3.js
浏览文件 @
4ce780c4
...
@@ -87,10 +87,13 @@ function CatmullRomCurve3( points ) {
...
@@ -87,10 +87,13 @@ function CatmullRomCurve3( points ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
CatmullRomCurve3
'
;
if
(
points
.
length
<
2
)
console
.
warn
(
'
THREE.CatmullRomCurve3: Points array needs at least two entries.
'
);
if
(
points
.
length
<
2
)
console
.
warn
(
'
THREE.CatmullRomCurve3: Points array needs at least two entries.
'
);
this
.
points
=
points
||
[];
this
.
points
=
points
||
[];
this
.
closed
=
false
;
this
.
closed
=
false
;
this
.
curveType
=
'
centripetal
'
;
}
}
...
@@ -150,10 +153,10 @@ CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
...
@@ -150,10 +153,10 @@ CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
}
}
if
(
this
.
type
===
undefined
||
this
.
type
===
'
centripetal
'
||
this
.
t
ype
===
'
chordal
'
)
{
if
(
this
.
curveType
===
'
centripetal
'
||
this
.
curveT
ype
===
'
chordal
'
)
{
// init Centripetal / Chordal Catmull-Rom
// init Centripetal / Chordal Catmull-Rom
var
pow
=
this
.
t
ype
===
'
chordal
'
?
0.5
:
0.25
;
var
pow
=
this
.
curveT
ype
===
'
chordal
'
?
0.5
:
0.25
;
var
dt0
=
Math
.
pow
(
p0
.
distanceToSquared
(
p1
),
pow
);
var
dt0
=
Math
.
pow
(
p0
.
distanceToSquared
(
p1
),
pow
);
var
dt1
=
Math
.
pow
(
p1
.
distanceToSquared
(
p2
),
pow
);
var
dt1
=
Math
.
pow
(
p1
.
distanceToSquared
(
p2
),
pow
);
var
dt2
=
Math
.
pow
(
p2
.
distanceToSquared
(
p3
),
pow
);
var
dt2
=
Math
.
pow
(
p2
.
distanceToSquared
(
p3
),
pow
);
...
@@ -167,7 +170,7 @@ CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
...
@@ -167,7 +170,7 @@ CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) {
py
.
initNonuniformCatmullRom
(
p0
.
y
,
p1
.
y
,
p2
.
y
,
p3
.
y
,
dt0
,
dt1
,
dt2
);
py
.
initNonuniformCatmullRom
(
p0
.
y
,
p1
.
y
,
p2
.
y
,
p3
.
y
,
dt0
,
dt1
,
dt2
);
pz
.
initNonuniformCatmullRom
(
p0
.
z
,
p1
.
z
,
p2
.
z
,
p3
.
z
,
dt0
,
dt1
,
dt2
);
pz
.
initNonuniformCatmullRom
(
p0
.
z
,
p1
.
z
,
p2
.
z
,
p3
.
z
,
dt0
,
dt1
,
dt2
);
}
else
if
(
this
.
t
ype
===
'
catmullrom
'
)
{
}
else
if
(
this
.
curveT
ype
===
'
catmullrom
'
)
{
var
tension
=
this
.
tension
!==
undefined
?
this
.
tension
:
0.5
;
var
tension
=
this
.
tension
!==
undefined
?
this
.
tension
:
0.5
;
px
.
initCatmullRom
(
p0
.
x
,
p1
.
x
,
p2
.
x
,
p3
.
x
,
tension
);
px
.
initCatmullRom
(
p0
.
x
,
p1
.
x
,
p2
.
x
,
p3
.
x
,
tension
);
...
...
src/extras/curves/CubicBezierCurve.js
浏览文件 @
4ce780c4
...
@@ -7,6 +7,8 @@ function CubicBezierCurve( v0, v1, v2, v3 ) {
...
@@ -7,6 +7,8 @@ function CubicBezierCurve( v0, v1, v2, v3 ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
CubicBezierCurve
'
;
this
.
v0
=
v0
;
this
.
v0
=
v0
;
this
.
v1
=
v1
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v2
=
v2
;
...
...
src/extras/curves/CubicBezierCurve3.js
浏览文件 @
4ce780c4
...
@@ -7,6 +7,8 @@ function CubicBezierCurve3( v0, v1, v2, v3 ) {
...
@@ -7,6 +7,8 @@ function CubicBezierCurve3( v0, v1, v2, v3 ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
CubicBezierCurve3
'
;
this
.
v0
=
v0
;
this
.
v0
=
v0
;
this
.
v1
=
v1
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v2
=
v2
;
...
...
src/extras/curves/EllipseCurve.js
浏览文件 @
4ce780c4
...
@@ -6,6 +6,8 @@ function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockw
...
@@ -6,6 +6,8 @@ function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockw
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
EllipseCurve
'
;
this
.
aX
=
aX
;
this
.
aX
=
aX
;
this
.
aY
=
aY
;
this
.
aY
=
aY
;
...
...
src/extras/curves/LineCurve.js
浏览文件 @
4ce780c4
...
@@ -6,6 +6,8 @@ function LineCurve( v1, v2 ) {
...
@@ -6,6 +6,8 @@ function LineCurve( v1, v2 ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
LineCurve
'
;
this
.
v1
=
v1
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v2
=
v2
;
...
...
src/extras/curves/LineCurve3.js
浏览文件 @
4ce780c4
...
@@ -6,6 +6,8 @@ function LineCurve3( v1, v2 ) {
...
@@ -6,6 +6,8 @@ function LineCurve3( v1, v2 ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
LineCurve3
'
;
this
.
v1
=
v1
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v2
=
v2
;
...
...
src/extras/curves/QuadraticBezierCurve.js
浏览文件 @
4ce780c4
...
@@ -7,6 +7,8 @@ function QuadraticBezierCurve( v0, v1, v2 ) {
...
@@ -7,6 +7,8 @@ function QuadraticBezierCurve( v0, v1, v2 ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
QuadraticBezierCurve
'
;
this
.
v0
=
v0
;
this
.
v0
=
v0
;
this
.
v1
=
v1
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v2
=
v2
;
...
...
src/extras/curves/QuadraticBezierCurve3.js
浏览文件 @
4ce780c4
...
@@ -7,6 +7,8 @@ function QuadraticBezierCurve3( v0, v1, v2 ) {
...
@@ -7,6 +7,8 @@ function QuadraticBezierCurve3( v0, v1, v2 ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
QuadraticBezierCurve3
'
;
this
.
v0
=
v0
;
this
.
v0
=
v0
;
this
.
v1
=
v1
;
this
.
v1
=
v1
;
this
.
v2
=
v2
;
this
.
v2
=
v2
;
...
...
src/extras/curves/SplineCurve.js
浏览文件 @
4ce780c4
...
@@ -7,6 +7,8 @@ function SplineCurve( points /* array of Vector2 */ ) {
...
@@ -7,6 +7,8 @@ function SplineCurve( points /* array of Vector2 */ ) {
Curve
.
call
(
this
);
Curve
.
call
(
this
);
this
.
type
=
'
SplineCurve
'
;
this
.
points
=
(
points
===
undefined
)
?
[]
:
points
;
this
.
points
=
(
points
===
undefined
)
?
[]
:
points
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录