[Papervision3D] Placing planes along a carousel.

Mark Barcinski mark at barcinski.nl
Tue Aug 19 08:36:50 PDT 2008


This might point you in the right direction:

private function setupPlanes():void
{
	var plane : Plane;
	var maxPlanes:Number = 5;
	
	var step:Number = 2*Math.PI / maxPlanes;

	for(var i:int = 0 ; i < maxPlanes ; i++)
	{
		plane = createPlane();	
		plane.x = Math.sin(i * step) * radius;
		plane.z = Math.cos(i * step) * radius;
		
		plane.rotationY = Math.atan2(plane.x , plane.z) * toDEGREES;
	}
}

static public const toDEGREES :Number = 180/Math.PI;

cheers,
Mark


On Aug 19, 2008, at 5:15 PM, Sceneshift wrote:

>
> Hi,
>
> I having some real trouble figuring out the math for positioning  
> planes so
> that they form a circle (or rather, a radius). I have the total  
> number of
> planes and the id of the plane I am positioning, but from then on I am
> pretty lost. Can anyone point me in the right direction?
> -- 
> View this message in context: http://www.nabble.com/Placing-planes-along-a-carousel.-tp19052523p19052523.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080819/7a34a47a/attachment.html 


More information about the Papervision3D mailing list