Your IP : 216.73.217.53


Current Path : /home/bonneesp/www/components/com_gallery_wd/js/3DEngine/
Upload File :
Current File : /home/bonneesp/www/components/com_gallery_wd/js/3DEngine/Sphere.js

var Sphere = function (radius, sides, numOfItems){
  
	for (var j = sides ; j > 0; j--){	
		for (var i = numOfItems / sides ; i > 0; i--)
		{
      var angle = i * Math.PI / (numOfItems / sides + 1);
      var angleB = j * Math.PI * 2 / (sides);
			
      var x =   Math.sin(angleB) * Math.sin(angle) * radius;
			var y =  Math.cos(angleB) * Math.sin(angle) * radius;
			var z =  Math.cos(angle) * radius;
      
      this.pointsArray.push(this.make3DPoint(x,y,z));
		}	
	};
};

Sphere.prototype = new DisplayObject3D();