提交 254bc2a7 编写于 作者: T Tentone

Added center attribute to texture

上级 c318c586
......@@ -129,6 +129,7 @@
texture.offset.set( API.offsetX, API.offsetY );
texture.repeat.set( API.repeatX, API.repeatY );
texture.center.set( API.centerX, API.centerY );
texture.rotation = API.rotation; // rotation is around [ 0.5, 0.5 ]
} else {
......
......@@ -1992,10 +1992,12 @@ function WebGLRenderer( parameters ) {
if ( uvScaleMap.matrixAutoUpdate === true ) {
var offset = uvScaleMap.offset;
var repeat = uvScaleMap.repeat;
var rotation = uvScaleMap.rotation;
uvScaleMap.matrix.setUvTransform( offset.x, offset.y, repeat.x, repeat.y, rotation, 0.0, 0.0 );
var offset = uvScaleMap.offset;
var repeat = uvScaleMap.repeat;
var rotation = uvScaleMap.rotation;
var center = uvScaleMap.center;
uvScaleMap.matrix.setUvTransform( offset.x, offset.y, repeat.x, repeat.y, rotation, center.x, center.y );
}
......@@ -2033,10 +2035,12 @@ function WebGLRenderer( parameters ) {
if ( material.map.matrixAutoUpdate === true ) {
var offset = material.map.offset;
var repeat = material.map.repeat;
var rotation = material.map.rotation;
material.map.matrix.setUvTransform( offset.x, offset.y, repeat.x, repeat.y, rotation, 0.0, 0.0 );
var offset = material.map.offset;
var repeat = material.map.repeat;
var rotation = material.map.rotation;
var center = material.map.center;
material.map.matrix.setUvTransform( offset.x, offset.y, repeat.x, repeat.y, rotation, center.x, center.y );
}
......
......@@ -39,6 +39,7 @@ function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, ty
this.offset = new Vector2( 0, 0 );
this.repeat = new Vector2( 1, 1 );
this.center = new Vector2( 0, 0 );
this.rotation = 0;
this.matrixAutoUpdate = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册