Hello Ralph,

I did make a behavior for an fps demo that we ran at Sun's booth during GDC.
I mapped the mouse x-Axis to rotation around Y, mouse y-Axis to rotation
around X and used the keyboard A, D, W, S and Left, Right, Up, Down for
stepping. Unfortunately, this behavior relies on our own input and scene
manipulation classes; therefore, it probably wouldn't be too useful to you.

As far as using the Robot class, yes I had to use it; and yes it doesn't
work that well

1)      It only works on some machines. The interesting part is that the
machines I tried it on are identical. The hardware is EXACTLY the same (from
mouse, video cards, to bios version) and their hard drives were cloned from
a single hard drive that we installed our stuff on. I went through numerous
things before I stopped trying to solve that problem. Luckily, I needed
at-least one machine that it worked on. The good news is that it works on
some machines (depending on how you look at it, this may be a real bad
news). On some machines when I sent a fix coordinate to the robot class the
pointer would disappear or jump around. I made sure that the construction of
the Robot class was not throwing any exceptions (and much more J ). At some
point I was considering writing a small dll that would center the mouse.
That way, if it worked, I could tell the jdk guys about a possible bug; and
if it had the same problem, I would keep trying. Unfortunately priorities
have changed and I've left that aside until I can get back to it (which may
be a while).



2)      At first I tried to re-center the mouse every frame if the computed
deltaX and deltaY were not zero. This didn't work too well; the motion was
not smooth at all. After trying many different things I was convinced that
there was a timing issue. In order to work around the problem, I decided to
re-center the mouse when it was about two thirds of the width or height of
the window away from the center. That worked great since there were far less
calls to "Robot.mouseMove(centerX, centerY)".



Once you resolve the problems with re-centering the mouse, the motion
shouldn't be too bad. As far as the keyboard-mapped navigations, it's a
simple local translation. To get the mouse-mapped ones, you have to get a
delta mouseX and delta mouseY which can be used to get a signed rotation
angle.



Take Care, SyrusM

----- Original Message -----
From: "Ralph Jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 02, 2001 2:25 PM
Subject: [JAVA3D] Question regarding navigation


Hi,

A while ago I tried to create a 3D world in Java 3D in which the user could
navigate using the familiar first person interface of 'mouse look' and 'key
move'.  Exactly the same as in Quake 3, Unreal, Half-Life etc.

I ended up giving up, as I couldn't find a way to successfully control the
mouse coordinates (the java.awt.Robot class couldn't set the mouse coords on
top of the Canvas3D).

I was just wondering if anybody else has approached this technique, and how
successful they were?

Thanks,

Ralph.

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

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