David A Thomson wrote:
> 
> How can I convert a Vector3f coordinate into an x,y coordinate
> corresponding to my canvas3D?

The simplest way is to look at the code from the Sun utils classes for
mouse picking and reverse the vector math. I remember also that someone
posted some code here a month or two back. Check through the archives
(It is something that I should really add to the FAQ too as this
question comes up regularly).
  
> Also, is it possible to get a 2D graphics context from a 3D canvas and use
> simple drawing functions (like drawString())? I want to draw simple text
> messages to the canvas without making them 3D shapes.

Be careful with this. Be aware that Canvas3D is a native component that
is refreshed outside of the normal paint cycles. You will need to extend
the canvas and do all your drawing in the postSwap method. As it is a
standard component, the getGraphics call still works although IIRC, it
returns a Graphics3D, not a Graphics2D which could hamper some of your
drawing capabilities. AFAIK, there is no capability for getting the 2D
context, unless you try to fetch one from one of the parent components
that the canvas3d sits in.

-- 
Justin Couch                                   Author, Java Hacker
Snr Software Engineer                     [EMAIL PROTECTED]
ADI Ltd, Systems Group              http://www.vlc.com.au/~justin/
Java3D FAQ:       http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
 Turn it or move it, and a new set of arrangements appears... is it
 a single light or many lights, lights that one must know how to
 distinguish, recognise and appreciate? Is it one light with many
 frames or one frame for many lights?"      -Subcomandante Marcos
-------------------------------------------------------------------
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to