ben

real time 3d display

Recommended Posts

Hello all ...

 

i have a confusion about the points and triangles matrix , how can i connect between them , also what each value in a triangle matrix mean??? and why the triangle have 4 points (a,b,c,d) than 3 points ??

 

 

points = [
{ x:0x00014, y:0x000d6, z:0x3ff8c },
{ x:0x00012, y:0x000c4, z:0x3ff98 },
{ x:0x3fffa, y:0x000aa, z:0x3ffc4 },
{ x:0x3ffda, y:0x00094, z:0x3ffe4 },
{ x:0x3ffb4, y:0x00082, z:0x3fff8 },
{ x:0x3ff92, y:0x00068, z:0x00012 },
{ x:0x3ff9c, y:0x00040, z:0x00014 },
{ x:0x3ffaa, y:0x0003a, z:0x00048 },
{ x:0x3ffae, y:0x00022, z:0x0007e },
{ x:0x3ffac, y:0x3fffc, z:0x000a8 },
{ x:0x3ffac, y:0x3ffd0, z:0x000ba },
{ x:0x3ffac, y:0x3ffa0, z:0x000b6 },
                       .
                       .
                       .
{ x:0x000c0, y:0x3ff9a, z:0x3fff2 },
{ x:0x000b4, y:0x3ffac, z:0x3ffc8 },
];
 
 
var triangles = [
{ a:0x000, b:0x011, c:0x012, d:0x001 },
{ a:0x000, b:0x012, c:0x001, d:0x003 },
{ a:0x001, b:0x012, c:0x013, d:0x001 },
{ a:0x001, b:0x013, c:0x002, d:0x003 },
{ a:0x002, b:0x013, c:0x014, d:0x001 },
                             .
                             .
                             .
{ a:0x10d, b:0x11e, c:0x11f, d:0x001 },
{ a:0x10d, b:0x11f, c:0x10e, d:0x003 },
{ a:0x10e, b:0x11f, c:0x120, d:0x001 },
{ a:0x10e, b:0x120, c:0x10f, d:0x003 },
];
 
 
note : i read  this data in Papilio-3d / demo / 3d.html  at  https://github.com/ben0109/Papilio-3d/blob/master/demo/3d.html
thanks in advance

Share this post


Link to post
Share on other sites

a,b and c are the indices of the points in "points" array.

 

d is the color : 1 for blue, 2 for green and 4 for red (only 1=blue and 3=cyan used here)

 

i agree using "d" after a,b and c for something totally different was a bad choice ! sorry about it.

Share this post


Link to post
Share on other sites

Hello all...

Have you the matrix data of triangle and point of BunnyWire (rabbit) that i see in the video and can send it to me , please please??

In fact I tried with the data that I saw in : Papilio-3d / demo / 3d.html athttps://github.com/b...er/demo/3d.html ,but only a mesh cube appear..

Also what is the function of : (Papilio-3d-master) => proj_matrices.vhd file , can anyone help me with the matrix of it , please ??

thanks in advance

Share this post


Link to post
Share on other sites

they should be in the html files. i cannot check on github right now, but i copy it below -- it definitely shows a rabbit in my firefox.

 

about the proj_matrices.vhd files, it just contains the values for the projection matrices : if you do not need the animation, you can use a fixed matrix, as in the html demo.

 

<html>	<head>		<title>3d</title>		<script type="text/javascript">			/***************************************************************/			/* fixed points operations                                     */			/***************************************************************/			// from -1024 to 1023.99, with a fixed precision of 1/256			const intBits = 10;			const fracBits = 8;			var mask = (1<<(intBits+fracBits))-1;			var sign = (1<<(intBits+fracBits-1));			var sign_mask = ~mask;			function fromNum(n)			{				var c = (n*(1<<fracBits))&mask;				if (c&sign) { c |= sign_mask; }				return c;			}			function round(a)			{				return a>>fracBits;			}			function add(a,			{				var c = (a+&mask;				if (c&sign) { c |= sign_mask; }				return c;			}			function sub(a,			{				var c = (a-&mask;				if (c&sign) { c |= sign_mask; }				return c;			}			function mul(a,			{				if (a&sign) { a |= sign_mask; }				if (b&sign) { b |= sign_mask; }				var c = ((a* >> fracBits)&mask;				if (c&sign) { c |= sign_mask; }				return c;			}			function div(a,			{				if (a&sign) { a |= sign_mask; }				if (b&sign) { b |= sign_mask; }				var c = ((a<<fracBits) / &mask;				if (c&sign) { c |= sign_mask; }				return c;			}			/******************************************************************/			/* matrix operations                                              */			/* note: we use floating point arithmetic, and convert in the end */			/******************************************************************/			function matrix_mult(a,			{				var r = [];				for (var i=0; i<4; i++) {					r[i] = [];					for (var j=0; j<4; j++) {						r[i][j] = a[i][0]*b[0][j] + a[i][1]*b[1][j] + a[i][2]*b[2][j] + a[i][3]*b[3][j];					}				}				return r;			}			function identity_matrix()			{				var r = [];				for (var i=0; i<4; i++) {					r[i] = [];					for (var j=0; j<4; j++) {						r[i][j] = (i==j)?1:0;					}				}				return r;			}			function translation_matrix(dx,dy,dz)			{				var r = identity_matrix();				r[0][3] = dx;				r[1][3] = dy;				r[2][3] = dz;				return r;			}			function rotation_matrix(x,y,z,angle)			{				var r = Math.sqrt(x*x+y*y+z*z);				x /= r;				y /= r;				z /= r;				var c = Math.cos(angle);				var s = Math.sin(angle);				var r = [];				for (var i=0; i<4; i++) {					r[i] = [];					for (var j=0; j<4; j++) {						r[i][j] = 0;					}				}				r[0][0] = x*x*(1-c) + c;				r[0][1] = x*y*(1-c) - z*s;				r[0][2] = x*z*(1-c) + y*s;				r[1][0] = y*x*(1-c) + z*s;				r[1][1] = y*y*(1-c) + c;				r[1][2] = y*z*(1-c) - x*s;				r[2][0] = z*x*(1-c) - y*s;				r[2][1] = z*y*(1-c) + x*s;				r[2][2] = z*z*(1-c) + c;				r[3][3] = 1;				return r;			}			// frustum matrix			function projection_matrix(zNear,zFar)			{				var matrix = [];				for (var i=0; i<4; i++) {					matrix[i] = [];					for (var j=0; j<4; j++) {						matrix[i][j] = 0;					}				}				matrix[0][0] = zNear;				matrix[1][1] = zNear;				matrix[2][2] = (zFar+zNear)/(zNear-zFar);				matrix[2][3] = (2*zFar*zNear)/(zNear-zFar);				matrix[3][2] = -1;				return matrix;			}			// converts a matrix to the fixed point format			function conv_matrix(matrix)			{				for (var i=0; i<4; i++) {					for (var j=0; j<4; j++) {						matrix[i][j] = fromNum(matrix[i][j]);					}				}			}			/******************************************************************/			/* transform raw geometry data into screen coordinates points     */			/* and easy to render triangles                                   */			/******************************************************************/			// apply the projection matrix, multiply by 128 to be adequate for a 256*256 display			function transform_points(matrix, points)			{				var screen_points = [];				for (var i in points) {					var p = points[i];					var x = add(add(add(mul(matrix[0][0],p.x), mul(matrix[0][1],p.y)), mul(matrix[0][2],p.z)), matrix[0][3]);					var y = add(add(add(mul(matrix[1][0],p.x), mul(matrix[1][1],p.y)), mul(matrix[1][2],p.z)), matrix[1][3]);					var z = add(add(add(mul(matrix[2][0],p.x), mul(matrix[2][1],p.y)), mul(matrix[2][2],p.z)), matrix[2][3]);					var w = add(add(add(mul(matrix[3][0],p.x), mul(matrix[3][1],p.y)), mul(matrix[3][2],p.z)), matrix[3][3]);					x = div(x,w);					y = div(y,w);					z = div(z,w);					x = mul(x,fromNum(128));					y = mul(y,fromNum(128));					z = mul(z,fromNum(128));					screen_points[i] = {x:x, y:y, z:z};				}				return screen_points;			}			// prepare the triangles for a per-line rendering			function transform_triangles(screen_points, triangles)			{				var screen_triangles = [];				for (var i in triangles) {					var t = triangles[i];					var a = screen_points[t.a];					var b = screen_points[t.b];					var c = screen_points[t.c];					// sort points					var tmp;					if (b.y<a.y) { tmp=a; a=b; b=tmp; };					if (c.y<b.y) { tmp=b; b=c; c=tmp; };					if (b.y<a.y) { tmp=a; a=b; b=tmp; };					var y0 = round(a.y);					var y1 = round(b.y);					var y2 = round(c.y);					var dx01 = div(sub(b.x,a.x),sub(b.y,a.y));					var dx02 = div(sub(c.x,a.x),sub(c.y,a.y));					var dx12 = div(sub(c.x,b.x),sub(c.y,b.y));					var dz01 = div(sub(b.z,a.z),sub(b.y,a.y));					var dz02 = div(sub(c.z,a.z),sub(c.y,a.y));					var dz12 = div(sub(c.z,b.z),sub(c.y,b.y));//					if (y0!=y1) {					if ((b.y-a.y)>fromNum(1)) {						screen_triangles.push({							y0: y0,							y1: y1,							dir: 0,							x: a.x,							z: a.z,							dx0: (dx01<dx02) ? dx01 : dx02,							dx1: (dx01<dx02) ? dx02 : dx01,							dz0: (dx01<dx02) ? dz01 : dz02,							dz1: (dx01<dx02) ? dz02 : dz01,							color:t.d						});					}//					if (y1!=y2) {					if ((c.y-b.y)>fromNum(1)) {						screen_triangles.push({							y0: y1,							y1: y2,							dir: 1,							x: c.x,							z: c.z,							dx0: (dx02>dx12) ? dx02 : dx12,							dx1: (dx02>dx12) ? dx12 : dx02,							dz0: (dx02>dx12) ? dz02 : dz12,							dz1: (dx02>dx12) ? dz12 : dz02,							color:t.d						});					}				}				return screen_triangles;			}			/******************************************************************/			/* drawing process                                                */			/******************************************************************/			// draw a segment from xl to xr on the current line			function draw_segment(zbuffer,cbuffer,y, xl,xr,zl,dz,color)			{				xl += 128;				xr += 128;				var z = zl;				for (var x=xl; x<=xr; x++) {					var oldz = zbuffer[x];					if (oldz<z) {						zbuffer[x] = z;						cbuffer[x] = color;					}					z = add(z,dz);				}			}			// clears a line, and draws all triangles that intersect it			function draw_line(screen_triangles, zbuffer,cbuffer,y)			{				for (var x=0; x<256; x++) {					zbuffer[x] = fromNum(0);					cbuffer[x] = 0;				}				for (var i in screen_triangles) {					var t = screen_triangles[i];					if ((t.y0<=y) && (y<t.y1)) {						var dy = y - (t.dir?t.y1:t.y0);						var xl = add(t.x, dy*t.dx0);						var xr = add(t.x, dy*t.dx1);						var zl = add(t.z, dy*t.dz0);						var zr = add(t.z, dy*t.dz1);						var dz = div(sub(zr,zl),sub(xr,xl));						draw_segment(zbuffer,cbuffer,y, round(xl),round(xr),zl,dz,t.color);					}				}			}			/******************************************************************/			/* wrap up                                                        */			/******************************************************************/			function run()			{				// get the html5 context				var canvas = document.getElementById('canvas');				var context = canvas.getContext('2d');				var data = context.createImageData(256,256);				// prepare the projection matrix				var matrix = identity_matrix();				matrix = matrix_mult(rotation_matrix(0,1,0,31*(2*Math.PI/64)), matrix);				matrix = matrix_mult(rotation_matrix(1,0,0,-0.5), matrix);				matrix = matrix_mult(translation_matrix(0,0,10), matrix);				matrix = matrix_mult(projection_matrix(5,50), matrix);				conv_matrix(matrix);				// process the raw data				var screen_points = transform_points(matrix, points);				var screen_triangles = transform_triangles(screen_points, triangles);				// draw lines				var cbuffer = [];				var zbuffer = [];				for (var y=128-128; y<256; y++) {					draw_line(screen_triangles, zbuffer,cbuffer,y-128);					for (var x=0; x<256; x++) {						var c = palette[cbuffer[x]];						data.data[4*(x + 256*y) + 0] = (c>>16)&0xff;						data.data[4*(x + 256*y) + 1] = (c>> 8)&0xff;						data.data[4*(x + 256*y) + 2] = (c>> 0)&0xff;						data.data[4*(x + 256*y) + 3] = 0xff;					}				}				// display result				context.putImageData(data,0,0);			}			// test mesh : a cubevar points = [	{ x:0x00014, y:0x000d6, z:0x3ff8c },	{ x:0x00012, y:0x000c4, z:0x3ff98 },	{ x:0x3fffa, y:0x000aa, z:0x3ffc4 },	{ x:0x3ffda, y:0x00094, z:0x3ffe4 },	{ x:0x3ffb4, y:0x00082, z:0x3fff8 },	{ x:0x3ff92, y:0x00068, z:0x00012 },	{ x:0x3ff9c, y:0x00040, z:0x00014 },	{ x:0x3ffaa, y:0x0003a, z:0x00048 },	{ x:0x3ffae, y:0x00022, z:0x0007e },	{ x:0x3ffac, y:0x3fffc, z:0x000a8 },	{ x:0x3ffac, y:0x3ffd0, z:0x000ba },	{ x:0x3ffac, y:0x3ffa0, z:0x000b6 },	{ x:0x3ffa6, y:0x3ff72, z:0x000b4 },	{ x:0x3ff98, y:0x3ff4a, z:0x000a0 },	{ x:0x3ff78, y:0x3ff30, z:0x000a0 },	{ x:0x3ff60, y:0x3ff10, z:0x000b0 },	{ x:0x3ff7e, y:0x3ff32, z:0x000a0 },	{ x:0x00004, y:0x000b8, z:0x3ffae },	{ x:0x3fffa, y:0x000fc, z:0x3ffb6 },	{ x:0x3ffe4, y:0x000c4, z:0x3ffd4 },	{ x:0x3ffc2, y:0x000a2, z:0x0000c },	{ x:0x3ff92, y:0x0008a, z:0x00032 },	{ x:0x3ff88, y:0x00068, z:0x0005e },	{ x:0x3ff8e, y:0x0004c, z:0x0007e },	{ x:0x3ff90, y:0x0002c, z:0x00092 },	{ x:0x3ff8a, y:0x00006, z:0x0009c },	{ x:0x3ff8a, y:0x3ffde, z:0x000b6 },	{ x:0x3ff90, y:0x3ffb6, z:0x000c4 },	{ x:0x3ff94, y:0x3ff8a, z:0x000ba },	{ x:0x3ff92, y:0x3ff60, z:0x00098 },	{ x:0x3ff7c, y:0x3ff30, z:0x0008c },	{ x:0x3ff62, y:0x3ff14, z:0x000aa },	{ x:0x3ff7e, y:0x3ff2e, z:0x000b0 },	{ x:0x3ff9e, y:0x3ff4a, z:0x000a2 },	{ x:0x3ffea, y:0x000a0, z:0x3ffd6 },	{ x:0x3ffca, y:0x000d0, z:0x3ffc6 },	{ x:0x3ffbc, y:0x000cc, z:0x00002 },	{ x:0x3ff8e, y:0x00098, z:0x00030 },	{ x:0x3ff74, y:0x0008c, z:0x00088 },	{ x:0x3ff64, y:0x00064, z:0x000aa },	{ x:0x3ff62, y:0x0003a, z:0x000c6 },	{ x:0x3ff68, y:0x00012, z:0x000b8 },	{ x:0x3ff62, y:0x3ffea, z:0x000b0 },	{ x:0x3ff6a, y:0x3ffbc, z:0x000c4 },	{ x:0x3ff78, y:0x3ff90, z:0x000bc },	{ x:0x3ff8a, y:0x3ff6c, z:0x0009a },	{ x:0x3ff86, y:0x3ff32, z:0x00082 },	{ x:0x3ff5e, y:0x3ff14, z:0x000a0 },	{ x:0x3ff82, y:0x3ff18, z:0x000ca },	{ x:0x3ff9e, y:0x3ff3a, z:0x000aa },	{ x:0x3ffa6, y:0x3ff72, z:0x000b4 },	{ x:0x3ffc6, y:0x0008c, z:0x3ffe8 },	{ x:0x3ffa6, y:0x000b0, z:0x3ffde },	{ x:0x3ff90, y:0x000ae, z:0x00018 },	{ x:0x3ff5c, y:0x00096, z:0x00058 },	{ x:0x3ff3e, y:0x00086, z:0x0009e },	{ x:0x3ff2c, y:0x0005a, z:0x000d2 },	{ x:0x3ff32, y:0x0001e, z:0x000da },	{ x:0x3ff44, y:0x3fffa, z:0x000b0 },	{ x:0x3ff42, y:0x3ffc6, z:0x000ac },	{ x:0x3ff56, y:0x3ff94, z:0x000b0 },	{ x:0x3ff74, y:0x3ff6e, z:0x00098 },	{ x:0x3ff8a, y:0x3ff40, z:0x0007c },	{ x:0x3ff5a, y:0x3ff10, z:0x0008a },	{ x:0x3ff84, y:0x3ff04, z:0x000bc },	{ x:0x3ffa4, y:0x3ff2c, z:0x000b4 },	{ x:0x3ffac, y:0x3ff6a, z:0x000b2 },	{ x:0x3ffb0, y:0x3ff9e, z:0x000b8 },	{ x:0x3ff9e, y:0x00076, z:0x3fffe },	{ x:0x3ff88, y:0x00098, z:0x3fff6 },	{ x:0x3ff66, y:0x00094, z:0x00030 },	{ x:0x3ff2a, y:0x00092, z:0x00058 },	{ x:0x3ff10, y:0x0006c, z:0x00086 },	{ x:0x3ff08, y:0x00034, z:0x000a2 },	{ x:0x3ff1a, y:0x00000, z:0x0009c },	{ x:0x3ff24, y:0x3ffd2, z:0x0008c },	{ x:0x3ff32, y:0x3ff98, z:0x0008e },	{ x:0x3ff5a, y:0x3ff6c, z:0x00082 },	{ x:0x3ff88, y:0x3ff50, z:0x00074 },	{ x:0x3ff66, y:0x3ff16, z:0x00070 },	{ x:0x3ff84, y:0x3ff06, z:0x000a0 },	{ x:0x3ffb4, y:0x3ff26, z:0x000b4 },	{ x:0x3ffb4, y:0x3ff5a, z:0x000b2 },	{ x:0x3ffbc, y:0x3ff98, z:0x000ba },	{ x:0x3ffae, y:0x3ffce, z:0x000b4 },	{ x:0x3ff76, y:0x00076, z:0x3fffc },	{ x:0x3ff62, y:0x0008e, z:0x00008 },	{ x:0x3ff38, y:0x00094, z:0x00020 },	{ x:0x3ff10, y:0x00078, z:0x00034 },	{ x:0x3ff06, y:0x00044, z:0x0004c },	{ x:0x3ff06, y:0x00010, z:0x00062 },	{ x:0x3ff16, y:0x3ffe0, z:0x00064 },	{ x:0x3ff1e, y:0x3ffa2, z:0x00064 },	{ x:0x3ff46, y:0x3ff6e, z:0x00060 },	{ x:0x3ff7c, y:0x3ff52, z:0x00056 },	{ x:0x3ff7a, y:0x3ff1e, z:0x0005c },	{ x:0x3ff82, y:0x3ff04, z:0x0008c },	{ x:0x3ffb2, y:0x3ff14, z:0x000b8 },	{ x:0x3ffcc, y:0x3ff52, z:0x000a4 },	{ x:0x3ffc8, y:0x3ff88, z:0x000b2 },	{ x:0x3ffbe, y:0x3ffc8, z:0x000be },	{ x:0x3ffb0, y:0x3fffc, z:0x000a6 },	{ x:0x3ff66, y:0x00090, z:0x3ffd8 },	{ x:0x3ff4e, y:0x000a4, z:0x3ffe6 },	{ x:0x3ff36, y:0x00084, z:0x3fff6 },	{ x:0x3ff20, y:0x00058, z:0x00006 },	{ x:0x3ff10, y:0x00024, z:0x00014 },	{ x:0x3ff1a, y:0x3ffee, z:0x00028 },	{ x:0x3ff12, y:0x3ffb0, z:0x00034 },	{ x:0x3ff34, y:0x3ff76, z:0x0003a },	{ x:0x3ff70, y:0x3ff52, z:0x00034 },	{ x:0x3ff86, y:0x3ff26, z:0x0004a },	{ x:0x3ff7e, y:0x3ff02, z:0x0007c },	{ x:0x3ffb6, y:0x3ff0a, z:0x000ba },	{ x:0x3ffdc, y:0x3ff38, z:0x000b6 },	{ x:0x3ffe6, y:0x3ff74, z:0x000be },	{ x:0x3ffd8, y:0x3ffae, z:0x000c2 },	{ x:0x3ffc8, y:0x3fff0, z:0x000ae },	{ x:0x3ffae, y:0x00020, z:0x0007c },	{ x:0x3ff66, y:0x000a6, z:0x3ffa8 },	{ x:0x3ff40, y:0x000b4, z:0x3ffb2 },	{ x:0x3ff3c, y:0x00086, z:0x3ffc4 },	{ x:0x3ff42, y:0x0004c, z:0x3ffe6 },	{ x:0x3ff32, y:0x00006, z:0x3fffa },	{ x:0x3ff20, y:0x3ffc4, z:0x3fff8 },	{ x:0x3ff2c, y:0x3ff88, z:0x0000a },	{ x:0x3ff64, y:0x3ff58, z:0x00018 },	{ x:0x3ff64, y:0x3ff26, z:0x0002a },	{ x:0x3ff76, y:0x3ff02, z:0x0005c },	{ x:0x3ffb6, y:0x3ff04, z:0x000a2 },	{ x:0x3ffdc, y:0x3ff14, z:0x000e6 },	{ x:0x3fffa, y:0x3ff4e, z:0x000d8 },	{ x:0x3fff4, y:0x3ff94, z:0x000ee },	{ x:0x3ffea, y:0x3ffd2, z:0x000c6 },	{ x:0x3ffd6, y:0x00010, z:0x00092 },	{ x:0x3ffae, y:0x00036, z:0x0004a },	{ x:0x3ff64, y:0x000ba, z:0x3ff70 },	{ x:0x3ff32, y:0x000bc, z:0x3ff72 },	{ x:0x3ff42, y:0x00080, z:0x3ff96 },	{ x:0x3ff52, y:0x0003a, z:0x3ffde },	{ x:0x3ff40, y:0x3ffec, z:0x3ffda },	{ x:0x3ff3a, y:0x3ffa6, z:0x3ffd2 },	{ x:0x3ff58, y:0x3ff6c, z:0x3fff2 },	{ x:0x3ff72, y:0x3ff2e, z:0x00004 },	{ x:0x3ff56, y:0x3ff02, z:0x00010 },	{ x:0x3ffa0, y:0x3ff04, z:0x0004c },	{ x:0x3ffd8, y:0x3ff10, z:0x0009a },	{ x:0x0000c, y:0x3ff12, z:0x000dc },	{ x:0x0001a, y:0x3ff5c, z:0x000f0 },	{ x:0x00018, y:0x3ffb0, z:0x000f8 },	{ x:0x00008, y:0x3ffee, z:0x000ba },	{ x:0x3ffe2, y:0x00024, z:0x00072 },	{ x:0x3ffa4, y:0x0003c, z:0x00014 },	{ x:0x3ff64, y:0x000ca, z:0x3ff3a },	{ x:0x3ff46, y:0x000c2, z:0x3ff3e },	{ x:0x3ff50, y:0x00078, z:0x3ff8a },	{ x:0x3ff60, y:0x00028, z:0x3ffe0 },	{ x:0x3ff54, y:0x3ffda, z:0x3ffc4 },	{ x:0x3ff5e, y:0x3ff90, z:0x3ffbc },	{ x:0x3ff82, y:0x3ff5a, z:0x3ffe6 },	{ x:0x3ff84, y:0x3ff1a, z:0x3ffdc },	{ x:0x3ff94, y:0x3ff00, z:0x3fffc },	{ x:0x3ffcc, y:0x3ff02, z:0x0003a },	{ x:0x00000, y:0x3ff12, z:0x0008a },	{ x:0x00030, y:0x3ff16, z:0x000cc },	{ x:0x00046, y:0x3ff68, z:0x000f2 },	{ x:0x00040, y:0x3ffc6, z:0x000ec },	{ x:0x00020, y:0x0000e, z:0x000b0 },	{ x:0x3fff4, y:0x00036, z:0x00054 },	{ x:0x3ffc0, y:0x0002e, z:0x3ffee },	{ x:0x3ff72, y:0x000c6, z:0x3ff08 },	{ x:0x3ff56, y:0x000aa, z:0x3ff20 },	{ x:0x3ff56, y:0x00072, z:0x3ffb2 },	{ x:0x3ff68, y:0x00018, z:0x3ffdc },	{ x:0x3ff6c, y:0x3ffce, z:0x3ffb6 },	{ x:0x3ff86, y:0x3ff88, z:0x3ffb8 },	{ x:0x3ffaa, y:0x3ff48, z:0x3ffd8 },	{ x:0x3ffa0, y:0x3ff10, z:0x3ffa8 },	{ x:0x3ffc2, y:0x3ff10, z:0x3ffd6 },	{ x:0x3fff8, y:0x3ff10, z:0x00026 },	{ x:0x0002c, y:0x3ff12, z:0x00078 },	{ x:0x00058, y:0x3ff1a, z:0x000c2 },	{ x:0x0006a, y:0x3ff76, z:0x000e0 },	{ x:0x00062, y:0x3ffd8, z:0x000d0 },	{ x:0x00042, y:0x00028, z:0x00096 },	{ x:0x00012, y:0x00040, z:0x0002e },	{ x:0x3ffd8, y:0x00018, z:0x3ffd0 },	{ x:0x3ff66, y:0x000ca, z:0x3ff40 },	{ x:0x3ff5a, y:0x0008a, z:0x3ff3e },	{ x:0x3ff5c, y:0x00068, z:0x3ffd6 },	{ x:0x3ff70, y:0x0000e, z:0x3ffcc },	{ x:0x3ff82, y:0x3ffc6, z:0x3ffa6 },	{ x:0x3ffa6, y:0x3ff84, z:0x3ffb8 },	{ x:0x3ffce, y:0x3ff48, z:0x3ffcc },	{ x:0x3ffc8, y:0x3ff16, z:0x3ff84 },	{ x:0x3fff4, y:0x3ff0c, z:0x3ffb6 },	{ x:0x00020, y:0x3ff12, z:0x00006 },	{ x:0x00052, y:0x3ff02, z:0x0005e },	{ x:0x00080, y:0x3ff1c, z:0x000b0 },	{ x:0x00086, y:0x3ff7e, z:0x000c4 },	{ x:0x00086, y:0x3ffe2, z:0x000b8 },	{ x:0x00068, y:0x00036, z:0x00072 },	{ x:0x00032, y:0x0003e, z:0x00004 },	{ x:0x3fff2, y:0x00000, z:0x3ffae },	{ x:0x3ff62, y:0x000b6, z:0x3ff70 },	{ x:0x3ff62, y:0x00088, z:0x3ff72 },	{ x:0x3ff66, y:0x0005c, z:0x3ffe6 },	{ x:0x3ff7c, y:0x00008, z:0x3ffc0 },	{ x:0x3ff9a, y:0x3ffc4, z:0x3ffaa },	{ x:0x3ffc2, y:0x3ff8e, z:0x3ffae },	{ x:0x3ffd8, y:0x3ff5a, z:0x3ff94 },	{ x:0x3fffc, y:0x3ff2a, z:0x3ff8c },	{ x:0x00026, y:0x3ff02, z:0x3ffa4 },	{ x:0x0004e, y:0x3ff0c, z:0x3ffec },	{ x:0x00072, y:0x3ff08, z:0x0003e },	{ x:0x0009a, y:0x3ff26, z:0x0008e },	{ x:0x000a6, y:0x3ff7e, z:0x000a6 },	{ x:0x000a6, y:0x3ffe0, z:0x00098 },	{ x:0x0008a, y:0x0002a, z:0x0004a },	{ x:0x00054, y:0x0002e, z:0x3ffe2 },	{ x:0x00018, y:0x3ffee, z:0x3ffa4 },	{ x:0x3ff68, y:0x000a6, z:0x3ffa6 },	{ x:0x3ff66, y:0x00080, z:0x3ffa8 },	{ x:0x3ff72, y:0x0004a, z:0x3ffea },	{ x:0x3ff8e, y:0x00002, z:0x3ffb8 },	{ x:0x3ffb0, y:0x3ffcc, z:0x3ffa4 },	{ x:0x3ffd0, y:0x3ff9a, z:0x3ff80 },	{ x:0x3fff0, y:0x3ff72, z:0x3ff64 },	{ x:0x00020, y:0x3ff4c, z:0x3ff78 },	{ x:0x0004c, y:0x3ff26, z:0x3ff9c },	{ x:0x00074, y:0x3ff0c, z:0x3ffce },	{ x:0x0009a, y:0x3ff06, z:0x0001e },	{ x:0x000bc, y:0x3ff1c, z:0x0006e },	{ x:0x000ba, y:0x3ff68, z:0x00082 },	{ x:0x000be, y:0x3ffc8, z:0x00076 },	{ x:0x000a8, y:0x0000a, z:0x00034 },	{ x:0x0007c, y:0x00016, z:0x3ffd6 },	{ x:0x0003e, y:0x3ffda, z:0x3ffa2 },	{ x:0x3ff66, y:0x0008c, z:0x3ffda },	{ x:0x3ff64, y:0x00070, z:0x3ffdc },	{ x:0x3ff7e, y:0x00038, z:0x3ffec },	{ x:0x3ffa2, y:0x00006, z:0x3ffbe },	{ x:0x3ffc6, y:0x3ffd6, z:0x3ffa6 },	{ x:0x3ffe6, y:0x3ffba, z:0x3ff70 },	{ x:0x00012, y:0x3ff96, z:0x3ff66 },	{ x:0x0003e, y:0x3ff74, z:0x3ff76 },	{ x:0x0006c, y:0x3ff54, z:0x3ff8c },	{ x:0x00094, y:0x3ff38, z:0x3ffbc },	{ x:0x000b4, y:0x3ff26, z:0x3fff0 },	{ x:0x000dc, y:0x3ff28, z:0x0003a },	{ x:0x000de, y:0x3ff58, z:0x00080 },	{ x:0x000ca, y:0x3ffa0, z:0x0005e },	{ x:0x000c2, y:0x3ffe0, z:0x00024 },	{ x:0x0009e, y:0x3fff4, z:0x3ffd6 },	{ x:0x0006c, y:0x3ffd4, z:0x3ffa2 },	{ x:0x3ff74, y:0x00078, z:0x3fffc },	{ x:0x3ff86, y:0x00054, z:0x3fffa },	{ x:0x3ff98, y:0x00032, z:0x3ffe4 },	{ x:0x3ffba, y:0x0000e, z:0x3ffc2 },	{ x:0x3ffde, y:0x3ffea, z:0x3ffa2 },	{ x:0x00002, y:0x3ffd2, z:0x3ff86 },	{ x:0x0002e, y:0x3ffc0, z:0x3ff72 },	{ x:0x0005a, y:0x3ffa2, z:0x3ff7e },	{ x:0x00082, y:0x3ff8a, z:0x3ff96 },	{ x:0x000a2, y:0x3ff70, z:0x3ffbc },	{ x:0x000ba, y:0x3ff5a, z:0x3fff2 },	{ x:0x000ea, y:0x3ff4e, z:0x00004 },	{ x:0x000fa, y:0x3ff5a, z:0x0004e },	{ x:0x000dc, y:0x3ff82, z:0x00054 },	{ x:0x000cc, y:0x3ffb0, z:0x00024 },	{ x:0x000b8, y:0x3ffca, z:0x3ffe4 },	{ x:0x00092, y:0x3ffc4, z:0x3ffb0 },	{ x:0x3ff94, y:0x0006a, z:0x00012 },	{ x:0x3ffa0, y:0x0003e, z:0x00010 },	{ x:0x3ffbe, y:0x00030, z:0x3ffec },	{ x:0x3ffd8, y:0x00018, z:0x3ffce },	{ x:0x3fff2, y:0x00000, z:0x3ffb0 },	{ x:0x00018, y:0x3ffee, z:0x3ffa2 },	{ x:0x0003e, y:0x3ffdc, z:0x3ffa0 },	{ x:0x0006a, y:0x3ffd2, z:0x3ffa2 },	{ x:0x00094, y:0x3ffc4, z:0x3ffae },	{ x:0x000b2, y:0x3ffaa, z:0x3ffc6 },	{ x:0x000c6, y:0x3ff96, z:0x3fff4 },	{ x:0x000d2, y:0x3ff80, z:0x0001c },	{ x:0x000fa, y:0x3ff76, z:0x0002e },	{ x:0x000fa, y:0x3ff78, z:0x0002e },	{ x:0x000ce, y:0x3ff7e, z:0x0001a },	{ x:0x000c0, y:0x3ff9a, z:0x3fff2 },	{ x:0x000b4, y:0x3ffac, z:0x3ffc8 },];var triangles = [	{ a:0x000, b:0x011, c:0x012, d:0x001 },	{ a:0x000, b:0x012, c:0x001, d:0x003 },	{ a:0x001, b:0x012, c:0x013, d:0x001 },	{ a:0x001, b:0x013, c:0x002, d:0x003 },	{ a:0x002, b:0x013, c:0x014, d:0x001 },	{ a:0x002, b:0x014, c:0x003, d:0x003 },	{ a:0x003, b:0x014, c:0x015, d:0x001 },	{ a:0x003, b:0x015, c:0x004, d:0x003 },	{ a:0x004, b:0x015, c:0x016, d:0x001 },	{ a:0x004, b:0x016, c:0x005, d:0x003 },	{ a:0x005, b:0x016, c:0x017, d:0x001 },	{ a:0x005, b:0x017, c:0x006, d:0x003 },	{ a:0x006, b:0x017, c:0x018, d:0x001 },	{ a:0x006, b:0x018, c:0x007, d:0x003 },	{ a:0x007, b:0x018, c:0x019, d:0x001 },	{ a:0x007, b:0x019, c:0x008, d:0x003 },	{ a:0x008, b:0x019, c:0x01a, d:0x001 },	{ a:0x008, b:0x01a, c:0x009, d:0x003 },	{ a:0x009, b:0x01a, c:0x01b, d:0x001 },	{ a:0x009, b:0x01b, c:0x00a, d:0x003 },	{ a:0x00a, b:0x01b, c:0x01c, d:0x001 },	{ a:0x00a, b:0x01c, c:0x00b, d:0x003 },	{ a:0x00b, b:0x01c, c:0x01d, d:0x001 },	{ a:0x00b, b:0x01d, c:0x00c, d:0x003 },	{ a:0x00c, b:0x01d, c:0x01e, d:0x001 },	{ a:0x00c, b:0x01e, c:0x00d, d:0x003 },	{ a:0x00d, b:0x01e, c:0x01f, d:0x001 },	{ a:0x00d, b:0x01f, c:0x00e, d:0x003 },	{ a:0x00e, b:0x01f, c:0x020, d:0x001 },	{ a:0x00e, b:0x020, c:0x00f, d:0x003 },	{ a:0x00f, b:0x020, c:0x021, d:0x001 },	{ a:0x00f, b:0x021, c:0x010, d:0x003 },	{ a:0x011, b:0x022, c:0x023, d:0x001 },	{ a:0x011, b:0x023, c:0x012, d:0x003 },	{ a:0x012, b:0x023, c:0x024, d:0x001 },	{ a:0x012, b:0x024, c:0x013, d:0x003 },	{ a:0x013, b:0x024, c:0x025, d:0x001 },	{ a:0x013, b:0x025, c:0x014, d:0x003 },	{ a:0x014, b:0x025, c:0x026, d:0x001 },	{ a:0x014, b:0x026, c:0x015, d:0x003 },	{ a:0x015, b:0x026, c:0x027, d:0x001 },	{ a:0x015, b:0x027, c:0x016, d:0x003 },	{ a:0x016, b:0x027, c:0x028, d:0x001 },	{ a:0x016, b:0x028, c:0x017, d:0x003 },	{ a:0x017, b:0x028, c:0x029, d:0x001 },	{ a:0x017, b:0x029, c:0x018, d:0x003 },	{ a:0x018, b:0x029, c:0x02a, d:0x001 },	{ a:0x018, b:0x02a, c:0x019, d:0x003 },	{ a:0x019, b:0x02a, c:0x02b, d:0x001 },	{ a:0x019, b:0x02b, c:0x01a, d:0x003 },	{ a:0x01a, b:0x02b, c:0x02c, d:0x001 },	{ a:0x01a, b:0x02c, c:0x01b, d:0x003 },	{ a:0x01b, b:0x02c, c:0x02d, d:0x001 },	{ a:0x01b, b:0x02d, c:0x01c, d:0x003 },	{ a:0x01c, b:0x02d, c:0x02e, d:0x001 },	{ a:0x01c, b:0x02e, c:0x01d, d:0x003 },	{ a:0x01d, b:0x02e, c:0x02f, d:0x001 },	{ a:0x01d, b:0x02f, c:0x01e, d:0x003 },	{ a:0x01e, b:0x02f, c:0x030, d:0x001 },	{ a:0x01e, b:0x030, c:0x01f, d:0x003 },	{ a:0x01f, b:0x030, c:0x031, d:0x001 },	{ a:0x01f, b:0x031, c:0x020, d:0x003 },	{ a:0x020, b:0x031, c:0x032, d:0x001 },	{ a:0x020, b:0x032, c:0x021, d:0x003 },	{ a:0x022, b:0x033, c:0x034, d:0x001 },	{ a:0x022, b:0x034, c:0x023, d:0x003 },	{ a:0x023, b:0x034, c:0x035, d:0x001 },	{ a:0x023, b:0x035, c:0x024, d:0x003 },	{ a:0x024, b:0x035, c:0x036, d:0x001 },	{ a:0x024, b:0x036, c:0x025, d:0x003 },	{ a:0x025, b:0x036, c:0x037, d:0x001 },	{ a:0x025, b:0x037, c:0x026, d:0x003 },	{ a:0x026, b:0x037, c:0x038, d:0x001 },	{ a:0x026, b:0x038, c:0x027, d:0x003 },	{ a:0x027, b:0x038, c:0x039, d:0x001 },	{ a:0x027, b:0x039, c:0x028, d:0x003 },	{ a:0x028, b:0x039, c:0x03a, d:0x001 },	{ a:0x028, b:0x03a, c:0x029, d:0x003 },	{ a:0x029, b:0x03a, c:0x03b, d:0x001 },	{ a:0x029, b:0x03b, c:0x02a, d:0x003 },	{ a:0x02a, b:0x03b, c:0x03c, d:0x001 },	{ a:0x02a, b:0x03c, c:0x02b, d:0x003 },	{ a:0x02b, b:0x03c, c:0x03d, d:0x001 },	{ a:0x02b, b:0x03d, c:0x02c, d:0x003 },	{ a:0x02c, b:0x03d, c:0x03e, d:0x001 },	{ a:0x02c, b:0x03e, c:0x02d, d:0x003 },	{ a:0x02d, b:0x03e, c:0x03f, d:0x001 },	{ a:0x02d, b:0x03f, c:0x02e, d:0x003 },	{ a:0x02e, b:0x03f, c:0x040, d:0x001 },	{ a:0x02e, b:0x040, c:0x02f, d:0x003 },	{ a:0x02f, b:0x040, c:0x041, d:0x001 },	{ a:0x02f, b:0x041, c:0x030, d:0x003 },	{ a:0x030, b:0x041, c:0x042, d:0x001 },	{ a:0x030, b:0x042, c:0x031, d:0x003 },	{ a:0x031, b:0x042, c:0x043, d:0x001 },	{ a:0x031, b:0x043, c:0x032, d:0x003 },	{ a:0x033, b:0x044, c:0x045, d:0x001 },	{ a:0x033, b:0x045, c:0x034, d:0x003 },	{ a:0x034, b:0x045, c:0x046, d:0x001 },	{ a:0x034, b:0x046, c:0x035, d:0x003 },	{ a:0x035, b:0x046, c:0x047, d:0x001 },	{ a:0x035, b:0x047, c:0x036, d:0x003 },	{ a:0x036, b:0x047, c:0x048, d:0x001 },	{ a:0x036, b:0x048, c:0x037, d:0x003 },	{ a:0x037, b:0x048, c:0x049, d:0x001 },	{ a:0x037, b:0x049, c:0x038, d:0x003 },	{ a:0x038, b:0x049, c:0x04a, d:0x001 },	{ a:0x038, b:0x04a, c:0x039, d:0x003 },	{ a:0x039, b:0x04a, c:0x04b, d:0x001 },	{ a:0x039, b:0x04b, c:0x03a, d:0x003 },	{ a:0x03a, b:0x04b, c:0x04c, d:0x001 },	{ a:0x03a, b:0x04c, c:0x03b, d:0x003 },	{ a:0x03b, b:0x04c, c:0x04d, d:0x001 },	{ a:0x03b, b:0x04d, c:0x03c, d:0x003 },	{ a:0x03c, b:0x04d, c:0x04e, d:0x001 },	{ a:0x03c, b:0x04e, c:0x03d, d:0x003 },	{ a:0x03d, b:0x04e, c:0x04f, d:0x001 },	{ a:0x03d, b:0x04f, c:0x03e, d:0x003 },	{ a:0x03e, b:0x04f, c:0x050, d:0x001 },	{ a:0x03e, b:0x050, c:0x03f, d:0x003 },	{ a:0x03f, b:0x050, c:0x051, d:0x001 },	{ a:0x03f, b:0x051, c:0x040, d:0x003 },	{ a:0x040, b:0x051, c:0x052, d:0x001 },	{ a:0x040, b:0x052, c:0x041, d:0x003 },	{ a:0x041, b:0x052, c:0x053, d:0x001 },	{ a:0x041, b:0x053, c:0x042, d:0x003 },	{ a:0x042, b:0x053, c:0x054, d:0x001 },	{ a:0x042, b:0x054, c:0x043, d:0x003 },	{ a:0x044, b:0x055, c:0x056, d:0x001 },	{ a:0x044, b:0x056, c:0x045, d:0x003 },	{ a:0x045, b:0x056, c:0x057, d:0x001 },	{ a:0x045, b:0x057, c:0x046, d:0x003 },	{ a:0x046, b:0x057, c:0x058, d:0x001 },	{ a:0x046, b:0x058, c:0x047, d:0x003 },	{ a:0x047, b:0x058, c:0x059, d:0x001 },	{ a:0x047, b:0x059, c:0x048, d:0x003 },	{ a:0x048, b:0x059, c:0x05a, d:0x001 },	{ a:0x048, b:0x05a, c:0x049, d:0x003 },	{ a:0x049, b:0x05a, c:0x05b, d:0x001 },	{ a:0x049, b:0x05b, c:0x04a, d:0x003 },	{ a:0x04a, b:0x05b, c:0x05c, d:0x001 },	{ a:0x04a, b:0x05c, c:0x04b, d:0x003 },	{ a:0x04b, b:0x05c, c:0x05d, d:0x001 },	{ a:0x04b, b:0x05d, c:0x04c, d:0x003 },	{ a:0x04c, b:0x05d, c:0x05e, d:0x001 },	{ a:0x04c, b:0x05e, c:0x04d, d:0x003 },	{ a:0x04d, b:0x05e, c:0x05f, d:0x001 },	{ a:0x04d, b:0x05f, c:0x04e, d:0x003 },	{ a:0x04e, b:0x05f, c:0x060, d:0x001 },	{ a:0x04e, b:0x060, c:0x04f, d:0x003 },	{ a:0x04f, b:0x060, c:0x061, d:0x001 },	{ a:0x04f, b:0x061, c:0x050, d:0x003 },	{ a:0x050, b:0x061, c:0x062, d:0x001 },	{ a:0x050, b:0x062, c:0x051, d:0x003 },	{ a:0x051, b:0x062, c:0x063, d:0x001 },	{ a:0x051, b:0x063, c:0x052, d:0x003 },	{ a:0x052, b:0x063, c:0x064, d:0x001 },	{ a:0x052, b:0x064, c:0x053, d:0x003 },	{ a:0x053, b:0x064, c:0x065, d:0x001 },	{ a:0x053, b:0x065, c:0x054, d:0x003 },	{ a:0x055, b:0x066, c:0x067, d:0x001 },	{ a:0x055, b:0x067, c:0x056, d:0x003 },	{ a:0x056, b:0x067, c:0x068, d:0x001 },	{ a:0x056, b:0x068, c:0x057, d:0x003 },	{ a:0x057, b:0x068, c:0x069, d:0x001 },	{ a:0x057, b:0x069, c:0x058, d:0x003 },	{ a:0x058, b:0x069, c:0x06a, d:0x001 },	{ a:0x058, b:0x06a, c:0x059, d:0x003 },	{ a:0x059, b:0x06a, c:0x06b, d:0x001 },	{ a:0x059, b:0x06b, c:0x05a, d:0x003 },	{ a:0x05a, b:0x06b, c:0x06c, d:0x001 },	{ a:0x05a, b:0x06c, c:0x05b, d:0x003 },	{ a:0x05b, b:0x06c, c:0x06d, d:0x001 },	{ a:0x05b, b:0x06d, c:0x05c, d:0x003 },	{ a:0x05c, b:0x06d, c:0x06e, d:0x001 },	{ a:0x05c, b:0x06e, c:0x05d, d:0x003 },	{ a:0x05d, b:0x06e, c:0x06f, d:0x001 },	{ a:0x05d, b:0x06f, c:0x05e, d:0x003 },	{ a:0x05e, b:0x06f, c:0x070, d:0x001 },	{ a:0x05e, b:0x070, c:0x05f, d:0x003 },	{ a:0x05f, b:0x070, c:0x071, d:0x001 },	{ a:0x05f, b:0x071, c:0x060, d:0x003 },	{ a:0x060, b:0x071, c:0x072, d:0x001 },	{ a:0x060, b:0x072, c:0x061, d:0x003 },	{ a:0x061, b:0x072, c:0x073, d:0x001 },	{ a:0x061, b:0x073, c:0x062, d:0x003 },	{ a:0x062, b:0x073, c:0x074, d:0x001 },	{ a:0x062, b:0x074, c:0x063, d:0x003 },	{ a:0x063, b:0x074, c:0x075, d:0x001 },	{ a:0x063, b:0x075, c:0x064, d:0x003 },	{ a:0x064, b:0x075, c:0x076, d:0x001 },	{ a:0x064, b:0x076, c:0x065, d:0x003 },	{ a:0x066, b:0x077, c:0x078, d:0x001 },	{ a:0x066, b:0x078, c:0x067, d:0x003 },	{ a:0x067, b:0x078, c:0x079, d:0x001 },	{ a:0x067, b:0x079, c:0x068, d:0x003 },	{ a:0x068, b:0x079, c:0x07a, d:0x001 },	{ a:0x068, b:0x07a, c:0x069, d:0x003 },	{ a:0x069, b:0x07a, c:0x07b, d:0x001 },	{ a:0x069, b:0x07b, c:0x06a, d:0x003 },	{ a:0x06a, b:0x07b, c:0x07c, d:0x001 },	{ a:0x06a, b:0x07c, c:0x06b, d:0x003 },	{ a:0x06b, b:0x07c, c:0x07d, d:0x001 },	{ a:0x06b, b:0x07d, c:0x06c, d:0x003 },	{ a:0x06c, b:0x07d, c:0x07e, d:0x001 },	{ a:0x06c, b:0x07e, c:0x06d, d:0x003 },	{ a:0x06d, b:0x07e, c:0x07f, d:0x001 },	{ a:0x06d, b:0x07f, c:0x06e, d:0x003 },	{ a:0x06e, b:0x07f, c:0x080, d:0x001 },	{ a:0x06e, b:0x080, c:0x06f, d:0x003 },	{ a:0x06f, b:0x080, c:0x081, d:0x001 },	{ a:0x06f, b:0x081, c:0x070, d:0x003 },	{ a:0x070, b:0x081, c:0x082, d:0x001 },	{ a:0x070, b:0x082, c:0x071, d:0x003 },	{ a:0x071, b:0x082, c:0x083, d:0x001 },	{ a:0x071, b:0x083, c:0x072, d:0x003 },	{ a:0x072, b:0x083, c:0x084, d:0x001 },	{ a:0x072, b:0x084, c:0x073, d:0x003 },	{ a:0x073, b:0x084, c:0x085, d:0x001 },	{ a:0x073, b:0x085, c:0x074, d:0x003 },	{ a:0x074, b:0x085, c:0x086, d:0x001 },	{ a:0x074, b:0x086, c:0x075, d:0x003 },	{ a:0x075, b:0x086, c:0x087, d:0x001 },	{ a:0x075, b:0x087, c:0x076, d:0x003 },	{ a:0x077, b:0x088, c:0x089, d:0x001 },	{ a:0x077, b:0x089, c:0x078, d:0x003 },	{ a:0x078, b:0x089, c:0x08a, d:0x001 },	{ a:0x078, b:0x08a, c:0x079, d:0x003 },	{ a:0x079, b:0x08a, c:0x08b, d:0x001 },	{ a:0x079, b:0x08b, c:0x07a, d:0x003 },	{ a:0x07a, b:0x08b, c:0x08c, d:0x001 },	{ a:0x07a, b:0x08c, c:0x07b, d:0x003 },	{ a:0x07b, b:0x08c, c:0x08d, d:0x001 },	{ a:0x07b, b:0x08d, c:0x07c, d:0x003 },	{ a:0x07c, b:0x08d, c:0x08e, d:0x001 },	{ a:0x07c, b:0x08e, c:0x07d, d:0x003 },	{ a:0x07d, b:0x08e, c:0x08f, d:0x001 },	{ a:0x07d, b:0x08f, c:0x07e, d:0x003 },	{ a:0x07e, b:0x08f, c:0x090, d:0x001 },	{ a:0x07e, b:0x090, c:0x07f, d:0x003 },	{ a:0x07f, b:0x090, c:0x091, d:0x001 },	{ a:0x07f, b:0x091, c:0x080, d:0x003 },	{ a:0x080, b:0x091, c:0x092, d:0x001 },	{ a:0x080, b:0x092, c:0x081, d:0x003 },	{ a:0x081, b:0x092, c:0x093, d:0x001 },	{ a:0x081, b:0x093, c:0x082, d:0x003 },	{ a:0x082, b:0x093, c:0x094, d:0x001 },	{ a:0x082, b:0x094, c:0x083, d:0x003 },	{ a:0x083, b:0x094, c:0x095, d:0x001 },	{ a:0x083, b:0x095, c:0x084, d:0x003 },	{ a:0x084, b:0x095, c:0x096, d:0x001 },	{ a:0x084, b:0x096, c:0x085, d:0x003 },	{ a:0x085, b:0x096, c:0x097, d:0x001 },	{ a:0x085, b:0x097, c:0x086, d:0x003 },	{ a:0x086, b:0x097, c:0x098, d:0x001 },	{ a:0x086, b:0x098, c:0x087, d:0x003 },	{ a:0x088, b:0x099, c:0x09a, d:0x001 },	{ a:0x088, b:0x09a, c:0x089, d:0x003 },	{ a:0x089, b:0x09a, c:0x09b, d:0x001 },	{ a:0x089, b:0x09b, c:0x08a, d:0x003 },	{ a:0x08a, b:0x09b, c:0x09c, d:0x001 },	{ a:0x08a, b:0x09c, c:0x08b, d:0x003 },	{ a:0x08b, b:0x09c, c:0x09d, d:0x001 },	{ a:0x08b, b:0x09d, c:0x08c, d:0x003 },	{ a:0x08c, b:0x09d, c:0x09e, d:0x001 },	{ a:0x08c, b:0x09e, c:0x08d, d:0x003 },	{ a:0x08d, b:0x09e, c:0x09f, d:0x001 },	{ a:0x08d, b:0x09f, c:0x08e, d:0x003 },	{ a:0x08e, b:0x09f, c:0x0a0, d:0x001 },	{ a:0x08e, b:0x0a0, c:0x08f, d:0x003 },	{ a:0x08f, b:0x0a0, c:0x0a1, d:0x001 },	{ a:0x08f, b:0x0a1, c:0x090, d:0x003 },	{ a:0x090, b:0x0a1, c:0x0a2, d:0x001 },	{ a:0x090, b:0x0a2, c:0x091, d:0x003 },	{ a:0x091, b:0x0a2, c:0x0a3, d:0x001 },	{ a:0x091, b:0x0a3, c:0x092, d:0x003 },	{ a:0x092, b:0x0a3, c:0x0a4, d:0x001 },	{ a:0x092, b:0x0a4, c:0x093, d:0x003 },	{ a:0x093, b:0x0a4, c:0x0a5, d:0x001 },	{ a:0x093, b:0x0a5, c:0x094, d:0x003 },	{ a:0x094, b:0x0a5, c:0x0a6, d:0x001 },	{ a:0x094, b:0x0a6, c:0x095, d:0x003 },	{ a:0x095, b:0x0a6, c:0x0a7, d:0x001 },	{ a:0x095, b:0x0a7, c:0x096, d:0x003 },	{ a:0x096, b:0x0a7, c:0x0a8, d:0x001 },	{ a:0x096, b:0x0a8, c:0x097, d:0x003 },	{ a:0x097, b:0x0a8, c:0x0a9, d:0x001 },	{ a:0x097, b:0x0a9, c:0x098, d:0x003 },	{ a:0x099, b:0x0aa, c:0x0ab, d:0x001 },	{ a:0x099, b:0x0ab, c:0x09a, d:0x003 },	{ a:0x09a, b:0x0ab, c:0x0ac, d:0x001 },	{ a:0x09a, b:0x0ac, c:0x09b, d:0x003 },	{ a:0x09b, b:0x0ac, c:0x0ad, d:0x001 },	{ a:0x09b, b:0x0ad, c:0x09c, d:0x003 },	{ a:0x09c, b:0x0ad, c:0x0ae, d:0x001 },	{ a:0x09c, b:0x0ae, c:0x09d, d:0x003 },	{ a:0x09d, b:0x0ae, c:0x0af, d:0x001 },	{ a:0x09d, b:0x0af, c:0x09e, d:0x003 },	{ a:0x09e, b:0x0af, c:0x0b0, d:0x001 },	{ a:0x09e, b:0x0b0, c:0x09f, d:0x003 },	{ a:0x09f, b:0x0b0, c:0x0b1, d:0x001 },	{ a:0x09f, b:0x0b1, c:0x0a0, d:0x003 },	{ a:0x0a0, b:0x0b1, c:0x0b2, d:0x001 },	{ a:0x0a0, b:0x0b2, c:0x0a1, d:0x003 },	{ a:0x0a1, b:0x0b2, c:0x0b3, d:0x001 },	{ a:0x0a1, b:0x0b3, c:0x0a2, d:0x003 },	{ a:0x0a2, b:0x0b3, c:0x0b4, d:0x001 },	{ a:0x0a2, b:0x0b4, c:0x0a3, d:0x003 },	{ a:0x0a3, b:0x0b4, c:0x0b5, d:0x001 },	{ a:0x0a3, b:0x0b5, c:0x0a4, d:0x003 },	{ a:0x0a4, b:0x0b5, c:0x0b6, d:0x001 },	{ a:0x0a4, b:0x0b6, c:0x0a5, d:0x003 },	{ a:0x0a5, b:0x0b6, c:0x0b7, d:0x001 },	{ a:0x0a5, b:0x0b7, c:0x0a6, d:0x003 },	{ a:0x0a6, b:0x0b7, c:0x0b8, d:0x001 },	{ a:0x0a6, b:0x0b8, c:0x0a7, d:0x003 },	{ a:0x0a7, b:0x0b8, c:0x0b9, d:0x001 },	{ a:0x0a7, b:0x0b9, c:0x0a8, d:0x003 },	{ a:0x0a8, b:0x0b9, c:0x0ba, d:0x001 },	{ a:0x0a8, b:0x0ba, c:0x0a9, d:0x003 },	{ a:0x0aa, b:0x0bb, c:0x0bc, d:0x001 },	{ a:0x0aa, b:0x0bc, c:0x0ab, d:0x003 },	{ a:0x0ab, b:0x0bc, c:0x0bd, d:0x001 },	{ a:0x0ab, b:0x0bd, c:0x0ac, d:0x003 },	{ a:0x0ac, b:0x0bd, c:0x0be, d:0x001 },	{ a:0x0ac, b:0x0be, c:0x0ad, d:0x003 },	{ a:0x0ad, b:0x0be, c:0x0bf, d:0x001 },	{ a:0x0ad, b:0x0bf, c:0x0ae, d:0x003 },	{ a:0x0ae, b:0x0bf, c:0x0c0, d:0x001 },	{ a:0x0ae, b:0x0c0, c:0x0af, d:0x003 },	{ a:0x0af, b:0x0c0, c:0x0c1, d:0x001 },	{ a:0x0af, b:0x0c1, c:0x0b0, d:0x003 },	{ a:0x0b0, b:0x0c1, c:0x0c2, d:0x001 },	{ a:0x0b0, b:0x0c2, c:0x0b1, d:0x003 },	{ a:0x0b1, b:0x0c2, c:0x0c3, d:0x001 },	{ a:0x0b1, b:0x0c3, c:0x0b2, d:0x003 },	{ a:0x0b2, b:0x0c3, c:0x0c4, d:0x001 },	{ a:0x0b2, b:0x0c4, c:0x0b3, d:0x003 },	{ a:0x0b3, b:0x0c4, c:0x0c5, d:0x001 },	{ a:0x0b3, b:0x0c5, c:0x0b4, d:0x003 },	{ a:0x0b4, b:0x0c5, c:0x0c6, d:0x001 },	{ a:0x0b4, b:0x0c6, c:0x0b5, d:0x003 },	{ a:0x0b5, b:0x0c6, c:0x0c7, d:0x001 },	{ a:0x0b5, b:0x0c7, c:0x0b6, d:0x003 },	{ a:0x0b6, b:0x0c7, c:0x0c8, d:0x001 },	{ a:0x0b6, b:0x0c8, c:0x0b7, d:0x003 },	{ a:0x0b7, b:0x0c8, c:0x0c9, d:0x001 },	{ a:0x0b7, b:0x0c9, c:0x0b8, d:0x003 },	{ a:0x0b8, b:0x0c9, c:0x0ca, d:0x001 },	{ a:0x0b8, b:0x0ca, c:0x0b9, d:0x003 },	{ a:0x0b9, b:0x0ca, c:0x0cb, d:0x001 },	{ a:0x0b9, b:0x0cb, c:0x0ba, d:0x003 },	{ a:0x0bb, b:0x0cc, c:0x0cd, d:0x001 },	{ a:0x0bb, b:0x0cd, c:0x0bc, d:0x003 },	{ a:0x0bc, b:0x0cd, c:0x0ce, d:0x001 },	{ a:0x0bc, b:0x0ce, c:0x0bd, d:0x003 },	{ a:0x0bd, b:0x0ce, c:0x0cf, d:0x001 },	{ a:0x0bd, b:0x0cf, c:0x0be, d:0x003 },	{ a:0x0be, b:0x0cf, c:0x0d0, d:0x001 },	{ a:0x0be, b:0x0d0, c:0x0bf, d:0x003 },	{ a:0x0bf, b:0x0d0, c:0x0d1, d:0x001 },	{ a:0x0bf, b:0x0d1, c:0x0c0, d:0x003 },	{ a:0x0c0, b:0x0d1, c:0x0d2, d:0x001 },	{ a:0x0c0, b:0x0d2, c:0x0c1, d:0x003 },	{ a:0x0c1, b:0x0d2, c:0x0d3, d:0x001 },	{ a:0x0c1, b:0x0d3, c:0x0c2, d:0x003 },	{ a:0x0c2, b:0x0d3, c:0x0d4, d:0x001 },	{ a:0x0c2, b:0x0d4, c:0x0c3, d:0x003 },	{ a:0x0c3, b:0x0d4, c:0x0d5, d:0x001 },	{ a:0x0c3, b:0x0d5, c:0x0c4, d:0x003 },	{ a:0x0c4, b:0x0d5, c:0x0d6, d:0x001 },	{ a:0x0c4, b:0x0d6, c:0x0c5, d:0x003 },	{ a:0x0c5, b:0x0d6, c:0x0d7, d:0x001 },	{ a:0x0c5, b:0x0d7, c:0x0c6, d:0x003 },	{ a:0x0c6, b:0x0d7, c:0x0d8, d:0x001 },	{ a:0x0c6, b:0x0d8, c:0x0c7, d:0x003 },	{ a:0x0c7, b:0x0d8, c:0x0d9, d:0x001 },	{ a:0x0c7, b:0x0d9, c:0x0c8, d:0x003 },	{ a:0x0c8, b:0x0d9, c:0x0da, d:0x001 },	{ a:0x0c8, b:0x0da, c:0x0c9, d:0x003 },	{ a:0x0c9, b:0x0da, c:0x0db, d:0x001 },	{ a:0x0c9, b:0x0db, c:0x0ca, d:0x003 },	{ a:0x0ca, b:0x0db, c:0x0dc, d:0x001 },	{ a:0x0ca, b:0x0dc, c:0x0cb, d:0x003 },	{ a:0x0cc, b:0x0dd, c:0x0de, d:0x001 },	{ a:0x0cc, b:0x0de, c:0x0cd, d:0x003 },	{ a:0x0cd, b:0x0de, c:0x0df, d:0x001 },	{ a:0x0cd, b:0x0df, c:0x0ce, d:0x003 },	{ a:0x0ce, b:0x0df, c:0x0e0, d:0x001 },	{ a:0x0ce, b:0x0e0, c:0x0cf, d:0x003 },	{ a:0x0cf, b:0x0e0, c:0x0e1, d:0x001 },	{ a:0x0cf, b:0x0e1, c:0x0d0, d:0x003 },	{ a:0x0d0, b:0x0e1, c:0x0e2, d:0x001 },	{ a:0x0d0, b:0x0e2, c:0x0d1, d:0x003 },	{ a:0x0d1, b:0x0e2, c:0x0e3, d:0x001 },	{ a:0x0d1, b:0x0e3, c:0x0d2, d:0x003 },	{ a:0x0d2, b:0x0e3, c:0x0e4, d:0x001 },	{ a:0x0d2, b:0x0e4, c:0x0d3, d:0x003 },	{ a:0x0d3, b:0x0e4, c:0x0e5, d:0x001 },	{ a:0x0d3, b:0x0e5, c:0x0d4, d:0x003 },	{ a:0x0d4, b:0x0e5, c:0x0e6, d:0x001 },	{ a:0x0d4, b:0x0e6, c:0x0d5, d:0x003 },	{ a:0x0d5, b:0x0e6, c:0x0e7, d:0x001 },	{ a:0x0d5, b:0x0e7, c:0x0d6, d:0x003 },	{ a:0x0d6, b:0x0e7, c:0x0e8, d:0x001 },	{ a:0x0d6, b:0x0e8, c:0x0d7, d:0x003 },	{ a:0x0d7, b:0x0e8, c:0x0e9, d:0x001 },	{ a:0x0d7, b:0x0e9, c:0x0d8, d:0x003 },	{ a:0x0d8, b:0x0e9, c:0x0ea, d:0x001 },	{ a:0x0d8, b:0x0ea, c:0x0d9, d:0x003 },	{ a:0x0d9, b:0x0ea, c:0x0eb, d:0x001 },	{ a:0x0d9, b:0x0eb, c:0x0da, d:0x003 },	{ a:0x0da, b:0x0eb, c:0x0ec, d:0x001 },	{ a:0x0da, b:0x0ec, c:0x0db, d:0x003 },	{ a:0x0db, b:0x0ec, c:0x0ed, d:0x001 },	{ a:0x0db, b:0x0ed, c:0x0dc, d:0x003 },	{ a:0x0dd, b:0x0ee, c:0x0ef, d:0x001 },	{ a:0x0dd, b:0x0ef, c:0x0de, d:0x003 },	{ a:0x0de, b:0x0ef, c:0x0f0, d:0x001 },	{ a:0x0de, b:0x0f0, c:0x0df, d:0x003 },	{ a:0x0df, b:0x0f0, c:0x0f1, d:0x001 },	{ a:0x0df, b:0x0f1, c:0x0e0, d:0x003 },	{ a:0x0e0, b:0x0f1, c:0x0f2, d:0x001 },	{ a:0x0e0, b:0x0f2, c:0x0e1, d:0x003 },	{ a:0x0e1, b:0x0f2, c:0x0f3, d:0x001 },	{ a:0x0e1, b:0x0f3, c:0x0e2, d:0x003 },	{ a:0x0e2, b:0x0f3, c:0x0f4, d:0x001 },	{ a:0x0e2, b:0x0f4, c:0x0e3, d:0x003 },	{ a:0x0e3, b:0x0f4, c:0x0f5, d:0x001 },	{ a:0x0e3, b:0x0f5, c:0x0e4, d:0x003 },	{ a:0x0e4, b:0x0f5, c:0x0f6, d:0x001 },	{ a:0x0e4, b:0x0f6, c:0x0e5, d:0x003 },	{ a:0x0e5, b:0x0f6, c:0x0f7, d:0x001 },	{ a:0x0e5, b:0x0f7, c:0x0e6, d:0x003 },	{ a:0x0e6, b:0x0f7, c:0x0f8, d:0x001 },	{ a:0x0e6, b:0x0f8, c:0x0e7, d:0x003 },	{ a:0x0e7, b:0x0f8, c:0x0f9, d:0x001 },	{ a:0x0e7, b:0x0f9, c:0x0e8, d:0x003 },	{ a:0x0e8, b:0x0f9, c:0x0fa, d:0x001 },	{ a:0x0e8, b:0x0fa, c:0x0e9, d:0x003 },	{ a:0x0e9, b:0x0fa, c:0x0fb, d:0x001 },	{ a:0x0e9, b:0x0fb, c:0x0ea, d:0x003 },	{ a:0x0ea, b:0x0fb, c:0x0fc, d:0x001 },	{ a:0x0ea, b:0x0fc, c:0x0eb, d:0x003 },	{ a:0x0eb, b:0x0fc, c:0x0fd, d:0x001 },	{ a:0x0eb, b:0x0fd, c:0x0ec, d:0x003 },	{ a:0x0ec, b:0x0fd, c:0x0fe, d:0x001 },	{ a:0x0ec, b:0x0fe, c:0x0ed, d:0x003 },	{ a:0x0ee, b:0x0ff, c:0x100, d:0x001 },	{ a:0x0ee, b:0x100, c:0x0ef, d:0x003 },	{ a:0x0ef, b:0x100, c:0x101, d:0x001 },	{ a:0x0ef, b:0x101, c:0x0f0, d:0x003 },	{ a:0x0f0, b:0x101, c:0x102, d:0x001 },	{ a:0x0f0, b:0x102, c:0x0f1, d:0x003 },	{ a:0x0f1, b:0x102, c:0x103, d:0x001 },	{ a:0x0f1, b:0x103, c:0x0f2, d:0x003 },	{ a:0x0f2, b:0x103, c:0x104, d:0x001 },	{ a:0x0f2, b:0x104, c:0x0f3, d:0x003 },	{ a:0x0f3, b:0x104, c:0x105, d:0x001 },	{ a:0x0f3, b:0x105, c:0x0f4, d:0x003 },	{ a:0x0f4, b:0x105, c:0x106, d:0x001 },	{ a:0x0f4, b:0x106, c:0x0f5, d:0x003 },	{ a:0x0f5, b:0x106, c:0x107, d:0x001 },	{ a:0x0f5, b:0x107, c:0x0f6, d:0x003 },	{ a:0x0f6, b:0x107, c:0x108, d:0x001 },	{ a:0x0f6, b:0x108, c:0x0f7, d:0x003 },	{ a:0x0f7, b:0x108, c:0x109, d:0x001 },	{ a:0x0f7, b:0x109, c:0x0f8, d:0x003 },	{ a:0x0f8, b:0x109, c:0x10a, d:0x001 },	{ a:0x0f8, b:0x10a, c:0x0f9, d:0x003 },	{ a:0x0f9, b:0x10a, c:0x10b, d:0x001 },	{ a:0x0f9, b:0x10b, c:0x0fa, d:0x003 },	{ a:0x0fa, b:0x10b, c:0x10c, d:0x001 },	{ a:0x0fa, b:0x10c, c:0x0fb, d:0x003 },	{ a:0x0fb, b:0x10c, c:0x10d, d:0x001 },	{ a:0x0fb, b:0x10d, c:0x0fc, d:0x003 },	{ a:0x0fc, b:0x10d, c:0x10e, d:0x001 },	{ a:0x0fc, b:0x10e, c:0x0fd, d:0x003 },	{ a:0x0fd, b:0x10e, c:0x10f, d:0x001 },	{ a:0x0fd, b:0x10f, c:0x0fe, d:0x003 },	{ a:0x0ff, b:0x110, c:0x111, d:0x001 },	{ a:0x0ff, b:0x111, c:0x100, d:0x003 },	{ a:0x100, b:0x111, c:0x112, d:0x001 },	{ a:0x100, b:0x112, c:0x101, d:0x003 },	{ a:0x101, b:0x112, c:0x113, d:0x001 },	{ a:0x101, b:0x113, c:0x102, d:0x003 },	{ a:0x102, b:0x113, c:0x114, d:0x001 },	{ a:0x102, b:0x114, c:0x103, d:0x003 },	{ a:0x103, b:0x114, c:0x115, d:0x001 },	{ a:0x103, b:0x115, c:0x104, d:0x003 },	{ a:0x104, b:0x115, c:0x116, d:0x001 },	{ a:0x104, b:0x116, c:0x105, d:0x003 },	{ a:0x105, b:0x116, c:0x117, d:0x001 },	{ a:0x105, b:0x117, c:0x106, d:0x003 },	{ a:0x106, b:0x117, c:0x118, d:0x001 },	{ a:0x106, b:0x118, c:0x107, d:0x003 },	{ a:0x107, b:0x118, c:0x119, d:0x001 },	{ a:0x107, b:0x119, c:0x108, d:0x003 },	{ a:0x108, b:0x119, c:0x11a, d:0x001 },	{ a:0x108, b:0x11a, c:0x109, d:0x003 },	{ a:0x109, b:0x11a, c:0x11b, d:0x001 },	{ a:0x109, b:0x11b, c:0x10a, d:0x003 },	{ a:0x10a, b:0x11b, c:0x11c, d:0x001 },	{ a:0x10a, b:0x11c, c:0x10b, d:0x003 },	{ a:0x10b, b:0x11c, c:0x11d, d:0x001 },	{ a:0x10b, b:0x11d, c:0x10c, d:0x003 },	{ a:0x10c, b:0x11d, c:0x11e, d:0x001 },	{ a:0x10c, b:0x11e, c:0x10d, d:0x003 },	{ a:0x10d, b:0x11e, c:0x11f, d:0x001 },	{ a:0x10d, b:0x11f, c:0x10e, d:0x003 },	{ a:0x10e, b:0x11f, c:0x120, d:0x001 },	{ a:0x10e, b:0x120, c:0x10f, d:0x003 },];			var palette = [				0x000000,				0x0000ff,				0x00ff00,				0x00ffff,				0xff0000,				0xff00ff,				0xffff00,				0xffffff,				0x000000,				0x0000ff,				0x00ff00,				0x00ffff,				0xff0000,				0xff00ff,				0xffff00,				0xffffff			];		</script>	</head>	<body onload="run()" style="text-align:center">		<canvas id="canvas" width="256" height="256"/>	</body></html>

 

Share this post


Link to post
Share on other sites

thanks Ben for reply ,

in github i just found the test_point.mem and test_triangle.mem ,  the test_triangle data as shown below that must be the index to the points matrix ,, but i found confusion in triangle it have just two indices in one row ,, what this mean?????  it must be  three for ( a, b, c)

 

@000 000 011@400 012 007@002 000 012@402 001 1ff@004 001 012@404 013 007@006 001 013@406 002 1ff@008 002 013@408 014 007@00a 002 014@40a 003 1ff@00c 003 014@40c 015 007@00e 003 015@40e 004 1ff@010 004 015@410 016 007@012 004 016@412 005 1ff@014 005 016@414 017 007@016 005 017@416 006 1ff@018 006 017@418 018 007@01a 006 018@41a 007 1ff@01c 007 018@41c 019 007@01e 007 019@41e 008 1ff@020 008 019@420 01a 007@022 008 01a@422 009 1ff@024 009 01a@424 01b 007@026 009 01b@426 00a 1ff@028 00a 01b@428 01c 007@02a 00a 01c@42a 00b 1ff@02c 00b 01c@42c 01d 007@02e 00b 01d@42e 00c 1ff@030 00c 01d@430 01e 007@032 00c 01e@432 00d 1ff@034 00d 01e@434 01f 007@036 00d 01f@436 00e 1ff@038 00e 01f@438 020 007@03a 00e 020@43a 00f 1ff@03c 00f 020@43c 021 007@03e 00f 021@43e 010 1ff@040 011 022@440 023 007@042 011 023@442 012 1ff@044 012 023@444 024 007@046 012 024@446 013 1ff@048 013 024@448 025 007@04a 013 025@44a 014 1ff@04c 014 025@44c 026 007@04e 014 026@44e 015 1ff@050 015 026@450 027 007@052 015 027@452 016 1ff@054 016 027@454 028 007@056 016 028@456 017 1ff@058 017 028@458 029 007@05a 017 029@45a 018 1ff@05c 018 029@45c 02a 007@05e 018 02a@45e 019 1ff@060 019 02a@460 02b 007@062 019 02b@462 01a 1ff@064 01a 02b@464 02c 007@066 01a 02c@466 01b 1ff@068 01b 02c@468 02d 007@06a 01b 02d@46a 01c 1ff@06c 01c 02d@46c 02e 007@06e 01c 02e@46e 01d 1ff@070 01d 02e@470 02f 007@072 01d 02f@472 01e 1ff@074 01e 02f@474 030 007@076 01e 030@476 01f 1ff@078 01f 030@478 031 007@07a 01f 031@47a 020 1ff@07c 020 031@47c 032 007@07e 020 032@47e 021 1ff@080 022 033@480 034 007@082 022 034@482 023 1ff@084 023 034@484 035 007@086 023 035@486 024 1ff@088 024 035@488 036 007@08a 024 036@48a 025 1ff@08c 025 036@48c 037 007@08e 025 037@48e 026 1ff@090 026 037@490 038 007@092 026 038@492 027 1ff@094 027 038@494 039 007@096 027 039@496 028 1ff@098 028 039@498 03a 007@09a 028 03a@49a 029 1ff@09c 029 03a@49c 03b 007@09e 029 03b@49e 02a 1ff@0a0 02a 03b@4a0 03c 007@0a2 02a 03c@4a2 02b 1ff@0a4 02b 03c@4a4 03d 007@0a6 02b 03d@4a6 02c 1ff@0a8 02c 03d@4a8 03e 007@0aa 02c 03e@4aa 02d 1ff@0ac 02d 03e@4ac 03f 007@0ae 02d 03f@4ae 02e 1ff@0b0 02e 03f@4b0 040 007@0b2 02e 040@4b2 02f 1ff@0b4 02f 040@4b4 041 007@0b6 02f 041@4b6 030 1ff@0b8 030 041@4b8 042 007@0ba 030 042@4ba 031 1ff@0bc 031 042@4bc 043 007@0be 031 043@4be 032 1ff@0c0 033 044@4c0 045 007@0c2 033 045@4c2 034 1ff@0c4 034 045@4c4 046 007@0c6 034 046@4c6 035 1ff@0c8 035 046@4c8 047 007@0ca 035 047@4ca 036 1ff@0cc 036 047@4cc 048 007@0ce 036 048@4ce 037 1ff@0d0 037 048@4d0 049 007@0d2 037 049@4d2 038 1ff@0d4 038 049@4d4 04a 007@0d6 038 04a@4d6 039 1ff@0d8 039 04a@4d8 04b 007@0da 039 04b@4da 03a 1ff@0dc 03a 04b@4dc 04c 007@0de 03a 04c@4de 03b 1ff@0e0 03b 04c@4e0 04d 007@0e2 03b 04d@4e2 03c 1ff@0e4 03c 04d@4e4 04e 007@0e6 03c 04e@4e6 03d 1ff@0e8 03d 04e@4e8 04f 007@0ea 03d 04f@4ea 03e 1ff@0ec 03e 04f@4ec 050 007@0ee 03e 050@4ee 03f 1ff@0f0 03f 050@4f0 051 007@0f2 03f 051@4f2 040 1ff@0f4 040 051@4f4 052 007@0f6 040 052@4f6 041 1ff@0f8 041 052@4f8 053 007@0fa 041 053@4fa 042 1ff@0fc 042 053@4fc 054 007@0fe 042 054@4fe 043 1ff@100 044 055@500 056 007@102 044 056@502 045 1ff@104 045 056@504 057 007@106 045 057@506 046 1ff@108 046 057@508 058 007@10a 046 058@50a 047 1ff@10c 047 058@50c 059 007@10e 047 059@50e 048 1ff@110 048 059@510 05a 007@112 048 05a@512 049 1ff@114 049 05a@514 05b 007@116 049 05b@516 04a 1ff@118 04a 05b@518 05c 007@11a 04a 05c@51a 04b 1ff@11c 04b 05c@51c 05d 007@11e 04b 05d@51e 04c 1ff@120 04c 05d@520 05e 007@122 04c 05e@522 04d 1ff@124 04d 05e@524 05f 007@126 04d 05f@526 04e 1ff@128 04e 05f@528 060 007@12a 04e 060@52a 04f 1ff@12c 04f 060@52c 061 007@12e 04f 061@52e 050 1ff@130 050 061@530 062 007@132 050 062@532 051 1ff@134 051 062@534 063 007@136 051 063@536 052 1ff@138 052 063@538 064 007@13a 052 064@53a 053 1ff@13c 053 064@53c 065 007@13e 053 065@53e 054 1ff@140 055 066@540 067 007@142 055 067@542 056 1ff@144 056 067@544 068 007@146 056 068@546 057 1ff@148 057 068@548 069 007@14a 057 069@54a 058 1ff@14c 058 069@54c 06a 007@14e 058 06a@54e 059 1ff@150 059 06a@550 06b 007@152 059 06b@552 05a 1ff@154 05a 06b@554 06c 007@156 05a 06c@556 05b 1ff@158 05b 06c@558 06d 007@15a 05b 06d@55a 05c 1ff@15c 05c 06d@55c 06e 007@15e 05c 06e@55e 05d 1ff@160 05d 06e@560 06f 007@162 05d 06f@562 05e 1ff@164 05e 06f@564 070 007@166 05e 070@566 05f 1ff@168 05f 070@568 071 007@16a 05f 071@56a 060 1ff@16c 060 071@56c 072 007@16e 060 072@56e 061 1ff@170 061 072@570 073 007@172 061 073@572 062 1ff@174 062 073@574 074 007@176 062 074@576 063 1ff@178 063 074@578 075 007@17a 063 075@57a 064 1ff@17c 064 075@57c 076 007@17e 064 076@57e 065 1ff@180 066 077@580 078 007@182 066 078@582 067 1ff@184 067 078@584 079 007@186 067 079@586 068 1ff@188 068 079@588 07a 007@18a 068 07a@58a 069 1ff@18c 069 07a@58c 07b 007@18e 069 07b@58e 06a 1ff@190 06a 07b@590 07c 007@192 06a 07c@592 06b 1ff@194 06b 07c@594 07d 007@196 06b 07d@596 06c 1ff@198 06c 07d@598 07e 007@19a 06c 07e@59a 06d 1ff@19c 06d 07e@59c 07f 007@19e 06d 07f@59e 06e 1ff@1a0 06e 07f@5a0 080 007@1a2 06e 080@5a2 06f 1ff@1a4 06f 080@5a4 081 007@1a6 06f 081@5a6 070 1ff@1a8 070 081@5a8 082 007@1aa 070 082@5aa 071 1ff@1ac 071 082@5ac 083 007@1ae 071 083@5ae 072 1ff@1b0 072 083@5b0 084 007@1b2 072 084@5b2 073 1ff@1b4 073 084@5b4 085 007@1b6 073 085@5b6 074 1ff@1b8 074 085@5b8 086 007@1ba 074 086@5ba 075 1ff@1bc 075 086@5bc 087 007@1be 075 087@5be 076 1ff@1c0 077 088@5c0 089 007@1c2 077 089@5c2 078 1ff@1c4 078 089@5c4 08a 007@1c6 078 08a@5c6 079 1ff@1c8 079 08a@5c8 08b 007@1ca 079 08b@5ca 07a 1ff@1cc 07a 08b@5cc 08c 007@1ce 07a 08c@5ce 07b 1ff@1d0 07b 08c@5d0 08d 007@1d2 07b 08d@5d2 07c 1ff@1d4 07c 08d@5d4 08e 007@1d6 07c 08e@5d6 07d 1ff@1d8 07d 08e@5d8 08f 007@1da 07d 08f@5da 07e 1ff@1dc 07e 08f@5dc 090 007@1de 07e 090@5de 07f 1ff@1e0 07f 090@5e0 091 007@1e2 07f 091@5e2 080 1ff@1e4 080 091@5e4 092 007@1e6 080 092@5e6 081 1ff@1e8 081 092@5e8 093 007@1ea 081 093@5ea 082 1ff@1ec 082 093@5ec 094 007@1ee 082 094@5ee 083 1ff@1f0 083 094@5f0 095 007@1f2 083 095@5f2 084 1ff@1f4 084 095@5f4 096 007@1f6 084 096@5f6 085 1ff@1f8 085 096@5f8 097 007@1fa 085 097@5fa 086 1ff@1fc 086 097@5fc 098 007@1fe 086 098@5fe 087 1ff@200 088 099@600 09a 007@202 088 09a@602 089 1ff@204 089 09a@604 09b 007@206 089 09b@606 08a 1ff@208 08a 09b@608 09c 007@20a 08a 09c@60a 08b 1ff@20c 08b 09c@60c 09d 007@20e 08b 09d@60e 08c 1ff@210 08c 09d@610 09e 007@212 08c 09e@612 08d 1ff@214 08d 09e@614 09f 007@216 08d 09f@616 08e 1ff@218 08e 09f@618 0a0 007@21a 08e 0a0@61a 08f 1ff@21c 08f 0a0@61c 0a1 007@21e 08f 0a1@61e 090 1ff@220 090 0a1@620 0a2 007@222 090 0a2@622 091 1ff@224 091 0a2@624 0a3 007@226 091 0a3@626 092 1ff@228 092 0a3@628 0a4 007@22a 092 0a4@62a 093 1ff@22c 093 0a4@62c 0a5 007@22e 093 0a5@62e 094 1ff@230 094 0a5@630 0a6 007@232 094 0a6@632 095 1ff@234 095 0a6@634 0a7 007@236 095 0a7@636 096 1ff@238 096 0a7@638 0a8 007@23a 096 0a8@63a 097 1ff@23c 097 0a8@63c 0a9 007@23e 097 0a9@63e 098 1ff@240 099 0aa@640 0ab 007@242 099 0ab@642 09a 1ff@244 09a 0ab@644 0ac 007@246 09a 0ac@646 09b 1ff@248 09b 0ac@648 0ad 007@24a 09b 0ad@64a 09c 1ff@24c 09c 0ad@64c 0ae 007@24e 09c 0ae@64e 09d 1ff@250 09d 0ae@650 0af 007@252 09d 0af@652 09e 1ff@254 09e 0af@654 0b0 007@256 09e 0b0@656 09f 1ff@258 09f 0b0@658 0b1 007@25a 09f 0b1@65a 0a0 1ff@25c 0a0 0b1@65c 0b2 007@25e 0a0 0b2@65e 0a1 1ff@260 0a1 0b2@660 0b3 007@262 0a1 0b3@662 0a2 1ff@264 0a2 0b3@664 0b4 007@266 0a2 0b4@666 0a3 1ff@268 0a3 0b4@668 0b5 007@26a 0a3 0b5@66a 0a4 1ff@26c 0a4 0b5@66c 0b6 007@26e 0a4 0b6@66e 0a5 1ff@270 0a5 0b6@670 0b7 007@272 0a5 0b7@672 0a6 1ff@274 0a6 0b7@674 0b8 007@276 0a6 0b8@676 0a7 1ff@278 0a7 0b8@678 0b9 007@27a 0a7 0b9@67a 0a8 1ff@27c 0a8 0b9@67c 0ba 007@27e 0a8 0ba@67e 0a9 1ff@280 0aa 0bb@680 0bc 007@282 0aa 0bc@682 0ab 1ff@284 0ab 0bc@684 0bd 007@286 0ab 0bd@686 0ac 1ff@288 0ac 0bd@688 0be 007@28a 0ac 0be@68a 0ad 1ff@28c 0ad 0be@68c 0bf 007@28e 0ad 0bf@68e 0ae 1ff@290 0ae 0bf@690 0c0 007@292 0ae 0c0@692 0af 1ff@294 0af 0c0@694 0c1 007@296 0af 0c1@696 0b0 1ff@298 0b0 0c1@698 0c2 007@29a 0b0 0c2@69a 0b1 1ff@29c 0b1 0c2@69c 0c3 007@29e 0b1 0c3@69e 0b2 1ff@2a0 0b2 0c3@6a0 0c4 007@2a2 0b2 0c4@6a2 0b3 1ff@2a4 0b3 0c4@6a4 0c5 007@2a6 0b3 0c5@6a6 0b4 1ff@2a8 0b4 0c5@6a8 0c6 007@2aa 0b4 0c6@6aa 0b5 1ff@2ac 0b5 0c6@6ac 0c7 007@2ae 0b5 0c7@6ae 0b6 1ff@2b0 0b6 0c7@6b0 0c8 007@2b2 0b6 0c8@6b2 0b7 1ff@2b4 0b7 0c8@6b4 0c9 007@2b6 0b7 0c9@6b6 0b8 1ff@2b8 0b8 0c9@6b8 0ca 007@2ba 0b8 0ca@6ba 0b9 1ff@2bc 0b9 0ca@6bc 0cb 007@2be 0b9 0cb@6be 0ba 1ff@2c0 0bb 0cc@6c0 0cd 007@2c2 0bb 0cd@6c2 0bc 1ff@2c4 0bc 0cd@6c4 0ce 007@2c6 0bc 0ce@6c6 0bd 1ff@2c8 0bd 0ce@6c8 0cf 007@2ca 0bd 0cf@6ca 0be 1ff@2cc 0be 0cf@6cc 0d0 007@2ce 0be 0d0@6ce 0bf 1ff@2d0 0bf 0d0@6d0 0d1 007@2d2 0bf 0d1@6d2 0c0 1ff@2d4 0c0 0d1@6d4 0d2 007@2d6 0c0 0d2@6d6 0c1 1ff@2d8 0c1 0d2@6d8 0d3 007@2da 0c1 0d3@6da 0c2 1ff@2dc 0c2 0d3@6dc 0d4 007@2de 0c2 0d4@6de 0c3 1ff@2e0 0c3 0d4@6e0 0d5 007@2e2 0c3 0d5@6e2 0c4 1ff@2e4 0c4 0d5@6e4 0d6 007@2e6 0c4 0d6@6e6 0c5 1ff@2e8 0c5 0d6@6e8 0d7 007@2ea 0c5 0d7@6ea 0c6 1ff@2ec 0c6 0d7@6ec 0d8 007@2ee 0c6 0d8@6ee 0c7 1ff@2f0 0c7 0d8@6f0 0d9 007@2f2 0c7 0d9@6f2 0c8 1ff@2f4 0c8 0d9@6f4 0da 007@2f6 0c8 0da@6f6 0c9 1ff@2f8 0c9 0da@6f8 0db 007@2fa 0c9 0db@6fa 0ca 1ff@2fc 0ca 0db@6fc 0dc 007@2fe 0ca 0dc@6fe 0cb 1ff@300 0cc 0dd@700 0de 007@302 0cc 0de@702 0cd 1ff@304 0cd 0de@704 0df 007@306 0cd 0df@706 0ce 1ff@308 0ce 0df@708 0e0 007@30a 0ce 0e0@70a 0cf 1ff@30c 0cf 0e0@70c 0e1 007@30e 0cf 0e1@70e 0d0 1ff@310 0d0 0e1@710 0e2 007@312 0d0 0e2@712 0d1 1ff@314 0d1 0e2@714 0e3 007@316 0d1 0e3@716 0d2 1ff@318 0d2 0e3@718 0e4 007@31a 0d2 0e4@71a 0d3 1ff@31c 0d3 0e4@71c 0e5 007@31e 0d3 0e5@71e 0d4 1ff@320 0d4 0e5@720 0e6 007@322 0d4 0e6@722 0d5 1ff@324 0d5 0e6@724 0e7 007@326 0d5 0e7@726 0d6 1ff@328 0d6 0e7@728 0e8 007@32a 0d6 0e8@72a 0d7 1ff@32c 0d7 0e8@72c 0e9 007@32e 0d7 0e9@72e 0d8 1ff@330 0d8 0e9@730 0ea 007@332 0d8 0ea@732 0d9 1ff@334 0d9 0ea@734 0eb 007@336 0d9 0eb@736 0da 1ff@338 0da 0eb@738 0ec 007@33a 0da 0ec@73a 0db 1ff@33c 0db 0ec@73c 0ed 007@33e 0db 0ed@73e 0dc 1ff@340 0dd 0ee@740 0ef 007@342 0dd 0ef@742 0de 1ff@344 0de 0ef@744 0f0 007@346 0de 0f0@746 0df 1ff@348 0df 0f0@748 0f1 007@34a 0df 0f1@74a 0e0 1ff@34c 0e0 0f1@74c 0f2 007@34e 0e0 0f2@74e 0e1 1ff@350 0e1 0f2@750 0f3 007@352 0e1 0f3@752 0e2 1ff@354 0e2 0f3@754 0f4 007@356 0e2 0f4@756 0e3 1ff@358 0e3 0f4@758 0f5 007@35a 0e3 0f5@75a 0e4 1ff@35c 0e4 0f5@75c 0f6 007@35e 0e4 0f6@75e 0e5 1ff@360 0e5 0f6@760 0f7 007@362 0e5 0f7@762 0e6 1ff@364 0e6 0f7@764 0f8 007@366 0e6 0f8@766 0e7 1ff@368 0e7 0f8@768 0f9 007@36a 0e7 0f9@76a 0e8 1ff@36c 0e8 0f9@76c 0fa 007@36e 0e8 0fa@76e 0e9 1ff@370 0e9 0fa@770 0fb 007@372 0e9 0fb@772 0ea 1ff@374 0ea 0fb@774 0fc 007@376 0ea 0fc@776 0eb 1ff@378 0eb 0fc@778 0fd 007@37a 0eb 0fd@77a 0ec 1ff@37c 0ec 0fd@77c 0fe 007@37e 0ec 0fe@77e 0ed 1ff@380 0ee 0ff@780 100 007@382 0ee 100@782 0ef 1ff@384 0ef 100@784 101 007@386 0ef 101@786 0f0 1ff@388 0f0 101@788 102 007@38a 0f0 102@78a 0f1 1ff@38c 0f1 102@78c 103 007@38e 0f1 103@78e 0f2 1ff@390 0f2 103@790 104 007@392 0f2 104@792 0f3 1ff@394 0f3 104@794 105 007@396 0f3 105@796 0f4 1ff@398 0f4 105@798 106 007@39a 0f4 106@79a 0f5 1ff@39c 0f5 106@79c 107 007@39e 0f5 107@79e 0f6 1ff@3a0 0f6 107@7a0 108 007@3a2 0f6 108@7a2 0f7 1ff@3a4 0f7 108@7a4 109 007@3a6 0f7 109@7a6 0f8 1ff@3a8 0f8 109@7a8 10a 007@3aa 0f8 10a@7aa 0f9 1ff@3ac 0f9 10a@7ac 10b 007@3ae 0f9 10b@7ae 0fa 1ff@3b0 0fa 10b@7b0 10c 007@3b2 0fa 10c@7b2 0fb 1ff@3b4 0fb 10c@7b4 10d 007@3b6 0fb 10d@7b6 0fc 1ff@3b8 0fc 10d@7b8 10e 007@3ba 0fc 10e@7ba 0fd 1ff@3bc 0fd 10e@7bc 10f 007@3be 0fd 10f@7be 0fe 1ff@3c0 0ff 110@7c0 111 007@3c2 0ff 111@7c2 100 1ff@3c4 100 111@7c4 112 007@3c6 100 112@7c6 101 1ff@3c8 101 112@7c8 113 007@3ca 101 113@7ca 102 1ff@3cc 102 113@7cc 114 007@3ce 102 114@7ce 103 1ff@3d0 103 114@7d0 115 007@3d2 103 115@7d2 104 1ff@3d4 104 115@7d4 116 007@3d6 104 116@7d6 105 1ff@3d8 105 116@7d8 117 007@3da 105 117@7da 106 1ff@3dc 106 117@7dc 118 007@3de 106 118@7de 107 1ff@3e0 107 118@7e0 119 007@3e2 107 119@7e2 108 1ff@3e4 108 119@7e4 11a 007@3e6 108 11a@7e6 109 1ff@3e8 109 11a@7e8 11b 007@3ea 109 11b@7ea 10a 1ff@3ec 10a 11b@7ec 11c 007@3ee 10a 11c@7ee 10b 1ff@3f0 10b 11c@7f0 11d 007@3f2 10b 11d@7f2 10c 1ff@3f4 10c 11d@7f4 11e 007@3f6 10c 11e@7f6 10d 1ff@3f8 10d 11e@7f8 11f 007@3fa 10d 11f@7fa 10e 1ff@3fc 10e 11f@7fc 120 007@3fe 10e 120@7fe 10f 1ff

 

But in the copy of program that you show above the triangle matrix is an indices to the points that show // test mesh : a cube// as wrote in before the points matrix ....... also i test it it is truly cube ....

Share this post


Link to post
Share on other sites

Hi all ...

 

I forced a problem in (back face culling) , in any section in the papilio project can I find it ?????

 

in fact i tried with the following equations::

 

C = y1(x3-x2) + y2(x1+x3) + y3(x2-x1)

or

D = y1(x2 z3 - x3z2) + y2(x3z1 + x1z3) + y3(x1z2 - x2z1)

 

if D or C < 0 then

  the polygon is in the front

else 

  the polygon is in the back(hide)

end if;

 

But also some of front triangles is hide , so is there any exact method for culling (back-face test) in VHDL????

Share this post


Link to post
Share on other sites

It has been a long time since I performed any 3D S/W work, but projecting the surface normal onto the view vector (with a cross product) is the only way I know.

 

The code above does not seem to include the view vector, so as you get away from the centre of the screen the problem should get worse. Is that so?

Share this post


Link to post
Share on other sites

The right (=generic) way to do backface culling is indeed dot producting the normal vector with the view vector, or (same thing, different pov), look at the z component of the normal vector in the viewspace.

 

But normal vectors are not provided with the model in my example...

 

The cross product technique of neam (look at the ordering of vertices in a triangle on the screen: clockwise means visible, ccw means hidden) works when the model is designed for it, which isn't the case here.

 

To be honest, I just built a quick model for a demo, not planning on backface culling. Now, we should aim at something more precise in order to get one of these methods to work (preferrably the second one, which is computationnaly cheaper), but I'm out of time at the moment.

Share this post


Link to post
Share on other sites

Can't you just rotate the picture 90 deg sort of like all the current FPGA arcade games?

Admittedly you'll have to then rotate your monitor in portrait mode, but it's a start.i

i agree with rotating image vb.net, it is one way to go. it can be used as a beginning.  and then convert to integer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now