Source

WebGL Beginner's Guide - Code / 1727_08 / models / geometry / complexCube.json

{
  "vertices" : [
  -0.5, 0.5,-0.5,
  -0.5,-0.5,-0.5,
  -0.5,-0.5, 0.5,
  -0.5, 0.5, 0.5,
  
  -0.5, 0.5, 0.5,
  -0.5,-0.5, 0.5,
   0.5,-0.5, 0.5,
   0.5, 0.5, 0.5,
   
   0.5, 0.5, 0.5,
   0.5,-0.5, 0.5,
   0.5,-0.5,-0.5,
   0.5, 0.5,-0.5,
   
   0.5, 0.5,-0.5,
   0.5,-0.5,-0.5,
  -0.5,-0.5,-0.5,
  -0.5, 0.5,-0.5,
  
  -0.5, 0.5,-0.5,
  -0.5, 0.5, 0.5,
   0.5, 0.5, 0.5,
   0.5, 0.5,-0.5,
   
  -0.5,-0.5, 0.5,
  -0.5,-0.5,-0.5,
   0.5,-0.5,-0.5,
   0.5,-0.5, 0.5
  
  
 ],
  
  "indices"  : [  0,1,2,     0,2,3,
				  4,5,6,     4,6,7,
				  8,9,10,  8,10,11,
				12,13,14, 12,14,15,
				16,17,18, 16,18,19,
				20,21,22, 20,22,23],
				
  "scalars"  : [1.0,0.0,0.0,1.0,
				1.0,0.0,0.0,1.0,
				1.0,0.0,0.0,1.0,
				1.0,0.0,0.0,1.0,
				
				0.0,1.0,0.0,1.0,
				0.0,1.0,0.0,1.0,
				0.0,1.0,0.0,1.0,
				0.0,1.0,0.0,1.0,
				
				0.0,0.0,1.0,1.0,
				0.0,0.0,1.0,1.0,
				0.0,0.0,1.0,1.0,
				0.0,0.0,1.0,1.0,
				
				0.0,1.0,1.0,1.0,
				0.0,1.0,1.0,1.0,
				0.0,1.0,1.0,1.0,
				0.0,1.0,1.0,1.0,
				
				1.0,0.0,1.0,1.0,
				1.0,0.0,1.0,1.0,
				1.0,0.0,1.0,1.0,
				1.0,0.0,1.0,1.0,
				
				1.0,1.0,0.0,1.0,
				1.0,1.0,0.0,1.0,
				1.0,1.0,0.0,1.0,
				1.0,1.0,0.0,1.0
				],
  "texture_coords" : [0.0, 0.0,
					  1.0, 0.0,
					  1.0, 1.0,
					  0.0, 1.0,


					  1.0, 0.0,
					  1.0, 1.0,
					  0.0, 1.0,
					  0.0, 0.0,


					  0.0, 1.0,
					  0.0, 0.0,
					  1.0, 0.0,
					  1.0, 1.0,

					  1.0, 1.0,
					  0.0, 1.0,
					  0.0, 0.0,
					  1.0, 0.0,


					  1.0, 0.0,
					  1.0, 1.0,
					  0.0, 1.0,
					  0.0, 0.0,


					  0.0, 0.0,
					  1.0, 0.0,
					  1.0, 1.0,
					  0.0, 1.0],

  "diffuse"  : [1.0,1.0,1.0,1.0]
}