Hmm... maybe. I'm unfamiliar enough with Away3D that I'm not sure how
to proceed with your idea. What I really need is simply a function
that translates a stage point to a 3D location (z can be set to 0
since I realize that a point projected on the stage could be anywhere
along the z axis).


On Jun 15, 10:03 am, savagelook <[email protected]> wrote:
> Can you just forget the camera positioning/rolling and use the
> OrthogonalLens for your camera?
>
> On Jun 15, 9:34 am, JeffH <[email protected]> wrote:
>
>
>
> > Hi all. I wanted to get the experts' opinions on the best way to
> > accomplish what I need to do. I have a 3D object (a boat) that is in a
> > view with the camera set to a position and roll (45) to try and
> > achieve a "simcity" look. The settings are like this:
>
> > view.camera.x = 675; view.camera.y = -675; view.camera.z = -1300;
> > view.camera.roll(45); view.camera.lookAt(new Number3D(0, 0, 0));
>
> > What I want to do is to move this object based on 2D points located on
> > the stage (for example, a path along a river). What is the best way to
> > do this? I did try converting 2D points to 3D by trying to get the
> > intersect of a ray off a plane but it doesn't seem to work. Not sure
> > if it is because I have a camera roll... I tried this based on some
> > other posts (where my 2D point is the var pt):
>
> > var plane:Plane3D = new Plane3D();
> > plane.fromNormalAndPoint(new Number3D(0, 1, 0), new Number3D(0, 0,
> > 0));
> > var cameraPosition:Number3D = new Number3D(view.camera.x,
> > view.camera.y, view.camera.z);
> > var ray:Number3D = view.camera.unproject(pt.x, pt.y);
> > ray.add(ray, cameraPosition);
> > var intersect:Number3D =
> > plane.getIntersectionLineNumbers(cameraPosition, ray);
>
> > But, intersect.x does not seem to align with pt.x on the screen.
> > Perhaps I am misinterpreting how this should work? Should I try to
> > orient the stage (Flash CS4) the same way or can I leave that "flat"
> > and translate 2D coordinates to the 3D space?
>
> > Anyway, thanks for any guidance!

Reply via email to