Face3.js 575 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
var Face3 = Vector3.extend
({
	a: null, b: null, c: null,
	screen: null,
	uv: null,
	normal: null,
	color: null,

	init: function(a, b, c, uv, normal, color)
	{
		this._super((a.x + b.x + c.x) / 3, (a.y + b.y + c.y) / 3, (a.z + b.z + c.z) / 3);	
	
		this.a = a;
		this.b = b;
		this.c = c;

		this.screen = new Vector3();
		
		this.uv = uv ? uv : [ [0, 0], [0, 0], [0, 0] ];
		this.normal = normal ? normal : new Vector3();

M
Mr.doob 已提交
22
		this.color = color ? color : new Color();
23 24 25 26
	},

	toString: function()
	{
M
Mr.doob 已提交
27
		return 'Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )';
28 29
	}
});