Assuming PaperVision3D or Away3D don't do what you need, there is some great
source code samples you can download from here.
http://www.friendsofed.com/book.html?isbn=1590597915
Must have book btw.

On Fri, Apr 10, 2009 at 10:52 AM, Jer Brand <[email protected]> wrote:

> Okay, so I'm taking my first little steps into 3d in actionscript
> (simulated
> with x/yscale for now) and needed a version of Point.polar() (thanks Jason)
> to play around with in 3 dimensions. I came up with the code below, but my
> math skills are weak enough that I'm not sure it's functioning correctly.
> Anyone care to school me on this or confirm the math is correct?
>
>
> public static function polarToCartesian3D(distance:Number, degrees1:Number,
> degrees2:Number ):Point3D
> {
> var a1:Number = (degrees1 * Math.PI) / 180 ;
>  var a2:Number = (degrees2 * Math.PI) / 180 ;
> var x:Number = distance * Math.sin(a1) * Math.cos(a2) ;
>  var y:Number = distance * Math.sin(a1) * Math.sin(a2) ;
> var z:Number = distance * Math.cos(a1) ;
>  return new Point3D(x, y, z) ;
>  }
>
>
> Thanks in advance for the assist.
>
> Jer
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
--Joel Stransky
stranskydesign.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to