Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
a9cc8bce
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,发现更多精彩内容 >>
提交
a9cc8bce
编写于
10月 28, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Applied manually fixes from @broady to 'dev' branch.
https://github.com/mrdoob/three.js/pull/689
上级
c9290555
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
992 addition
and
991 deletion
+992
-991
build/Three.js
build/Three.js
+514
-519
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+270
-271
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+160
-161
src/core/Spline.js
src/core/Spline.js
+2
-2
src/extras/controls/PathControls.js
src/extras/controls/PathControls.js
+3
-3
src/extras/core/Curve.js
src/extras/core/Curve.js
+4
-4
src/extras/geometries/ExtrudeGeometry.js
src/extras/geometries/ExtrudeGeometry.js
+3
-3
src/extras/geometries/TextGeometry.js
src/extras/geometries/TextGeometry.js
+6
-6
src/extras/loaders/ColladaLoader.js
src/extras/loaders/ColladaLoader.js
+12
-11
src/extras/loaders/SceneLoader.js
src/extras/loaders/SceneLoader.js
+3
-1
src/extras/objects/MarchingCubes.js
src/extras/objects/MarchingCubes.js
+2
-2
src/extras/renderers/AnaglyphWebGLRenderer.js
src/extras/renderers/AnaglyphWebGLRenderer.js
+1
-1
src/extras/renderers/ParallaxBarrierWebGLRenderer.js
src/extras/renderers/ParallaxBarrierWebGLRenderer.js
+1
-1
src/objects/SkinnedMesh.js
src/objects/SkinnedMesh.js
+2
-2
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+8
-3
src/renderers/WebGLShaders.js
src/renderers/WebGLShaders.js
+1
-1
未找到文件。
build/Three.js
浏览文件 @
a9cc8bce
此差异已折叠。
点击以展开。
build/custom/ThreeExtras.js
浏览文件 @
a9cc8bce
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeWebGL.js
浏览文件 @
a9cc8bce
此差异已折叠。
点击以展开。
src/core/Spline.js
浏览文件 @
a9cc8bce
...
...
@@ -73,7 +73,7 @@ THREE.Spline = function ( points ) {
this
.
getLength
=
function
(
nSubDivisions
)
{
var
i
,
index
,
nSamples
,
var
i
,
index
,
nSamples
,
position
,
point
=
0
,
intPoint
=
0
,
oldIntPoint
=
0
,
oldPosition
=
new
THREE
.
Vector3
(),
tmpVec
=
new
THREE
.
Vector3
(),
...
...
@@ -126,7 +126,7 @@ THREE.Spline = function ( points ) {
var
i
,
j
,
index
,
indexCurrent
,
indexNext
,
linearDistance
,
realDistance
,
sampling
,
sampling
,
position
,
newpoints
=
[],
tmpVec
=
new
THREE
.
Vector3
(),
sl
=
this
.
getLength
();
...
...
src/extras/controls/PathControls.js
浏览文件 @
a9cc8bce
...
...
@@ -233,8 +233,8 @@ THREE.PathControls = function ( object, domElement ) {
var
lineGeo
=
createSplineGeometry
(
spline
,
10
),
particleGeo
=
createSplineGeometry
(
spline
,
10
),
lineMat
=
new
THREE
.
LineBasicMaterial
(
{
color
:
0xff0000
,
linewidth
:
3
}
)
;
lineObj
=
new
THREE
.
Line
(
lineGeo
,
lineMat
)
;
lineMat
=
new
THREE
.
LineBasicMaterial
(
{
color
:
0xff0000
,
linewidth
:
3
}
)
,
lineObj
=
new
THREE
.
Line
(
lineGeo
,
lineMat
)
,
particleObj
=
new
THREE
.
ParticleSystem
(
particleGeo
,
new
THREE
.
ParticleBasicMaterial
(
{
color
:
0xffaa00
,
size
:
3
}
)
);
lineObj
.
scale
.
set
(
1
,
1
,
1
);
...
...
@@ -247,7 +247,7 @@ THREE.PathControls = function ( object, domElement ) {
geo
=
new
THREE
.
SphereGeometry
(
1
,
16
,
8
),
mat
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x00ff00
}
);
for
(
i
=
0
;
i
<
spline
.
points
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
spline
.
points
.
length
;
i
++
)
{
waypoint
=
new
THREE
.
Mesh
(
geo
,
mat
);
waypoint
.
position
.
copy
(
spline
.
points
[
i
]
);
...
...
src/extras/core/Curve.js
浏览文件 @
a9cc8bce
...
...
@@ -11,7 +11,7 @@
* THREE.CubicBezierCurve
* THREE.SplineCurve
* THREE.ArcCurve
*
*
* -- 3d classes --
* THREE.LineCurve3
* THREE.QuadraticBezierCurve3
...
...
@@ -160,7 +160,7 @@ THREE.Curve.prototype.getUtoTmapping = function ( u, distance ) {
// i--;
// console.log('o' , i, Date.now()- time);
time
=
Date
.
now
();
var
time
=
Date
.
now
();
// binary search for the index with largest value smaller than target u distance
...
...
@@ -629,7 +629,7 @@ THREE.LineCurve3 = THREE.Curve.create(
var
r
=
new
THREE
.
Vector3
();
r
.
sub
(
v2
,
v1
);
// diff
r
.
sub
(
this
.
v2
,
this
.
v1
);
// diff
r
.
multiplyScalar
(
t
);
r
.
addSelf
(
this
.
v1
);
...
...
@@ -711,7 +711,7 @@ THREE.SplineCurve3 = THREE.Curve.create(
function
(
points
/* array of Vector3 */
)
{
this
.
points
=
points
;
},
function
(
t
)
{
...
...
src/extras/geometries/ExtrudeGeometry.js
浏览文件 @
a9cc8bce
...
...
@@ -245,7 +245,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
}
anglec
=
(
anglea
+
angleb
)
/
2
;
var
anglec
=
(
anglea
+
angleb
)
/
2
;
//console.log('angle1', anglea * RAD_TO_DEGREES,'angle2', angleb * RAD_TO_DEGREES, 'anglec', anglec *RAD_TO_DEGREES);
...
...
@@ -684,7 +684,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
new
THREE
.
UV
(
ax
/
ux
,
ay
/
uy
),
new
THREE
.
UV
(
bx
/
ux
,
by
/
uy
),
new
THREE
.
UV
(
cx
/
ux
,
cy
/
uy
)
,
new
THREE
.
UV
(
cx
/
ux
,
cy
/
uy
)
]
);
}
...
...
@@ -710,4 +710,4 @@ THREE.ExtrudeGeometry.__v2 = new THREE.Vector2();
THREE
.
ExtrudeGeometry
.
__v3
=
new
THREE
.
Vector2
();
THREE
.
ExtrudeGeometry
.
__v4
=
new
THREE
.
Vector2
();
THREE
.
ExtrudeGeometry
.
__v5
=
new
THREE
.
Vector2
();
THREE
.
ExtrudeGeometry
.
__v6
=
new
THREE
.
Vector2
();
\ No newline at end of file
THREE
.
ExtrudeGeometry
.
__v6
=
new
THREE
.
Vector2
();
src/extras/geometries/TextGeometry.js
浏览文件 @
a9cc8bce
...
...
@@ -126,7 +126,7 @@ THREE.TextGeometry.prototype.constructor = THREE.TextGeometry;
// Complete manner
var textPath = new TextPath( text, options );
var textPath = new T
HREE.T
extPath( text, options );
var textShapes = textPath.toShapes();
var text3d = new ExtrudeGeometry( textShapes, options );
...
...
@@ -158,7 +158,7 @@ THREE.FontUtils = {
getTextShapes
:
function
(
text
,
options
)
{
var
textPath
=
new
TextPath
(
text
,
options
);
var
textPath
=
new
T
HREE
.
T
extPath
(
text
,
options
);
var
textShapes
=
textPath
.
toShapes
();
return
textShapes
;
...
...
@@ -235,12 +235,12 @@ THREE.FontUtils = {
var
pts
=
[];
var
i
,
i2
,
var
i
,
i2
,
divisions
,
outline
,
action
,
length
,
scaleX
,
scaleY
,
x
,
y
,
cpx
,
cpy
,
cpx0
,
cpy0
,
cpx1
,
cpy1
,
cpx2
,
cpy2
,
laste
,
glyph
=
face
.
glyphs
[
c
]
||
face
.
glyphs
[
ctxt
.
options
.
fallbackCharacter
];
glyph
=
face
.
glyphs
[
c
]
||
face
.
glyphs
[
'
?
'
];
if
(
!
glyph
)
return
;
...
...
@@ -300,7 +300,7 @@ THREE.FontUtils = {
cpx0
=
laste
.
x
;
cpy0
=
laste
.
y
;
for
(
i2
=
1
,
divisions
=
this
.
divisions
;
i2
<=
divisions
;
i2
++
)
{
for
(
i2
=
1
,
divisions
=
this
.
divisions
;
i2
<=
divisions
;
i2
++
)
{
var
t
=
i2
/
divisions
;
var
tx
=
THREE
.
Shape
.
Utils
.
b2
(
t
,
cpx0
,
cpx1
,
cpx
);
...
...
@@ -333,7 +333,7 @@ THREE.FontUtils = {
cpx0
=
laste
.
x
;
cpy0
=
laste
.
y
;
for
(
i2
=
1
,
divisions
=
this
.
divisions
;
i2
<=
divisions
;
i2
++
)
{
for
(
i2
=
1
,
divisions
=
this
.
divisions
;
i2
<=
divisions
;
i2
++
)
{
var
t
=
i2
/
divisions
;
var
tx
=
THREE
.
Shape
.
Utils
.
b3
(
t
,
cpx0
,
cpx1
,
cpx2
,
cpx
);
...
...
src/extras/loaders/ColladaLoader.js
浏览文件 @
a9cc8bce
...
...
@@ -301,8 +301,8 @@ THREE.ColladaLoader = function () {
geometry
.
skinWeights
=
[];
geometry
.
skinIndices
=
[];
createBones
(
geometry
.
bones
,
skin
,
hierarchy
,
skeleton
,
null
,
-
1
);
createWeights
(
skin
,
geometry
.
bones
,
geometry
.
skinIndices
,
geometry
.
skinWeights
);
//
createBones( geometry.bones, skin, hierarchy, skeleton, null, -1 );
//
createWeights( skin, geometry.bones, geometry.skinIndices, geometry.skinWeights );
/*
geometry.animation = {
...
...
@@ -515,7 +515,7 @@ THREE.ColladaLoader = function () {
var
skinned
=
false
;
var
skinController
;
var
morphController
;
var
i
;
var
i
,
j
;
// FIXME: controllers
...
...
@@ -764,15 +764,15 @@ THREE.ColladaLoader = function () {
var
minT
=
10000000
;
for
(
i
=
0
;
i
<
node
.
channels
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
channels
.
length
;
i
++
)
{
var
sampler
=
node
.
channels
[
i
].
sampler
;
for
(
var
j
=
0
;
j
<
sampler
.
input
.
length
-
1
;
j
++
)
{
var
t0
=
sampler
.
input
[
j
];
var
t1
=
sampler
.
input
[
j
+
1
];
minT
=
Math
.
min
(
minT
,
t1
-
t0
);
var
t0
=
sampler
.
input
[
j
];
var
t1
=
sampler
.
input
[
j
+
1
];
minT
=
Math
.
min
(
minT
,
t1
-
t0
);
}
}
...
...
@@ -1845,7 +1845,7 @@ THREE.ColladaLoader = function () {
for
(
i
=
0
;
i
<
this
.
primitives
.
length
;
i
++
)
{
primitive
=
this
.
primitives
[
i
];
var
primitive
=
this
.
primitives
[
i
];
primitive
.
setVertices
(
this
.
vertices
);
this
.
handlePrimitive
(
primitive
,
this
.
geometry3js
,
vertex_store
);
...
...
@@ -1864,6 +1864,7 @@ THREE.ColladaLoader = function () {
var
i
=
0
,
j
,
k
,
p
=
primitive
.
p
,
inputs
=
primitive
.
inputs
;
var
input
,
index
,
idx32
;
var
source
,
numParams
;
var
vcIndex
=
0
,
vcount
=
3
;
var
texture_sets
=
[];
...
...
@@ -1954,7 +1955,7 @@ THREE.ColladaLoader = function () {
face
=
new
THREE
.
Face4
(
vs
[
0
],
vs
[
1
],
vs
[
2
],
vs
[
3
],
[
ns
[
0
],
ns
[
1
],
ns
[
2
],
ns
[
3
]
],
cs
.
length
?
cs
:
new
THREE
.
Color
()
);
}
face
.
daeMaterial
=
primitive
.
material
;
geom
.
faces
.
push
(
face
);
...
...
@@ -2090,8 +2091,8 @@ THREE.ColladaLoader = function () {
if
(
element
.
childNodes
[
i
].
nodeName
==
'
input
'
)
{
input
=
(
new
Input
()).
parse
(
element
.
childNodes
[
i
]
);
this
.
input
[
input
.
semantic
]
=
input
;
var
input
=
(
new
Input
()
).
parse
(
element
.
childNodes
[
i
]
);
this
.
input
[
input
.
semantic
]
=
input
;
}
...
...
src/extras/loaders/SceneLoader.js
浏览文件 @
a9cc8bce
...
...
@@ -27,7 +27,7 @@ THREE.SceneLoader.prototype = {
worker
.
onmessage
=
function
(
event
)
{
var
dg
,
dm
,
dd
,
dl
,
dc
,
df
,
dt
,
g
,
o
,
m
,
l
,
p
,
c
,
t
,
f
,
tt
,
pp
,
g
,
o
,
m
,
l
,
d
,
p
,
r
,
q
,
s
,
c
,
t
,
f
,
tt
,
pp
,
geometry
,
material
,
camera
,
fog
,
texture
,
images
,
materials
,
light
,
...
...
@@ -118,6 +118,8 @@ THREE.SceneLoader.prototype = {
function
handle_objects
()
{
var
object
;
for
(
dd
in
data
.
objects
)
{
if
(
!
result
.
objects
[
dd
]
)
{
...
...
src/extras/objects/MarchingCubes.js
浏览文件 @
a9cc8bce
...
...
@@ -505,7 +505,7 @@ THREE.MarchingCubes = function ( resolution, materials ) {
this
.
addPlaneZ
=
function
(
strength
,
subtract
)
{
var
x
,
y
,
z
,
zz
,
val
,
zdiv
,
cz
,
cyz
;
var
x
,
y
,
z
,
zz
,
val
,
zdiv
,
cz
,
cyz
,
// cache attribute lookups
size
=
this
.
size
,
...
...
@@ -603,7 +603,7 @@ THREE.MarchingCubes = function ( resolution, materials ) {
var
geo_callback
=
function
(
object
)
{
var
i
,
x
,
y
,
z
,
vertex
,
position
,
normal
,
face
,
a
,
b
,
c
,
na
,
nb
,
nc
;
face
,
a
,
b
,
c
,
na
,
nb
,
nc
,
nfaces
;
for
(
i
=
0
;
i
<
object
.
count
;
i
++
)
{
...
...
src/extras/renderers/AnaglyphWebGLRenderer.js
浏览文件 @
a9cc8bce
...
...
@@ -32,7 +32,7 @@ if ( THREE.WebGLRenderer ) {
var
_camera
=
new
THREE
.
PerspectiveCamera
(
53
,
1
,
1
,
10000
);
_camera
.
position
.
z
=
2
;
_material
=
new
THREE
.
ShaderMaterial
(
{
var
_material
=
new
THREE
.
ShaderMaterial
(
{
uniforms
:
{
...
...
src/extras/renderers/ParallaxBarrierWebGLRenderer.js
浏览文件 @
a9cc8bce
...
...
@@ -32,7 +32,7 @@ if ( THREE.WebGLRenderer ) {
var
_camera
=
new
THREE
.
PerspectiveCamera
(
53
,
1
,
1
,
10000
);
_camera
.
position
.
z
=
2
;
_material
=
new
THREE
.
ShaderMaterial
(
{
var
_material
=
new
THREE
.
ShaderMaterial
(
{
uniforms
:
{
...
...
src/objects/SkinnedMesh.js
浏览文件 @
a9cc8bce
...
...
@@ -131,8 +131,8 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function ( force ) {
// flatten bone matrices to array
var
b
,
bl
=
this
.
bones
.
length
;
ba
=
this
.
bones
;
var
b
,
bl
=
this
.
bones
.
length
,
ba
=
this
.
bones
,
bm
=
this
.
boneMatrices
;
for
(
b
=
0
;
b
<
bl
;
b
++
)
{
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
a9cc8bce
...
...
@@ -2436,7 +2436,8 @@ THREE.WebGLRenderer = function ( parameters ) {
function
setLineBuffers
(
geometry
,
hint
)
{
var
v
,
c
,
vertex
,
offset
,
var
v
,
c
,
vertex
,
offset
,
color
,
vertices
=
geometry
.
vertices
,
colors
=
geometry
.
colors
,
vl
=
vertices
.
length
,
...
...
@@ -2449,6 +2450,7 @@ THREE.WebGLRenderer = function ( parameters ) {
dirtyColors
=
geometry
.
__dirtyColors
,
customAttributes
=
geometry
.
__webglCustomAttributesList
,
i
,
il
,
a
,
ca
,
cal
,
value
,
customAttribute
;
...
...
@@ -2588,7 +2590,8 @@ THREE.WebGLRenderer = function ( parameters ) {
function
setRibbonBuffers
(
geometry
,
hint
)
{
var
v
,
c
,
vertex
,
offset
,
var
v
,
c
,
vertex
,
offset
,
color
,
vertices
=
geometry
.
vertices
,
colors
=
geometry
.
colors
,
vl
=
vertices
.
length
,
...
...
@@ -2642,7 +2645,8 @@ THREE.WebGLRenderer = function ( parameters ) {
function
setParticleBuffers
(
geometry
,
hint
,
object
)
{
var
v
,
c
,
vertex
,
offset
,
var
v
,
c
,
vertex
,
offset
,
index
,
color
,
vertices
=
geometry
.
vertices
,
vl
=
vertices
.
length
,
...
...
@@ -4022,6 +4026,7 @@ THREE.WebGLRenderer = function ( parameters ) {
shadowMap
,
shadowMatrix
,
oil
,
material
,
program
,
buffer
,
o
,
ol
,
webglObject
,
object
,
lights
=
scene
.
lights
,
fog
=
null
;
...
...
src/renderers/WebGLShaders.js
浏览文件 @
a9cc8bce
...
...
@@ -546,7 +546,7 @@ THREE.ShaderChunk = {
"
gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;
"
,
"
#endif
"
,
"
#endif
"
].
join
(
"
\n
"
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录