Hi

I'm a beginner in Java3D and I'd like to know how to Convert a 3D point from
Virtual World to Scree Points/Coordinates(2D). Presently I am having code
for converting screen coordinates(2D) to 3D point (as below) where x,y are
screen coordinates.

         public Point3d get2DTo3DPoint(int x , int y)
         {
            Point3d point3d =new Point3d();
            this.canvas3D.getPixelLocationInImagePlate(x, y, point3d);
            Transform3D temp = new Transform3D();
            this.canvas3D.getImagePlateToVworld(temp);
            temp.transform(point3d);
            return point3d;
         }

When I am doing same thing in reverse for 3D to 2D point conversion as
below, The values are not coming properly (My Canvas3D height and width are
589 and 512. So values should lie in between this. But the output points are
having some minus values).

         public Point2d get3DTo2DPoint(Point3d point3d)
         {

            Transform3D temp = new Transform3D();
            this.canvas3D.getVworldToImagePlate(temp);
            temp.transform(point3d);
            Point2d point2d =new Point2d();
            this.canvas3D.getPixelLocationFromImagePlate(point3d,point2d);
            return point2d;
         }

Am i doing any thing wrong in the above code.Please help me regarding this.

Thanks for your answers.
Srikanth Vavilapalli

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to