3D >> 2D coordinates

View: New views
8 Messages — Rating Filter:   Alert me  

3D >> 2D coordinates

by julapy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi, im working on a project at the moment with papervision 1.7b
im running MovieScene3D with a few Planes scattered randomly all facing the camera.
i would like to add movie clips over the 3D scene based on the coordinates of the planes. more precisely, i need to convert 3D coordinates into 2D coordinates on the screen.
if anyone has done this before or has any idea on how it can be done, can you please point me in the right direction.

cheers.
julaps

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: 3D >> 2D coordinates

by Dennis Ippel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This'll do it:

http://osflash.org/pipermail/papervision3d_osflash.org/2007-August/010225.html


On Jan 10, 2008 9:48 AM, Lukasz Karluk <julapy@...> wrote:
hi, im working on a project at the moment with papervision 1.7b
im running MovieScene3D with a few Planes scattered randomly all facing the camera.
i would like to add movie clips over the 3D scene based on the coordinates of the planes. more precisely, i need to convert 3D coordinates into 2D coordinates on the screen.
if anyone has done this before or has any idea on how it can be done, can you please point me in the right direction.

cheers.
julaps

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org



_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: 3D >> 2D coordinates

by Makc The Great :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

in dod3d you have:

public var screen :Number3D = new Number3D();
...
private function calculateScreenCoords( camera :CameraObject3D ):void
{
        var persp:Number = (camera.focus * camera.zoom) / (camera.focus + view.n34);
        screen.x = view.n14 * persp;
        screen.y = view.n24 * persp;
        screen.z = view.n34;
}

perhaps simply changing calculateScreenCoords( to public would help.


On 1/10/08, Dennis Ippel <ippeldv@...> wrote:

> This'll do it:
>
> http://osflash.org/pipermail/papervision3d_osflash.org/2007-August/010225.html
>
>
>
> On Jan 10, 2008 9:48 AM, Lukasz Karluk <julapy@...> wrote:
> >
> > hi, im working on a project at the moment with papervision 1.7b
> > im running MovieScene3D with a few Planes scattered randomly all facing
> the camera.
> > i would like to add movie clips over the 3D scene based on the coordinates
> of the planes. more precisely, i need to convert 3D coordinates into 2D
> coordinates on the screen.
> > if anyone has done this before or has any idea on how it can be done, can
> you please point me in the right direction.
> >
> > cheers.
> > julaps
> >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D@...
> >
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >
> >
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D@...
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: 3D >> 2D coordinates

by julapy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your help.
I found another solution shortly after posting by going back through the papervision emails.

        public function getObj2DCords ( o:DisplayObject3D, camera:CameraObject3D,  offsetX:Number = 0, offsetY:Number = 0 ):Point
        {
            var view:Matrix3D = o.view;
            var persp:Number = (camera.focus * camera.zoom) / (camera.focus + view.n34);
            return new Point ( (view.n14 * persp) + offsetX, (view.n24 * persp) + offsetY );
        }

seems to do the trick nicely.


On Jan 10, 2008 10:11 PM, Makc <makc.the.great@...> wrote:
in dod3d you have:

public var screen :Number3D = new Number3D();
...
private function calculateScreenCoords( camera :CameraObject3D ):void
{
       var persp:Number = (camera.focus * camera.zoom) / (camera.focus + view.n34);
       screen.x = view.n14 * persp;
       screen.y = view.n24 * persp;
       screen.z = view.n34;
}

perhaps simply changing calculateScreenCoords( to public would help.


On 1/10/08, Dennis Ippel <ippeldv@...> wrote:

> This'll do it:
>
> http://osflash.org/pipermail/papervision3d_osflash.org/2007-August/010225.html
>
>
>
> On Jan 10, 2008 9:48 AM, Lukasz Karluk <julapy@... > wrote:
> >
> > hi, im working on a project at the moment with papervision 1.7b
> > im running MovieScene3D with a few Planes scattered randomly all facing
> the camera.
> > i would like to add movie clips over the 3D scene based on the coordinates
> of the planes. more precisely, i need to convert 3D coordinates into 2D
> coordinates on the screen.
> > if anyone has done this before or has any idea on how it can be done, can
> you please point me in the right direction.
> >
> > cheers.
> > julaps
> >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D@...
> >
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >
> >
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D@...
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: 3D >> 2D coordinates

by timbon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Re: 3D >> 2D coordinates

by paperworld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

think it's a misprint of DO3D - DisplayObject3D
 
T

On Feb 19, 2008 10:32 PM, timbon <nojunkok@...> wrote:

What is "DOD3D"?
Basic question I know - but google doesn't even know...
http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=foa&q=definition+DOD+3D+&btnG=Search

--
View this message in context: http://www.nabble.com/3D-%3E%3E-2D-coordinates-tp14730886p15575291.html
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org



--
Trevor Burton
http://www.paperworld3d.com
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: 3D >> 2D coordinates

by Roy Wiggins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shorthand for DisplayObject3D. Everything visible in a Papervision scene extends the DisplayObject3D class.

On Feb 19, 2008 2:32 PM, timbon <nojunkok@...> wrote:

What is "DOD3D"?
Basic question I know - but google doesn't even know...
http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=foa&q=definition+DOD+3D+&btnG=Search

--
View this message in context: http://www.nabble.com/3D-%3E%3E-2D-coordinates-tp14730886p15575291.html
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: 3D >> 2D coordinates

by Ashley Sheridan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It's a 3D extinct animal without the 'O'...

What is "DOD3D"?
Basic question I know - but google doesn't even know...
http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=foa&q=definition+DOD+3D+&btnG=Search

--
View this message in context: http://www.nabble.com/3D-%3E%3E-2D-coordinates-tp14730886p15575291.html
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
LightInTheBox - Buy quality products at wholesale price!