PDA

View Full Version : PAPERVISION: Set 3D markers on a sphere based on a sub-MC in its material


suki
07-09-2009, 06:26 AM
I'm really struggling with this - hope that someone can help out with the 3D math. I've tried everything and nothing seems to work.

There are plenty of examples out there doing something similar but with lat/lang coordinates directly (for example*http://blog.zupko.info/?p=221) but I'm not working with lat/lang but pixels directly.*

I have a 3D sphere with movieclipmaterial surface. That movieclipmaterial has inside it a series of other movieclips - dots basically. What I'd like to do is position 3D objects (arrows basically) directly above those points of the sphere.

How would I convert 2D x,y points from the movieclipmaterial surface to the 3D coordinate system of the sphere x,y,z? Any ideas?

I've tried to adapt the code from the blog above - but its simply not working and I've been at it for days now. :help:

Take a look here -*http://files.getdropbox.com/u/355341/mtest02.swf - once you click on the globe an rotate it, the 3D marker should reposition itself above the "dot" MC in the globe material.*

And then take a quick look ( http://files.getdropbox.com/u/355341/mtest02.fla ) at the code and maybe tell me what I'm doing wrong? I've simplified the code to include only this particular problem - there are only a few lines of code so anybody with experience should be able to locate the problem quickly.

Please help - its a college project and I'm supposed to turn it in soon.

Thank you!

puppy
07-17-2009, 10:08 AM
lat = -pi + 2pi * y / h (or reverse signs)
lon = 2pi * x / w