Hi,

I am currently in the process of creating an 3D Editor in Away 3D.

This is to aid the editing of a Path on the fly (using PathExtrude to
view the path)

I've got a Main View which is a Perspective View.

I then have an editor view that I can swap the camera position to
project TOP FRONT LEFT RIGHT BACK view - like most 3D Applications.

I am then plotting the screen 2D coords of the CurveSegment elements
(v0,vc,v1) of the entire path, so I can assign buttons to edit the X Y
Z coords depending on the view (TOP, FRONT etc)

This is the code that gets the 3D intersection of the 2D buttons used
to edit the CurveSegment elements using a Plane3D to act as the
intersection point. this particular example would look directly above
the scene

//

cameraPosition = new Number3D(0, 15000, 0);
intersectionPlane.fromNormalAndPoint(new Number3D(0, 1, 0), new
Number3D(0, 0, 0));

ray = editorView.cam.unproject((e.params.coords.x - (EDIT_VIEW_WIDTH *
0.5)),(e.params.coords.y - (EDIT_VIEW_HEIGHT * 0.5)))

ray.add(cameraPosition, ray);

intersect = intersectionPlane.getIntersectionLineNumbers
(cameraPosition,ray);

updatePath(intersect,e.params.cSeg,e.params.vType,"camera");

//

this seems to work fine.

However, when I change the Camera View to "RIGHT or LEFT"

you would presume the Normal for the Plane3D would be "new Number3D(1,
0, 0)" - pointing at the camera in the X-Axis

but intersection will only occur in the Y axis. the Z axis
intersection only occurs at 0.

I've spent all day looking up 3D maths, and my conclusion is that I'm
doing everything right - I just can't work out what i could of missed,
as all the other views work fine.

Many Thanks

Reply via email to