> Date:         Mon, 17 May 2004 11:47:06 -0600
> From: Julie Stromer <[EMAIL PROTECTED]>
>
> I'm creating a new input device by implementing the InputDevice
> interface, and am creating my Universe through the Configuration file
> that is fed into ConfiguredUniverse.
> [...]
> There is no documentaiton anywhere that indicates how to implement a
> method that will be properly processed...
>
> Has anyone ever done this before and know how to do it?

Hi Julie,

Have you read the configuration file documentation?  You can find a pointer to
it in the overview for the ConfiguredUniverse class documentation.  There is
also a description of the facilities you need in the ConfigContainer class
documentation (ConfigContainer is public in J3D 1.3.1).

You need to implement a method in your InputDevice, say "Components", that
takes Object[] as a parameter: public void Components(Object[] c).  Then in the
configuration file you pass the Canvas3D to the Components() method using the
DeviceProperty command and the Canvas3D built-in:

(DeviceProperty <id> Components (Canvas3D <wid>))

Where <id> is the name of your input device, and <wid> is the name of the
window or screen.  The Components() method of your InputDevice then gets a
array of length 1 containing the instance of Canvas3D used by the named window
or screen.

To make sure it will work, try using just the latest stuff from J3D 1.3.1, and
not a mixture of home-grown and released stuff -- I know that you folks in
U. Calgary have a lot of customized versions of the public classes.

In the com.sun.j3d.input package there is also an example implementation of a
mouse-driven InputDevice that can be set up from a configuration file to get
the canvas of the screen it's running on.  Let me know if you need the source
code for this package.

If the doc and the example programs don't help, I can try to answer any
specific questions you have.

-- Mark Hood

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