[Papervision3D] set an object to 2d-coordinates of the stage
azupko at zupko.info
Thu Jul 17 04:39:00 PDT 2008
You can by unprojecting into the screen:
Check out the math that determines where you are dragging too. The
basic idea would be:
var ray:Number3D = viewport.unproject(screenX, screenY); //screenX/Y
are relative to the center of the screen
//choose how far away you want your logo
//add to the camera to get final 3d position
ray = Number3D.add(ray, new Number3D(camera.x, camera.y, camera.z));
logo.x = ray.x;
logo.y = ray.y;
logo.z = ray.z;
Actually that code might work. Try it out :)
On Jul 17, 2008, at 7:19 AM, Sebastian Zink wrote:
> hi list!
> is it possible to set the coordinates of an DO3D to a relative or
> absolute position of the screen?
> I mean the 2d-coordinates of an DO3D not the 3D. I would like to
> place an collada-logo to the left and tween some planes from an 2D-
> objects position to the right corner of my stage
> I've found some examples on this list to read the 2D-coordinates of
> an DO3D but the screenX or screenY value is write-protected, in this
> fact i can't set the 2D-coordinates.
> cheers Sebastian.
> Papervision3D mailing list
> Papervision3D at osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Papervision3D