Gregory,

Couple of questions to clarify your problem:
- your data defines a cloud of points within a cube centered at 0,0,0.
- how are you going to map 2D pixel coordinates to 3D cube coordinates? It
doesn't sounds like you want to intersecting with any of the points... do
you want to intersect with the z=0 plane or something?

One possible way to do it would be to create an invisible QuadArray that
corresponds to the z=0 plane. You can then use the (1.2) picking utilities
(PickIntersection etc) to inquire the PickIntersection.pointCoordinatesVW
which should contain the intersection coordinate. Otherwise if you take a
look at the source code to the 1.2 utilities they show how to handle the
coordinate transforms and different projection modes etc.

Best of luck,

Daniel Selman

[EMAIL PROTECTED]
http://www.tornadolabs.com

> -----Original Message-----
> From: Discussion list for Java 3D API
> [mailto:[EMAIL PROTECTED]]On Behalf Of Gregory Bradford
> Sent: 25 January 2000 04:32
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] Pixel Coordinates to Model Coodinates
>
>
> Dear Java3d users
>
> I have a Canvas3d object which has a pixel x and pixel y position (say a
> mouse click) for which I'm interested
> in finding my data value.
>
> To explain, I've put into my 3d model only PointArray objects whose
> coordinate values are between -2000.0 and
> 2000.0 on any of the three axis.  The actual data isn't important, what
> is important is that I have data whose x coordinates can range from
> -2000.0 to 2000.0.  As well as the Y and the Z data.
>
> Assume that at least some of my data, but not all, shows up in the view
> (good field of view, translation, rotation, scale, etc.).
>
> Now all I want to do is supply a (valid for my canvas) pixel X and Y and
> get back a Point3d which indicates what value the pixel X and Y are in
> my data's coordinate system.  Thus I need to get back something like
> 233.0, -1387.0, 345.0.
>
> Can somebody get me over this hump in the road.  I need a "complete
> solution" that works from beginning to end.
>
> I've tried the following:
>
>   TransformGroup     vp_trans = null;
>  ....
>   Point3d position = new Point3d ( );
>   canvas.getPixelLocationInImagePlate(pixel_x, pixel_y, position);
>   Transform3D ctf = new Transform3D();
>   vp_trans.getTransform ( ctf );
>   canvas.getImagePlateToVworld( ctf );
>   ctf.transform(position_b);
>
> but the values of position.x and position.y always are between -1.0 and
> 1.0, with 0.0 always being at the center of the canvas.  Do I need to
> multiply these returned values by something?
>
> Thanks in advance,
>
> Gregory Bradford

===========================================================================
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