What is the information that you know about the point? degree for x,y? degree for x,z? degree for y,z? Is the distance you are referring to the distance from the origin? I assume it is.

Here is a site that has a presentation in japanese (I think); yet, just make it past the first 12 or so pointless but pretty frames, and it will show you what you need to know visually.

http://temp.roxik.com/datas/max2007/index.html



Jer Brand wrote:
Thing is, I can download and use PV3D (and have been playing with it) and
were I doing something for work, that's what I'd do. With my own personal
screwing around, I'm more concerned that the math I'm using is correct not
making things easy on myself.
As an aside, I have the AS2 version of that book from years ago. Didn't know
if 3 was worth grabbing as well, so thanks for the rec.
Jer


On Fri, Apr 10, 2009 at 10:27 AM, Joel Stransky <[email protected]>wrote:

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

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

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

Reply via email to