Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
89bdcf64
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,发现更多精彩内容 >>
提交
89bdcf64
编写于
2月 19, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
b4b89c18
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
282 addition
and
265 deletion
+282
-265
build/three.js
build/three.js
+43
-26
build/three.min.js
build/three.min.js
+239
-239
未找到文件。
build/three.js
浏览文件 @
89bdcf64
...
...
@@ -16110,8 +16110,13 @@ THREE.CanvasRenderer = function ( parameters ) {
_canvasWidth = _canvas.width,
_canvasHeight = _canvas.height,
_canvasWidthHalf = Math.floor( _canvasWidth / 2 ),
_canvasHeightHalf = Math.floor( _canvasHeight / 2 ),
_viewportX = 0,
_viewportY = 0,
_viewportWidth = _canvasWidth,
_viewportHeight = _canvasHeight,
_viewportWidthHalf = Math.floor( _viewportWidth / 2 ),
_viewportHeightHalf = Math.floor( _viewportHeight / 2 ),
_context = _canvas.getContext( '2d', {
alpha: parameters.alpha === true
...
...
@@ -16244,9 +16249,6 @@ THREE.CanvasRenderer = function ( parameters ) {
_canvasWidth = width * this.devicePixelRatio;
_canvasHeight = height * this.devicePixelRatio;
_canvasWidthHalf = Math.floor( _canvasWidth / 2 );
_canvasHeightHalf = Math.floor( _canvasHeight / 2 );
_canvas.width = _canvasWidth;
_canvas.height = _canvasHeight;
...
...
@@ -16257,12 +16259,6 @@ THREE.CanvasRenderer = function ( parameters ) {
}
_clipBox.min.set( - _canvasWidthHalf, - _canvasHeightHalf ),
_clipBox.max.set( _canvasWidthHalf, _canvasHeightHalf );
_clearBox.min.set( - _canvasWidthHalf, - _canvasHeightHalf );
_clearBox.max.set( _canvasWidthHalf, _canvasHeightHalf );
_contextGlobalAlpha = 1;
_contextGlobalCompositeOperation = 0;
_contextStrokeStyle = null;
...
...
@@ -16271,15 +16267,40 @@ THREE.CanvasRenderer = function ( parameters ) {
_contextLineCap = null;
_contextLineJoin = null;
this.setViewport( 0, 0, width, height );
};
this.setViewport = function ( x, y, width, height ) {
_viewportX = x;
_viewportY = y;
_viewportWidth = width;
_viewportHeight = height;
_viewportWidthHalf = Math.floor( _viewportWidth / 2 ),
_viewportHeightHalf = Math.floor( _viewportHeight / 2 ),
_clipBox.min.set( - _viewportWidthHalf, - _viewportHeightHalf ),
_clipBox.max.set( _viewportWidthHalf, _viewportHeightHalf );
_clearBox.min.set( - _viewportWidthHalf, - _viewportHeightHalf );
_clearBox.max.set( _viewportWidthHalf, _viewportHeightHalf );
_context.setTransform( 1, 0, 0, - 1, _viewportX + _viewportWidthHalf, _canvasHeight - ( _viewportY + _viewportHeight ) + _viewportHeightHalf );
};
this.setScissor = function () {};
this.enableScissorTest = function () {};
this.setClearColor = function ( color, alpha ) {
_clearColor.set( color );
_clearAlpha = alpha !== undefined ? alpha : 1;
_clearBox.min.set( - _
canvasWidthHalf, - _canvas
HeightHalf );
_clearBox.max.set( _
canvasWidthHalf, _canvas
HeightHalf );
_clearBox.min.set( - _
viewportWidthHalf, - _viewport
HeightHalf );
_clearBox.max.set( _
viewportWidthHalf, _viewport
HeightHalf );
};
...
...
@@ -16298,8 +16319,6 @@ THREE.CanvasRenderer = function ( parameters ) {
this.clear = function () {
_context.setTransform( 1, 0, 0, - 1, _canvasWidthHalf, _canvasHeightHalf );
if ( _clearBox.empty() === false ) {
_clearBox.intersect( _clipBox );
...
...
@@ -16355,8 +16374,6 @@ THREE.CanvasRenderer = function ( parameters ) {
if ( this.autoClear === true ) this.clear();
_context.setTransform( 1, 0, 0, - 1, _canvasWidthHalf, _canvasHeightHalf );
_this.info.render.vertices = 0;
_this.info.render.faces = 0;
...
...
@@ -16387,7 +16404,7 @@ THREE.CanvasRenderer = function ( parameters ) {
if ( element instanceof THREE.RenderableSprite ) {
_v1 = element;
_v1.x *= _
canvasWidthHalf; _v1.y *= _canvas
HeightHalf;
_v1.x *= _
viewportWidthHalf; _v1.y *= _viewport
HeightHalf;
renderSprite( _v1, element, material );
...
...
@@ -16395,8 +16412,8 @@ THREE.CanvasRenderer = function ( parameters ) {
_v1 = element.v1; _v2 = element.v2;
_v1.positionScreen.x *= _
canvasWidthHalf; _v1.positionScreen.y *= _canvas
HeightHalf;
_v2.positionScreen.x *= _
canvasWidthHalf; _v2.positionScreen.y *= _canvas
HeightHalf;
_v1.positionScreen.x *= _
viewportWidthHalf; _v1.positionScreen.y *= _viewport
HeightHalf;
_v2.positionScreen.x *= _
viewportWidthHalf; _v2.positionScreen.y *= _viewport
HeightHalf;
_elemBox.setFromPoints( [
_v1.positionScreen,
...
...
@@ -16417,9 +16434,9 @@ THREE.CanvasRenderer = function ( parameters ) {
if ( _v2.positionScreen.z < -1 || _v2.positionScreen.z > 1 ) continue;
if ( _v3.positionScreen.z < -1 || _v3.positionScreen.z > 1 ) continue;
_v1.positionScreen.x *= _
canvasWidthHalf; _v1.positionScreen.y *= _canvas
HeightHalf;
_v2.positionScreen.x *= _
canvasWidthHalf; _v2.positionScreen.y *= _canvas
HeightHalf;
_v3.positionScreen.x *= _
canvasWidthHalf; _v3.positionScreen.y *= _canvas
HeightHalf;
_v1.positionScreen.x *= _
viewportWidthHalf; _v1.positionScreen.y *= _viewport
HeightHalf;
_v2.positionScreen.x *= _
viewportWidthHalf; _v2.positionScreen.y *= _viewport
HeightHalf;
_v3.positionScreen.x *= _
viewportWidthHalf; _v3.positionScreen.y *= _viewport
HeightHalf;
if ( material.overdraw > 0 ) {
...
...
@@ -16459,7 +16476,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_context.strokeRect( _clearBox.min.x, _clearBox.min.y, _clearBox.max.x - _clearBox.min.x, _clearBox.max.y - _clearBox.min.y );
*/
_context.setTransform( 1, 0, 0, 1, 0, 0 );
//
_context.setTransform( 1, 0, 0, 1, 0, 0 );
};
...
...
@@ -16545,8 +16562,8 @@ THREE.CanvasRenderer = function ( parameters ) {
setOpacity( material.opacity );
setBlending( material.blending );
var scaleX = element.scale.x * _
canvas
WidthHalf;
var scaleY = element.scale.y * _
canvas
HeightHalf;
var scaleX = element.scale.x * _
viewport
WidthHalf;
var scaleY = element.scale.y * _
viewport
HeightHalf;
var dist = 0.5 * Math.sqrt( scaleX * scaleX + scaleY * scaleY ); // allow for rotated sprite
_elemBox.min.set( v1.x - dist, v1.y - dist );
...
...
build/three.min.js
浏览文件 @
89bdcf64
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录