Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5c8a0896
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,发现更多精彩内容 >>
提交
5c8a0896
编写于
12月 29, 2010
作者:
S
Szymon Nowak
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed implied globals and added few missing semicolons
上级
05dbe81d
变更
22
显示空白变更内容
内联
并排
Showing
22 changed file
with
168 addition
and
167 deletion
+168
-167
src/core/Color.js
src/core/Color.js
+2
-2
src/core/Geometry.js
src/core/Geometry.js
+3
-3
src/core/Matrix3.js
src/core/Matrix3.js
+1
-1
src/core/UV.js
src/core/UV.js
+1
-1
src/core/Vertex.js
src/core/Vertex.js
+1
-1
src/extras/GeometryUtils.js
src/extras/GeometryUtils.js
+3
-3
src/extras/ImageUtils.js
src/extras/ImageUtils.js
+2
-2
src/extras/SceneUtils.js
src/extras/SceneUtils.js
+19
-19
src/extras/primitives/Cube.js
src/extras/primitives/Cube.js
+3
-3
src/extras/primitives/Cylinder.js
src/extras/primitives/Cylinder.js
+1
-1
src/extras/primitives/Plane.js
src/extras/primitives/Plane.js
+1
-1
src/extras/primitives/Sphere.js
src/extras/primitives/Sphere.js
+1
-1
src/materials/Uniforms.js
src/materials/Uniforms.js
+18
-18
src/materials/mappings/CubeReflectionMapping.js
src/materials/mappings/CubeReflectionMapping.js
+3
-3
src/materials/mappings/CubeRefractionMapping.js
src/materials/mappings/CubeRefractionMapping.js
+3
-3
src/materials/mappings/LatitudeReflectionMapping.js
src/materials/mappings/LatitudeReflectionMapping.js
+3
-3
src/materials/mappings/LatitudeRefractionMapping.js
src/materials/mappings/LatitudeRefractionMapping.js
+3
-3
src/materials/mappings/SphericalReflectionMapping.js
src/materials/mappings/SphericalReflectionMapping.js
+3
-3
src/materials/mappings/SphericalRefractionMapping.js
src/materials/mappings/SphericalRefractionMapping.js
+3
-3
src/materials/mappings/UVMapping.js
src/materials/mappings/UVMapping.js
+3
-3
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+81
-80
src/renderers/WebGLRenderer2.js
src/renderers/WebGLRenderer2.js
+10
-10
未找到文件。
src/core/Color.js
浏览文件 @
5c8a0896
...
...
@@ -7,7 +7,7 @@ THREE.Color = function ( hex ) {
this
.
autoUpdate
=
true
;
this
.
setHex
(
hex
);
}
}
;
THREE
.
Color
.
prototype
=
{
...
...
src/core/Geometry.js
浏览文件 @
5c8a0896
...
...
@@ -113,7 +113,7 @@ THREE.Geometry.prototype = {
computeVertexNormals
:
function
()
{
var
v
,
vertices
=
[],
var
v
,
v
l
,
v
ertices
=
[],
f
,
fl
,
face
;
for
(
v
=
0
,
vl
=
this
.
vertices
.
length
;
v
<
vl
;
v
++
)
{
...
...
@@ -179,7 +179,7 @@ THREE.Geometry.prototype = {
var
f
,
fl
,
v
,
vl
,
face
,
uv
,
vA
,
vB
,
vC
,
uvA
,
uvB
,
uvC
,
x1
,
x2
,
y1
,
y2
,
z1
,
z2
,
s1
,
s2
,
t1
,
t2
,
r
,
t
,
n
,
s1
,
s2
,
t1
,
t2
,
r
,
t
,
test
,
tan1
=
[],
tan2
=
[],
sdir
=
new
THREE
.
Vector3
(),
tdir
=
new
THREE
.
Vector3
(),
tmp
=
new
THREE
.
Vector3
(),
tmp2
=
new
THREE
.
Vector3
(),
...
...
@@ -355,7 +355,7 @@ THREE.Geometry.prototype = {
// which could then use vertex color attributes instead of each being
// in its separate VBO
var
i
,
l
,
f
,
fl
,
face
,
material
,
vertices
,
mhash
,
ghash
,
hash_map
=
{};
var
i
,
l
,
f
,
fl
,
face
,
material
,
materials
,
vertices
,
mhash
,
ghash
,
hash_map
=
{};
function
materialHash
(
material
)
{
...
...
src/core/Matrix3.js
浏览文件 @
5c8a0896
...
...
@@ -18,4 +18,4 @@ THREE.Matrix3.prototype = {
}
}
}
;
src/core/UV.js
浏览文件 @
5c8a0896
...
...
@@ -24,4 +24,4 @@ THREE.UV.prototype = {
}
}
}
;
src/core/Vertex.js
浏览文件 @
5c8a0896
...
...
@@ -16,7 +16,7 @@ THREE.Vertex = function ( position, normal ) {
this
.
__visible
=
true
;
}
}
;
THREE
.
Vertex
.
prototype
=
{
...
...
src/extras/GeometryUtils.js
浏览文件 @
5c8a0896
...
...
@@ -28,7 +28,7 @@ var GeometryUtils = {
}
for
(
var
i
=
0
,
il
=
faces2
.
length
;
i
<
il
;
i
++
)
{
for
(
i
=
0
,
il
=
faces2
.
length
;
i
<
il
;
i
++
)
{
var
face
=
faces2
[
i
],
faceCopy
,
normal
,
faceVertexNormals
=
face
.
vertexNormals
;
...
...
@@ -59,7 +59,7 @@ var GeometryUtils = {
}
for
(
var
i
=
0
,
il
=
uvs2
.
length
;
i
<
il
;
i
++
)
{
for
(
i
=
0
,
il
=
uvs2
.
length
;
i
<
il
;
i
++
)
{
var
uv
=
uvs2
[
i
],
uvCopy
=
[];
...
...
@@ -75,4 +75,4 @@ var GeometryUtils = {
}
}
}
;
src/extras/ImageUtils.js
浏览文件 @
5c8a0896
...
...
@@ -20,7 +20,7 @@ var ImageUtils = {
images
[
i
]
=
new
Image
();
images
[
i
].
loaded
=
0
;
images
[
i
].
onload
=
function
()
{
images
.
loadCount
+=
1
;
this
.
loaded
=
true
;
}
images
[
i
].
onload
=
function
()
{
images
.
loadCount
+=
1
;
this
.
loaded
=
true
;
}
;
images
[
i
].
src
=
array
[
i
];
}
...
...
@@ -29,4 +29,4 @@ var ImageUtils = {
}
}
}
;
src/extras/SceneUtils.js
浏览文件 @
5c8a0896
...
...
@@ -36,7 +36,7 @@ var SceneUtils = {
addPanoramaCube
:
function
(
scene
,
size
,
images
)
{
var
materials
=
[];
var
materials
=
[]
,
mesh
;
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
map
:
new
THREE
.
Texture
(
images
[
0
]
)
}
)
);
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
map
:
new
THREE
.
Texture
(
images
[
1
]
)
}
)
);
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
map
:
new
THREE
.
Texture
(
images
[
2
]
)
}
)
);
...
...
@@ -64,4 +64,4 @@ var SceneUtils = {
}
}
}
;
src/extras/primitives/Cube.js
浏览文件 @
5c8a0896
...
...
@@ -64,7 +64,7 @@ var Cube = function ( width, height, depth, segments_width, segments_height, mat
function
buildPlane
(
u
,
v
,
udir
,
vdir
,
width
,
height
,
depth
,
material
)
{
var
w
,
var
w
,
ix
,
iy
,
gridX
=
segments_width
||
1
,
gridY
=
segments_height
||
1
,
gridX1
=
gridX
+
1
,
...
...
@@ -160,7 +160,7 @@ var Cube = function ( width, height, depth, segments_width, segments_height, mat
}
for
(
var
i
=
0
,
l
=
scope
.
faces
.
length
;
i
<
l
;
i
++
)
{
for
(
i
=
0
,
il
=
scope
.
faces
.
length
;
i
<
i
l
;
i
++
)
{
var
face
=
scope
.
faces
[
i
];
...
...
@@ -179,7 +179,7 @@ var Cube = function ( width, height, depth, segments_width, segments_height, mat
this
.
computeFaceNormals
();
this
.
sortFacesByMaterial
();
}
}
;
Cube
.
prototype
=
new
THREE
.
Geometry
();
Cube
.
prototype
.
constructor
=
Cube
;
src/extras/primitives/Cylinder.js
浏览文件 @
5c8a0896
...
...
@@ -76,7 +76,7 @@ var Cylinder = function ( numSegs, topRad, botRad, height, topOffset, botOffset
}
}
}
;
Cylinder
.
prototype
=
new
THREE
.
Geometry
();
Cylinder
.
prototype
.
constructor
=
Cylinder
;
src/extras/primitives/Plane.js
浏览文件 @
5c8a0896
...
...
@@ -56,7 +56,7 @@ var Plane = function ( width, height, segments_width, segments_height ) {
this
.
computeFaceNormals
();
this
.
sortFacesByMaterial
();
}
}
;
Plane
.
prototype
=
new
THREE
.
Geometry
();
Plane
.
prototype
.
constructor
=
Plane
;
src/extras/primitives/Sphere.js
浏览文件 @
5c8a0896
...
...
@@ -110,7 +110,7 @@ var Sphere = function ( radius, segments_width, segments_height ) {
this
.
boundingSphere
=
{
radius
:
radius
};
}
}
;
Sphere
.
prototype
=
new
THREE
.
Geometry
();
Sphere
.
prototype
.
constructor
=
Sphere
;
src/materials/Uniforms.js
浏览文件 @
5c8a0896
...
...
@@ -2,7 +2,7 @@ var Uniforms = {
clone
:
function
(
uniforms_src
)
{
var
u
,
p
,
parameter
,
uniforms_dst
=
{};
var
u
,
p
,
parameter
,
parameter_src
,
uniforms_dst
=
{};
for
(
u
in
uniforms_src
)
{
...
...
@@ -32,4 +32,4 @@ var Uniforms = {
}
}
}
;
src/materials/mappings/CubeReflectionMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.CubeReflectionMapping = function () {
}
}
;
src/materials/mappings/CubeRefractionMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.CubeRefractionMapping = function () {
}
}
;
src/materials/mappings/LatitudeReflectionMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.LatitudeReflectionMapping = function () {
}
}
;
src/materials/mappings/LatitudeRefractionMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.LatitudeRefractionMapping = function () {
}
}
;
src/materials/mappings/SphericalReflectionMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.SphericalReflectionMapping = function () {
}
}
;
src/materials/mappings/SphericalRefractionMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.SphericalRefractionMapping = function () {
}
}
;
src/materials/mappings/UVMapping.js
浏览文件 @
5c8a0896
...
...
@@ -6,4 +6,4 @@ THREE.UVMapping = function () {
}
}
;
src/renderers/WebGLRenderer.js
浏览文件 @
5c8a0896
...
...
@@ -36,7 +36,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// heuristics to create shader parameters according to lights in the scene
// (not to blow over maxLights budget)
maxLightCount
=
allocateLights
(
parameters
.
scene
,
4
)
;
maxLightCount
=
allocateLights
(
parameters
.
scene
,
4
)
,
fog
=
parameters
.
scene
?
parameters
.
scene
.
fog
:
null
,
antialias
=
parameters
.
antialias
!=
undefined
?
parameters
.
antialias
:
true
,
...
...
@@ -172,7 +172,7 @@ THREE.WebGLRenderer = function ( parameters ) {
this
.
createBuffers
=
function
(
object
,
g
)
{
var
f
,
fl
,
fi
,
face
,
vertexNormals
,
normal
,
uv
,
v1
,
v2
,
v3
,
v4
,
t1
,
t2
,
t3
,
t4
,
m
,
ml
,
i
,
var
f
,
fl
,
fi
,
face
,
vertexNormals
,
faceNormal
,
normal
,
uv
,
v1
,
v2
,
v3
,
v4
,
t1
,
t2
,
t3
,
t4
,
m
,
ml
,
i
,
faceArray
=
[],
lineArray
=
[],
...
...
@@ -1580,7 +1580,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function
bufferNeedsSmoothNormals
(
geometryChunk
,
object
)
{
var
m
,
ml
,
i
,
l
,
needsSmoothNormals
=
false
;
var
m
,
ml
,
i
,
l
,
meshMaterial
,
needsSmoothNormals
=
false
;
for
(
m
=
0
,
ml
=
object
.
materials
.
length
;
m
<
ml
;
m
++
)
{
...
...
@@ -1622,7 +1622,8 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
scene
)
{
var
l
,
ll
,
light
,
dirLights
=
pointLights
=
maxDirLights
=
maxPointLights
=
0
;
var
l
,
ll
,
light
,
dirLights
,
pointLights
,
maxDirLights
,
maxPointLights
;
dirLights
=
pointLights
=
maxDirLights
=
maxPointLights
=
0
;
for
(
l
=
0
,
ll
=
scene
.
lights
.
length
;
l
<
ll
;
l
++
)
{
...
...
src/renderers/WebGLRenderer2.js
浏览文件 @
5c8a0896
...
...
@@ -14,6 +14,7 @@ THREE.WebGLRenderer2 = function ( antialias ) {
_canvas
=
document
.
createElement
(
'
canvas
'
),
_gl
,
_currentProgram
,
_modelViewMatrix
=
new
THREE
.
Matrix4
(),
_normalMatrix
=
new
THREE
.
Matrix4
(),
_viewMatrixArray
=
new
Float32Array
(
16
),
_modelViewMatrixArray
=
new
Float32Array
(
16
),
_projectionMatrixArray
=
new
Float32Array
(
16
),
...
...
@@ -100,7 +101,7 @@ THREE.WebGLRenderer2 = function ( antialias ) {
function
renderObject
(
object
)
{
var
geometry
,
material
,
m
,
n
l
,
var
geometry
,
material
,
m
,
m
l
,
program
,
uniforms
,
attributes
;
object
.
autoUpdateMatrix
&&
object
.
updateMatrix
();
...
...
@@ -283,10 +284,9 @@ THREE.WebGLRenderer2 = function ( antialias ) {
function
buildBuffers
(
geometry
)
{
var
itemCount
=
0
,
vertexIndex
,
group
,
f
,
fl
,
face
,
v1
,
v2
,
v3
,
v
ertexNormals
,
normal
,
uv
,
f
,
fl
,
face
,
v1
,
v2
,
v3
,
v
4
,
vertexNormals
,
faceNormal
,
normal
,
uv
,
vertexGroups
=
[],
faceGroups
=
[],
lineGroups
=
[],
normalGroups
=
[],
uvGroups
=
[],
vertices
,
faces
,
lines
,
normals
,
uvs
,
buffers
=
{};
vertices
,
faces
,
lines
,
normals
,
uvs
;
for
(
f
=
0
,
fl
=
geometry
.
faces
.
length
;
f
<
fl
;
f
++
)
{
...
...
@@ -544,9 +544,9 @@ THREE.WebGLRenderer2 = function ( antialias ) {
identifiers
.
push
(
'
mColor
'
,
'
mOpacity
'
);
material
.
map
?
identifiers
.
push
(
'
tMap
'
)
:
null
;
material
.
env_map
?
identifiers
.
push
(
'
tSpherical
'
)
:
null
;
material
.
fog
?
identifiers
.
push
(
'
fog
'
,
'
fogColor
'
,
'
fogNear
'
,
'
fogFar
'
)
:
null
;
if
(
material
.
map
)
identifiers
.
push
(
'
tMap
'
)
;
if
(
material
.
env_map
)
identifiers
.
push
(
'
tSpherical
'
)
;
if
(
material
.
fog
)
identifiers
.
push
(
'
fog
'
,
'
fogColor
'
,
'
fogNear
'
,
'
fogFar
'
)
;
}
else
if
(
material
instanceof
THREE
.
MeshNormalMaterial
)
{
...
...
@@ -622,7 +622,7 @@ THREE.WebGLRenderer2 = function ( antialias ) {
function
compileProgram
(
vertex_shader
,
fragment_shader
)
{
var
program
=
_gl
.
createProgram
(),
shader
var
program
=
_gl
.
createProgram
(),
shader
,
prefix_vertex
,
prefix_fragment
;
prefix_vertex
=
[
maxVertexTextures
()
>
0
?
"
#define VERTEX_TEXTURES
"
:
""
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录