[Papervision3D] set an object to 2d-coordinates of the stage

Andy Zupko azupko at zupko.info
Thu Jul 17 04:39:00 PDT 2008


You can by unprojecting into the screen:

http://blog.zupko.info/?p=143

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
ray.multiplyEq(800);

//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 :)

-andy



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
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080717/c3882603/attachment.html 


More information about the Papervision3D mailing list