Looking for some samples about EAI 
Author Message
 Looking for some samples about EAI

Hi,

I want to use EAI  to control my world. This means adding ExternProto's to
my world. Does anyone have some good examples of this ?
Do i have to copy the current wrl and then add the node ? Or is it possible
to it with addChildren ?

Once this works, does the browser (internet explorer) needs to be refreshed
or just the vrml browser (i'm using Cosmoplayer 2.1.1) ?

Thanks for reading this.

Gerry



Sat, 12 Oct 2002 03:00:00 GMT  
 Looking for some samples about EAI
Check out this interesting VRML 2.0 EAI FAQ:
http://members.xoom.com/muratak/eaifaq.htm or
http://www.tiki-lounge.com/~raf/vrmljavafaqs

Below I inserted some programm code of 3 files:
NullWelt.wrl : defines an empty world
proto.wrl: defines a coordinate system using PROTO
myVRML.java: pressing an applet button adds coordinate systems to the empty
world using EAI

Hope this will help you a bit.
Rania

######################################################################
###This wrl file defines my empty VRML world###
###NullWelt.wrl###
######################################################################
#VRML V2.0 utf8
EXTERNPROTO CoordSys [ exposedField SFVec3f position
   exposedField SFRotation orient
    exposedField MFString label] "proto.wrl#CoordSys"
EXTERNPROTO Arrow [exposedField SFRotation angle
     exposedField SFColor color] "proto.wrl#Arrow"
CoordSys{}
Arrow{}

PointLight
{
  ambientIntensity 1
  attenuation 1 0 0
  color 1 1 1
  location  -3 0 0
  on TRUE
  radius 200

Quote:
}

DEF GELENK1 Transform
{
  translation 0 0 0
  rotation 0 0 0 0
 # scale 0.3 0.3 0.3
  children
  [
    CoordSys { position 0 0 0 orient 0 0 0 0 label " Frame 0"}
  ]

Quote:
}

######################################################################
###This wrl file defines my PROTO###
######################################################################

#VRML V2.0 utf8

PROTO Labeling [exposedField MFString label  ""]
{
  Transform {
    translation 2 0 0
    children [
        Shape { geometry Text { string  IS label
           fontStyle FontStyle {
             family "SANS"
              style "BOLD"
             size 0.5
              justify "MIDDLE"
              topToBottom TRUE
                                }
                              }
                }

    ]
  }

Quote:
}

PROTO Arrow [exposedField SFRotation angle 0 0 1 0
     exposedField SFColor color  .8 .4 .7
     exposedField MFString label ""  ]

{
  Transform {
    #rotation 0 0 1 -1.571  # normal ist  x-Richtung
    rotation IS angle
    children [

      Transform { # Base
 translation 0 1.5 0
 #rotation IS angle
 rotation 0 0 1 -1.571  # normal ist  x-Richtung
 center 0 -1.5 0
        children [
          Shape { geometry Text { string  IS label
           fontStyle FontStyle {
             family "SANS"
              style "BOLD"
             size 0.5
              justify "MIDDLE"
              topToBottom TRUE
                                }
                                }
                }
          Shape {
            appearance Appearance {
              material Material { diffuseColor IS color }
            }
            geometry Cylinder { height 3 radius 0.02 }
          }
   Transform {   # Head
     translation 0 1.5 0
     children
     Shape {
       appearance Appearance {
  material Material { diffuseColor IS color }
       }
       geometry Cone { height 0.5 bottomRadius 0.1}

     }
   }
 ]
      } # End Base
    ]
  }

Quote:
} # End of prototype

PROTO CoordSys [ exposedField SFVec3f position 0 0 0
   exposedField SFRotation orient 0 0 1 0
   exposedField MFString label  ""]
{
  Transform {
    translation IS position
    rotation IS orient
    children [
      Arrow { angle 0 0 1 0 color 0 1 0 label "   x"}
      #Labeling { label "x"}
      Arrow { angle  0 0 1  1.571  color 0  0  1 label "   z"}
      Arrow { angle    0 1  0  -1.571  color 1 0 0 label "  y"}
      Shape { geometry Sphere { radius 0.1 } }
      Shape { geometry Text { string  IS label
 fontStyle FontStyle {
   family "SANS"
   style "BOLD"
   size 0.5
 }
      }
      }

    ]
  }

Quote:
}

######################################################################
### Java file ###
###myVRML.java###
###Adds coordinate systems to the empty world###
######################################################################
package GUI;

import javax.swing.*;
import java.util.*;
import java.io.*;
import java.lang.Math;
import vrml.external.field.*;
import vrml.external.Node;
import vrml.external.Browser;
import vrml.external.exception.*;

public class myVRML {
[...]

Quote:
}

[...]

public void DrawRobot()
  {
     Node root;
     Node[] childrennodes;
     Node[] kindknoten;
     EventInMFNode addChildren;

     int i=0;

     kindknoten = browser.createVrmlFromString(
     "EXTERNPROTO CoordSys [ exposedField SFVec3f position\n"+
     "exposedField SFRotation orient\n"+
     "exposedField MFString label] \"proto.wrl#CoordSys\"\n"+
     "EXTERNPROTO Arrow [exposedField SFRotation angle\n"+
     "exposedField SFColor color] \"proto.wrl#Arrow\"\n"+
     "CoordSys{}\n"+
     "Arrow{}\n"+
     "Transform\n"+
        "{\n"+
          "rotation 0 0 1 "+(dhParameter[1][i]*(Math.PI/180))+"  #theta\n"+
          "translation 0 0 "+dhParameter[2][i]+"    #d\n"+
          "children\n"+
          "[\n"+
            "Transform\n"+
            "{\n"+
              "translation "+dhParameter[3][i]+" 0 0     #l\n"+
              "rotation 1 0 0 "+(dhParameter[4][i]*(Math.PI/180))+"
#alpha\n"+
              "children\n"+
              "[\n"+
                "CoordSys {position 0 0 0 orient 0 0 0 0 label \" Frame
1\"}\n"+
             "]\n"+
            "}\n"+
          "]\n"+
        "}\n");

      file://Get handle to root of the scene graph
      root = browser.getNode("GELENK1");
     addChildren = (EventInMFNode)root.getEventIn("addChildren");
      addChildren.setValue(kindknoten);
     // MeinApplet.jTextField1.setText(kindknoten[2].getType());

childrennodes=((EventOutMFNode)(kindknoten[2].getEventOut("children_changed"
))).getValue();

     i=1;
     kindknoten = browser.createVrmlFromString(
     "EXTERNPROTO CoordSys [ exposedField SFVec3f position\n"+
    "exposedField SFRotation orient\n"+
    "exposedField MFString label] \"proto.wrl#CoordSys\"\n"+
     "EXTERNPROTO Arrow [exposedField SFRotation angle\n"+
     "exposedField SFColor color] \"proto.wrl#Arrow\"\n"+
     "CoordSys{}\n"+
     "Arrow{}\n"+
     "Transform\n"+
        "{\n"+
          "rotation 0 0 1 "+(dhParameter[1][i]*(Math.PI/180))+"  #theta\n"+
          "translation 0 0 "+dhParameter[2][i]+"    #d\n"+
          "children\n"+
          "[\n"+
            "Transform\n"+
            "{\n"+
              "translation "+dhParameter[3][i]+" 0 0     #l\n"+
              "rotation 1 0 0 "+(dhParameter[4][i]*(Math.PI/180))+"
#alpha\n"+
              "children\n"+
              "[\n"+
              "CoordSys {position 0 0 0 orient 0 0 0 0 label \" Frame
2\"}\n"+
             "]\n"+
            "}\n"+
          "]\n"+
        "}\n");

      addChildren =
(EventInMFNode)childrennodes[0].getEventIn("addChildren");
      addChildren.setValue(kindknoten);

  }



Quote:
> Hi,

> I want to use EAI  to control my world. This means adding ExternProto's to
> my world. Does anyone have some good examples of this ?
> Do i have to copy the current wrl and then add the node ? Or is it
possible
> to it with addChildren ?

> Once this works, does the browser (internet explorer) needs to be
refreshed
> or just the VRML browser (i'm using Cosmoplayer 2.1.1) ?

> Thanks for reading this.

> Gerry



Sat, 12 Oct 2002 03:00:00 GMT  
 Looking for some samples about EAI
Thanks a lot, it is what i was looking for. Hoooraaaayyyyyy !!!

Gerry

Quote:

>Check out this interesting VRML 2.0 EAI FAQ:
>http://members.xoom.com/muratak/eaifaq.htm or
>http://www.tiki-lounge.com/~raf/vrmljavafaqs

>Below I inserted some programm code of 3 files:
>NullWelt.wrl : defines an empty world
>proto.wrl: defines a coordinate system using PROTO
>myVRML.java: pressing an applet button adds coordinate systems to the empty
>world using EAI

>Hope this will help you a bit.
>Rania

>######################################################################
>###This wrl file defines my empty VRML world###
>###NullWelt.wrl###
>######################################################################
>#VRML V2.0 utf8
>EXTERNPROTO CoordSys [ exposedField SFVec3f position
>   exposedField SFRotation orient
>    exposedField MFString label] "proto.wrl#CoordSys"
>EXTERNPROTO Arrow [exposedField SFRotation angle
>     exposedField SFColor color] "proto.wrl#Arrow"
>CoordSys{}
>Arrow{}

>PointLight
>{
>  ambientIntensity 1
>  attenuation 1 0 0
>  color 1 1 1
>  location  -3 0 0
>  on TRUE
>  radius 200
>}

>DEF GELENK1 Transform
>{
>  translation 0 0 0
>  rotation 0 0 0 0
> # scale 0.3 0.3 0.3
>  children
>  [
>    CoordSys { position 0 0 0 orient 0 0 0 0 label " Frame 0"}
>  ]
>}

>######################################################################
>###This wrl file defines my PROTO###
>######################################################################

>#VRML V2.0 utf8

>PROTO Labeling [exposedField MFString label  ""]
>{
>  Transform {
>    translation 2 0 0
>    children [
>        Shape { geometry Text { string  IS label
>           fontStyle FontStyle {
>             family "SANS"
>              style "BOLD"
>             size 0.5
>              justify "MIDDLE"
>              topToBottom TRUE
>                                }
>                              }
>                }

>    ]
>  }
>}

>PROTO Arrow [exposedField SFRotation angle 0 0 1 0
>     exposedField SFColor color  .8 .4 .7
>     exposedField MFString label ""  ]

>{
>  Transform {
>    #rotation 0 0 1 -1.571  # normal ist  x-Richtung
>    rotation IS angle
>    children [

>      Transform { # Base
> translation 0 1.5 0
> #rotation IS angle
> rotation 0 0 1 -1.571  # normal ist  x-Richtung
> center 0 -1.5 0
>        children [
>          Shape { geometry Text { string  IS label
>           fontStyle FontStyle {
>             family "SANS"
>              style "BOLD"
>             size 0.5
>              justify "MIDDLE"
>              topToBottom TRUE
>                                }
>                                }
>                }
>          Shape {
>            appearance Appearance {
>              material Material { diffuseColor IS color }
>            }
>            geometry Cylinder { height 3 radius 0.02 }
>          }
>   Transform {   # Head
>     translation 0 1.5 0
>     children
>     Shape {
>       appearance Appearance {
>  material Material { diffuseColor IS color }
>       }
>       geometry Cone { height 0.5 bottomRadius 0.1}

>     }
>   }
> ]
>      } # End Base
>    ]
>  }
>} # End of prototype

>PROTO CoordSys [ exposedField SFVec3f position 0 0 0
>   exposedField SFRotation orient 0 0 1 0
>   exposedField MFString label  ""]
>{
>  Transform {
>    translation IS position
>    rotation IS orient
>    children [
>      Arrow { angle 0 0 1 0 color 0 1 0 label "   x"}
>      #Labeling { label "x"}
>      Arrow { angle  0 0 1  1.571  color 0  0  1 label "   z"}
>      Arrow { angle    0 1  0  -1.571  color 1 0 0 label "  y"}
>      Shape { geometry Sphere { radius 0.1 } }
>      Shape { geometry Text { string  IS label
> fontStyle FontStyle {
>   family "SANS"
>   style "BOLD"
>   size 0.5
> }
>      }
>      }

>    ]
>  }
>}

>######################################################################
>### Java file ###
>###myVRML.java###
>###Adds coordinate systems to the empty world###
>######################################################################
>package GUI;

>import javax.swing.*;
>import java.util.*;
>import java.io.*;
>import java.lang.Math;
>import vrml.external.field.*;
>import vrml.external.Node;
>import vrml.external.Browser;
>import vrml.external.exception.*;

>public class myVRML {
>[...]
>}

>[...]

>public void DrawRobot()
>  {
>     Node root;
>     Node[] childrennodes;
>     Node[] kindknoten;
>     EventInMFNode addChildren;

>     int i=0;

>     kindknoten = browser.createVrmlFromString(
>     "EXTERNPROTO CoordSys [ exposedField SFVec3f position\n"+
>     "exposedField SFRotation orient\n"+
>     "exposedField MFString label] \"proto.wrl#CoordSys\"\n"+
>     "EXTERNPROTO Arrow [exposedField SFRotation angle\n"+
>     "exposedField SFColor color] \"proto.wrl#Arrow\"\n"+
>     "CoordSys{}\n"+
>     "Arrow{}\n"+
>     "Transform\n"+
>        "{\n"+
>          "rotation 0 0 1 "+(dhParameter[1][i]*(Math.PI/180))+"  #theta\n"+
>          "translation 0 0 "+dhParameter[2][i]+"    #d\n"+
>          "children\n"+
>          "[\n"+
>            "Transform\n"+
>            "{\n"+
>              "translation "+dhParameter[3][i]+" 0 0     #l\n"+
>              "rotation 1 0 0 "+(dhParameter[4][i]*(Math.PI/180))+"
>#alpha\n"+
>              "children\n"+
>              "[\n"+
>                "CoordSys {position 0 0 0 orient 0 0 0 0 label \" Frame
>1\"}\n"+
>             "]\n"+
>            "}\n"+
>          "]\n"+
>        "}\n");

>      file://Get handle to root of the scene graph
>      root = browser.getNode("GELENK1");
>     addChildren = (EventInMFNode)root.getEventIn("addChildren");
>      addChildren.setValue(kindknoten);
>     // MeinApplet.jTextField1.setText(kindknoten[2].getType());

>childrennodes=((EventOutMFNode)(kindknoten[2].getEventOut("children_changed
"
>))).getValue();

>     i=1;
>     kindknoten = browser.createVrmlFromString(
>     "EXTERNPROTO CoordSys [ exposedField SFVec3f position\n"+
>    "exposedField SFRotation orient\n"+
>    "exposedField MFString label] \"proto.wrl#CoordSys\"\n"+
>     "EXTERNPROTO Arrow [exposedField SFRotation angle\n"+
>     "exposedField SFColor color] \"proto.wrl#Arrow\"\n"+
>     "CoordSys{}\n"+
>     "Arrow{}\n"+
>     "Transform\n"+
>        "{\n"+
>          "rotation 0 0 1 "+(dhParameter[1][i]*(Math.PI/180))+"  #theta\n"+
>          "translation 0 0 "+dhParameter[2][i]+"    #d\n"+
>          "children\n"+
>          "[\n"+
>            "Transform\n"+
>            "{\n"+
>              "translation "+dhParameter[3][i]+" 0 0     #l\n"+
>              "rotation 1 0 0 "+(dhParameter[4][i]*(Math.PI/180))+"
>#alpha\n"+
>              "children\n"+
>              "[\n"+
>              "CoordSys {position 0 0 0 orient 0 0 0 0 label \" Frame
>2\"}\n"+
>             "]\n"+
>            "}\n"+
>          "]\n"+
>        "}\n");

>      addChildren =
>(EventInMFNode)childrennodes[0].getEventIn("addChildren");
>      addChildren.setValue(kindknoten);

>  }



>> Hi,

>> I want to use EAI  to control my world. This means adding ExternProto's
to
>> my world. Does anyone have some good examples of this ?
>> Do i have to copy the current wrl and then add the node ? Or is it
>possible
>> to it with addChildren ?

>> Once this works, does the browser (internet explorer) needs to be
>refreshed
>> or just the VRML browser (i'm using Cosmoplayer 2.1.1) ?

>> Thanks for reading this.

>> Gerry



Sat, 12 Oct 2002 03:00:00 GMT  
 Looking for some samples about EAI
VRML EAI can be made to work,  but consider x3d ...

 " VRML EAI FAQ "
  http://www.*-*-*.com/ ~imaging/eaifaq.html

 " VRML EAI Demo :  H-Anim People Poser "
  http://www.*-*-*.com/ ~imaging/HAnimPoser.html

 - works with :
  * Windows & Macintosh,
  * Cosmo & Blaxxun Contact ( not sure about ParallelGraphics )
  * Internet Explorer & Netscape
  ( not all combinations, such is EAI )

---  VRML EAI is _ problematic _ ---

 - the specification was never finalized,
it was left ambiguous, and VRML viewers
can and do implement it different ways and
creating VRML EAI that work with the multiple
combinations of VRML viewer, browser,
and OS is _ very _ difficult.

Quote:

>  I want to use EAI  to control my world.
>  This means adding ExternProto's to my world.
>  Does anyone have some good examples of this ?
>  Do i have to copy the current wrl and then add the node ?
>  Or is it possible to it with addChildren ?

>  Once this works, does the browser (internet explorer) needs
>  to be refreshed or just the VRML browser (i'm using
>  Cosmoplayer 2.1.1) ?



 Actually ExternProto-s aren't required,  PROTO-s work.

 The H-Anim ( Human Animation for web avatars ) standard
uses PROTOs and not ExternProtos

  Generally a simple "empty.wrl" is loaded and then other
scenes are added to it and the display is automatically updated,
and that's what I did with the H-Anim Poser.

  If you use Script nodes to the browser it
will _ NOT _  work with Netscape.

- - - the emerging _ x3d _ viewers may be solution  - - -

 x3d / VRML 200x is the emerging standard expected to
replace VRML-97 in 2002 and x3d viewers are available
now ( Shout3d and Blaxxun3d ) as web page programs
( not a plug-in :  portable Java ).

 " ez Avatar Builder " : x3d Viewer with added controls :

  http://www.*-*-*.com/ ~imaging/avatar_builder.html

 Features :  the Shout3d Java x3d Viewer and ...

  - displays multiple scenes ( seven ) selected by List.
  - prompts and status messages
  - scene can be shown as text ( nodes are queried )
  - rendering options are selectable ( by tonight anyway )

 This is a work in progress, additional features will be
added ( the type that have formerly be done with EAI ).

  The VRML scene nodes are available through a simpler,
cleaner, faster ( dare I say better ) methods ( direct ) with
Java calling Java in the Java x3d implementations.

  VRML EAI is more complex and more likely to fail
because it requires more ( 3 vs 1 )  components to work
together.

 It's a trade-off : where high speed rendering of complex
scenes is more important than portability, VRML EAI
may be the best choice ... but for most web pages ...
most of us and most sites do not want to exclude people
with Macintosh computers or the other systems that
are becoming increasing more commonplace : PDAs,
Web Pads, phones & TV's ( soon ), EPOC, BE, etc.

__ x3d  __  No new VRML ?  There is new x3d __

" Chase / Gun Fight " :  'Beat Monk Bash'
  http://www.*-*-*.com/

" Fashion Show " ( multiple models, outfits )
  http://www.*-*-*.com/ {*filter*}xtreme.com/fashion/

 " Superhero Combat Fighter Demo "
   Vcomix Kneseis from VCom / Seamless Solutions
  http://www.*-*-*.com/

 " Gesturing Avatars : Louise "  ( AvatarDom )
  http://www.*-*-*.com/

 " x3d is ...  totally fabulous !  Let me repeat
TOTALLY FABULOUS !  " -- Paul S. Hoffman
  http://www.*-*-*.com/

 The Web is a new world :  think beyond the PC.

 -- Paul ( the other one ),  Java Developer,  Web Animator.

 ------------------------------------------------------------------------
 "Imaging the Imagined : Modeling with Math & a Keyboard"



Sat, 12 Oct 2002 03:00:00 GMT  
 Looking for some samples about EAI
On Tue, 25 Apr 2000 16:13:19 GMT, "P Flavin"

Quote:

>VRML EAI can be made to work,  but consider x3d ...

This is a vrml group not a bullshitters x3d group!

Jake



Sat, 12 Oct 2002 03:00:00 GMT  
 Looking for some samples about EAI
The kindly Rev. overheard news.cableinet.co.uk (jake reid) saying on 25
Apr 2000:

Quote:
>On Tue, 25 Apr 2000 16:13:19 GMT, "P Flavin"

>>VRML EAI can be made to work,  but consider x3d ...

>This is a vrml group not a bullshitters x3d group!

This is a technical newsgroup, not a refuge for adolescents acting out
their concerns about the inadequate size of their {*filter*}s.

That said, there are problems with both Java3D and the EAI, though the
problem with the former is more a matter of lack of ubiquity than any
technical problem I've observed in my brief experiments with it.
--
Rev. Bob "Bob" Crispen
crispen at hiwaay dot net

If you ever reach total enlightenment while you're drinking a beer,  
I bet it makes beer shoot out your nose.



Sat, 12 Oct 2002 03:00:00 GMT  
 Looking for some samples about EAI

Quote:

>  The Web is a new world :  think beyond the PC.

>  -- Paul ( the other one ),  Java Developer,  Web Animator.

>  ------------------------------------------------------------------------
>  "Imaging the Imagined : Modeling with Math & a Keyboard"

VRML can be a new world: think beyond the web
Only thing needed: a fully compliant open source VRML stand alone browser
Let this have a chance to happen

Sylvain Carette
VRML designer-composer



Sat, 12 Oct 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Developping an EAI server in Python : looking for developpers

2. looking for APPC/CPI-C tutorial and samples

3. Looking for small, straightforward FORTHish sample

4. Looking for sample code for CDX indexes

5. Looking for sample LEX/YACC with C++

6. looking for samples

7. Always looking for VRML samples

8. Looking for large VHDL sample code to test VHDL parser

9. looking for sample source code

10. Looking for Winsock samples programs (client/server)

11. newbie looking for TASM sample files

12. Q:Looking Sample ASM Program for windows

 

 
Powered by phpBB® Forum Software