EAI help needed 
Author Message
 EAI help needed

I met some problem when implementing the EAI interface to the 3D world.

I will appreciated if someone can offer me help in solving some EAI
problems.

The first problem was that in the 3D world, i am using EAI driven viewpoint
to manipulate the movement in the 3D world.
What i mean was that the viewpoint is driven by EAI and not the
viewpoint node in the 3D world. I am using
Node[] new_node_array;
String view_vrml = #VRML V2.0 utf8\n +
Viewpoint {\n +
 position  7.5 1.6 20\n +
 description  \UserInterfaces viewpoint\\n + }\n;
try {
new_node_array = browser.createVrmlFromString(view_vrml);
  }

However, when i driven the viewpoint, it doesnt detect any collision even
manually setting the option of setting the collision node in the 3D world
file.
I think the problem was that it was driven by EAI and not the viewpoint node
in the 3D world. I dunno whether it is correct to do in this way since i my
project required to detect for object collision. One more thing, be it i
disabled or enabled the cosmo player NONE or ANY or WALK, it doesnt
work too.
I have asked this question quite a number of time and no reply yet. I do
hope soeone really can help me solve the problem.

If the problem is due to the EAI, I will rewrite the whole coding again and
this time trying to manipulate the viewpoint node in the 3D world.  I dunno
whether this will work fine or not.

My question is for this :
If i move forward straight, this is simple since i only changed the z
coord point.
However, when i move left or right ( not 90degree, probably about 10 degree
per key), i think by changing the orientation field in the viewpoint node
will be fine but then the problem was that when i continue to move forward
using this 10 degree orientation, it doesnt go in the correct way, it will
still move in the straight direction.  maybe due tot he probelm setting in
the forward key coz i am changing the z position.
Is there a simple calculation to move the viewpoint node correctly by using
EAI interface? forward, backward, left (10degree) and right(10degree) are
using Java applet to create.

Thanks for any help given in advance and pls forgive me for my poor
language.

If the problem is unclear to you, pls let me know and i will try what i can
explain next.
I really need the help very much as my Project is coming to due date.

Thank you
Lim Choong Wee



Wed, 15 Aug 2001 03:00:00 GMT  
 EAI help needed

Quote:

> The first problem was that in the 3D world, i am using EAI driven viewpoint
> to manipulate the movement in the 3D world.
> ...
> However, when i driven the viewpoint, it doesnt detect any collision even
> manually setting the option of setting the collision node in the 3D world
> file.

Try actually placing the Viewpoint in the vrml file to start out - and
then controlling it through the EAI - you don't have to create it in the
Java in order to control it.

Quote:
> One more thing, be it i
> disabled or enabled the cosmo player NONE or ANY or WALK, it doesnt
> work too.

If you are controlling the Viewpoint's position and orientation through
Java, you are not making use of the VRML browser's navigation modes
anyway - they would be totally irrelevant to what you are doing. If you
need to mimic gravity, you will have to do all the calculating of
surfaces and positions (re-creating all the work done by the browser
programmers).

Quote:
> My question is for this :
> If i move forward straight, this is simple since i only changed the z
> coord point.
> However, when i move left or right ( not 90degree, probably about 10 degree
> per key), i think by changing the orientation field in the viewpoint node
> will be fine but then the problem was that when i continue to move forward
> using this 10 degree orientation, it doesnt go in the correct way, it will
> still move in the straight direction.  maybe due tot he probelm setting in
> the forward key coz i am changing the z position.

Absolutely - when the orientation of the viewpoint is changed, your
coordinate system is not rotated with it - you would have to calculate
the new "forward" vector and change position based on projecting the
movement along that vector.

Quote:
> Is there a simple calculation to move the viewpoint node correctly by using
> EAI interface? forward, backward, left (10degree) and right(10degree) are
> using Java applet to create.

Simple? no.

- Paul
***********************************
Paul S. Hoffman
Senior Interface Designer, Cognetics Corporation

Company URL - http://www.cognetics.com
Personal URL - http://pluto.njcc.com/~paulsam
609-799-5005 ext.237 - FAX 609-799-8555



Wed, 15 Aug 2001 03:00:00 GMT  
 EAI help needed


Quote:
>My question is for this :
>If i move forward straight, this is simple since i only changed the z
>coord point.
>However, when i move left or right ( not 90degree, probably about 10 degree
>per key), i think by changing the orientation field in the viewpoint node
>will be fine but then the problem was that when i continue to move forward
>using this 10 degree orientation, it doesnt go in the correct way, it will
>still move in the straight direction.  maybe due tot he probelm setting in
>the forward key coz i am changing the z position.
>Is there a simple calculation to move the viewpoint node correctly by using
>EAI interface? forward, backward, left (10degree) and right(10degree) are
>using Java applet to create.

Yes, there is.

The key to your problem is the understanding of this VRML
rotation/orientation thing.  It's additive to the default angle.
But not additive for the next transformation.

Try to get access to the orientation field:

Browser browser=browser.getBrowser(this);
Node navInfo=browser.getNode("YourNavigationInfo");
// it must be DEFed 'YourNavigationInfo'
EventInSFRotation orient;
orient=(EventInSFRotation)navInfo.getEventIn("orientation");

In the right-hand coordinate system of VRML a 10 degrees move left is
+ 1/9 of PI, about .35, around the y-coordinate, -.35 to the right.

Create a float array
float[] rotate={(float)0.0,(float)1.0,(float)0.0.(float)0.0};

You can then use the 4th parameter (rotate[3]) to manipulate the
y-coordinate:
rotate[3]=0.35; or .7 or 1.05 or -.35 or -.7 and so on.

Use orient.setValue(rotate); to inform the browser to change the
viewer's orientation.

---

But there are more ways to do this.  You have the opportunity to
use a built-in OrientationInterpolator by simply adding an addRoute
Statement for a more smoother animation.

Atschoe, Axel



Thu, 16 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need Help with Applet,VRML-EAI

2. Need help with EAI classes

3. Need help getting EAI site to work

4. Pb with EAI, please I need HELP!!!!

5. EAI .... help needed

6. EAI and coding to the EAI

7. Differences between EAI 1 and EAI 2

8. Difference between EAI and EAI 2nd generation?

9. Needed vrml.eai. for Cosmo 2.1 (netscape 4.5)

10. ***HELP***HELP***NEED INFORMATION***HELP***HELP

11. 3D Archaeology EAI Help!

12. Help with javascript/EAI/IE4.x!!!

 

 
Powered by phpBB® Forum Software