Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
985282d4
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,发现更多精彩内容 >>
提交
985282d4
编写于
1月 14, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
4e7ea004
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
521 addition
and
424 deletion
+521
-424
build/three.js
build/three.js
+117
-22
build/three.min.js
build/three.min.js
+404
-402
未找到文件。
build/three.js
浏览文件 @
985282d4
...
...
@@ -7083,10 +7083,48 @@ THREE.EventDispatcher.prototype = {
a = vertices[ face.a ];
b = vertices[ face.b ];
c = vertices[ face.c ];
if ( material.morphTargets === true ) {
var morphTargets = geometry.morphTargets;
var morphInfluences = object.morphTargetInfluences;
vA.set( 0, 0, 0 );
vB.set( 0, 0, 0 );
vC.set( 0, 0, 0 );
for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) {
var targets = morphTargets[ t ].vertices;
var influence = morphInfluences[ t ];
vA.x += ( targets[ face.a ].x - a.x ) * influence;
vA.y += ( targets[ face.a ].y - a.y ) * influence;
vA.z += ( targets[ face.a ].z - a.z ) * influence;
vB.x += ( targets[ face.b ].x - b.x ) * influence;
vB.y += ( targets[ face.b ].y - b.y ) * influence;
vB.z += ( targets[ face.b ].z - b.z ) * influence;
vC.x += ( targets[ face.c ].x - c.x ) * influence;
vC.y += ( targets[ face.c ].y - c.y ) * influence;
vC.z += ( targets[ face.c ].z - c.z ) * influence;
}
vA.add( a );
vB.add( b );
vC.add( c );
a = vA;
b = vB;
c = vC;
}
if ( material.side === THREE.BackSide ) {
var intersectionPoint = localRay.intersectTriangle( c, b, a, true );
var intersectionPoint = localRay.intersectTriangle( c, b, a, true );
} else {
...
...
@@ -7821,6 +7859,10 @@ THREE.Projector = function () {
_renderData = { objects: [], sprites: [], lights: [], elements: [] },
_vA = new THREE.Vector3(),
_vB = new THREE.Vector3(),
_vC = new THREE.Vector3(),
_vector3 = new THREE.Vector3(),
_vector4 = new THREE.Vector4(),
...
...
@@ -7908,6 +7950,27 @@ THREE.Projector = function () {
};
var projectVertex = function ( vertex ) {
var position = vertex.position;
var positionWorld = vertex.positionWorld;
var positionScreen = vertex.positionScreen;
positionWorld.copy( position ).applyMatrix4( _modelMatrix );
positionScreen.copy( positionWorld ).applyMatrix4( _viewProjectionMatrix );
var invW = 1 / positionScreen.w;
positionScreen.x *= invW;
positionScreen.y *= invW;
positionScreen.z *= invW;
vertex.visible = positionScreen.x >= -1 && positionScreen.x <= 1 &&
positionScreen.y >= -1 && positionScreen.y <= 1 &&
positionScreen.z >= -1 && positionScreen.z <= 1;
};
var projectObject = function ( object ) {
if ( object.visible === false ) return;
...
...
@@ -7959,8 +8022,7 @@ THREE.Projector = function () {
this.projectScene = function ( scene, camera, sortObjects, sortElements ) {
var visible = false,
o, ol, v, vl, f, fl, n, nl, c, cl, u, ul, object,
geometry, vertices, faces, face, faceVertexNormals, faceVertexUvs, uvs,
object, geometry, vertices, faces, face, faceVertexNormals, faceVertexUvs, uvs,
v1, v2, v3, v4, isFaceMaterial, objectMaterials;
_face3Count = 0;
...
...
@@ -7981,7 +8043,7 @@ THREE.Projector = function () {
projectGraph( scene, sortObjects );
for ( o = 0, ol = _renderData.objects.length; o < ol; o ++ ) {
for (
var
o = 0, ol = _renderData.objects.length; o < ol; o ++ ) {
object = _renderData.objects[ o ].object;
...
...
@@ -8002,26 +8064,16 @@ THREE.Projector = function () {
isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial;
objectMaterials = isFaceMaterial === true ? object.material : null;
for ( v = 0, vl = vertices.length; v < vl; v ++ ) {
for ( v
ar v
= 0, vl = vertices.length; v < vl; v ++ ) {
_vertex = getNextVertexInPool();
_vertex.position.copy( vertices[ v ] );
_vertex.positionWorld.copy( vertices[ v ] ).applyMatrix4( _modelMatrix );
_vertex.positionScreen.copy( _vertex.positionWorld ).applyMatrix4( _viewProjectionMatrix );
var invW = 1 / _vertex.positionScreen.w;
_vertex.positionScreen.x *= invW;
_vertex.positionScreen.y *= invW;
_vertex.positionScreen.z *= invW;
_vertex.visible = ! ( _vertex.positionScreen.x < -1 || _vertex.positionScreen.x > 1 ||
_vertex.positionScreen.y < -1 || _vertex.positionScreen.y > 1 ||
_vertex.positionScreen.z < -1 || _vertex.positionScreen.z > 1 );
projectVertex( _vertex );
}
for ( f = 0, fl = faces.length; f < fl; f ++ ) {
for (
var
f = 0, fl = faces.length; f < fl; f ++ ) {
face = faces[ f ];
...
...
@@ -8037,6 +8089,48 @@ THREE.Projector = function () {
v2 = _vertexPool[ face.b ];
v3 = _vertexPool[ face.c ];
if ( material.morphTargets === true ) {
var morphTargets = geometry.morphTargets;
var morphInfluences = object.morphTargetInfluences;
var v1p = v1.position;
var v2p = v2.position;
var v3p = v3.position;
_vA.set( 0, 0, 0 );
_vB.set( 0, 0, 0 );
_vC.set( 0, 0, 0 );
for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) {
var targets = morphTargets[ t ].vertices;
var influence = morphInfluences[ t ];
_vA.x += ( targets[ face.a ].x - v1p.x ) * influence;
_vA.y += ( targets[ face.a ].y - v1p.y ) * influence;
_vA.z += ( targets[ face.a ].z - v1p.z ) * influence;
_vB.x += ( targets[ face.b ].x - v2p.x ) * influence;
_vB.y += ( targets[ face.b ].y - v2p.y ) * influence;
_vB.z += ( targets[ face.b ].z - v2p.z ) * influence;
_vC.x += ( targets[ face.c ].x - v3p.x ) * influence;
_vC.y += ( targets[ face.c ].y - v3p.y ) * influence;
_vC.z += ( targets[ face.c ].z - v3p.z ) * influence;
}
v1.position.add( _vA );
v2.position.add( _vB );
v3.position.add( _vC );
projectVertex( v1 );
projectVertex( v2 );
projectVertex( v3 );
}
_points3[ 0 ] = v1.positionScreen;
_points3[ 1 ] = v2.positionScreen;
_points3[ 2 ] = v3.positionScreen;
...
...
@@ -8086,7 +8180,7 @@ THREE.Projector = function () {
faceVertexNormals = face.vertexNormals;
for ( n = 0, nl = Math.min( faceVertexNormals.length, 3 ); n < nl; n ++ ) {
for (
var
n = 0, nl = Math.min( faceVertexNormals.length, 3 ); n < nl; n ++ ) {
var normalModel = _face.vertexNormalsModel[ n ];
normalModel.copy( faceVertexNormals[ n ] );
...
...
@@ -8106,13 +8200,13 @@ THREE.Projector = function () {
_face.vertexNormalsLength = faceVertexNormals.length;
for ( c = 0, cl = Math.min( faceVertexUvs.length, 3 ); c < cl; c ++ ) {
for (
var
c = 0, cl = Math.min( faceVertexUvs.length, 3 ); c < cl; c ++ ) {
uvs = faceVertexUvs[ c ][ f ];
if ( uvs === undefined ) continue;
for ( u = 0, ul = uvs.length; u < ul; u ++ ) {
for (
var
u = 0, ul = uvs.length; u < ul; u ++ ) {
_face.uvs[ c ][ u ] = uvs[ u ];
...
...
@@ -26299,6 +26393,7 @@ THREE.WebGLRenderTargetCube.prototype = Object.create( THREE.WebGLRenderTarget.p
THREE.RenderableVertex = function () {
this.position = new THREE.Vector3();
this.positionWorld = new THREE.Vector3();
this.positionScreen = new THREE.Vector4();
...
...
build/three.min.js
浏览文件 @
985282d4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录