I was just looking through all the goodies that flash player 10 came with and stumbled across the Vector3D class which seems like an awesome replacement to the old Point class. It has a ton of useful built-in methods like adding vectors, finding the distance between two of them and even finding the dotproduct but there where a few methods i couldn’t figure out, namely ‘angleBetween’ which seems to have a ton of potential use.
If anyone has experimented with this class, I have a few questions:
I get ‘angleBetween’ returns an angle in radians, but i noticed that its not your run-of-the-mill result. It’s always positive and even when I convert to degrees I get wacky results when trying to rotate objects.
How can the ‘w’ property work? More specifically, how can it work with the ‘project’ method?
I also found some cool methods in the Matrix3D class like ‘pointAt’(which can make an object rotate in the direction of given Vector3D) which would be awesome for the every day flash developer, however,I get buggy results so I’m not sure if I’m using it correctly. Any useful insight on how those methods can be used would be extremely helpful too.
In the past I’ve been using a ton of custom trig/calculus-based methods to find angles, rotate objects, animate along projection and it seems everyone else uses these ways, however, I think these new classes have everything built in… I just dont know how to use them. =(