This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > August 2004 > deepmatrix..
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| apple 2004-08-22, 11:15 pm |
| refer to deepmatrix documentation chapter 6 (networkstate nodes), a net
node receive event via set_value eventIn and sends event to value_changed
eventOut, and need a VRML ROUTE works between several instances.
is that can also be implemented in EAI program?
in chapter 7 got some example on how to implement networkstate nodes but
that are implemented in wrl file,so how?? my eai program only call vrml
browser..
| |
| Muaddib 2004-08-22, 11:15 pm |
| Apple,
I only know the basics when it comes to DM, so if what I say is
wrong, for sure it will be corrected by more knowledgable minds. That
said, I don't believe DM has built in support for what I will call
client side java. I imagine you question to be:
How can my client side java program tell the DM server to propagate
messages across the net?
Here is a simple way to do it, and it all depends upon how you view
the situation. As in the last question you asked, have a page load up
with both the DM client, and your EAI applet. Now have a vrml node in
your scene that will act a "communicator" between the two. If you want
to have your EAI applet send info over the net, have it send an event to
this node, which routes it to another event, that DM understands to be
networked. When receiving the event at a remote client, have your EAI
applet listening for it.
Here is my plug :) If you are interested in building a vrml
application that has java components, consider VRSpace. We have
built-in support for both client side, and server side event processing.
In the VRSpace setting, you would place an entry for you EAI program
in the VRSpace database. When a user logs in, your program will be
downloaded along with the rest of the world, and the client will start it.
Networking in VRS looks something like this:
Your client vrml node --> Your client java --> Network --> Server
java --> Network --> Your client java @ all viewers --> Your vrml node @
all viewers. ( you can even choose a subset of viewers )
The system is not only designed to allow you to have java interface
with the scene at the client side, you can also process at the server
side. A simple example is a chess program with computer player:
Client side chess vrml --> Client side java ( validates moves,
shows java frame with game stats, validates move, etc. ) --> Network -->
Server java ( starts AI chess engine thinking about its counter move,
adds to recorded game history, persists in case you log off, records
wins for global game standings ) --> All clients vrml node.
Meanwhile, the computer player moves:
Server java --> All clients vrml node.
There are many more possibilities than the ones I have listed here.
Rob
--
-------------------------------------------------------
VRSpace - An open source, modular, cross-platform,
multi-user vrml system with persistent shared objects.
Check out the Nexus at http://www.vrspace.org/
-------------------------------------------------------
| |
|
| can you give me some sample?
| |
| Muaddib 2004-08-23, 7:19 pm |
| This is the simplest example I can think of: It is a shared object which
has no Java component. The classic Hello World! example, click on the
box and Hello World will appear. Click again and it will vanish. The
state of whether the message is showing or not is shared.
-------------------------------------------------------
#VRML V2.0 utf8
PROTO HelloWorld [
eventIn MFString SystemIn
eventOut MFString SystemOut
eventIn SFInt32 set_whichChoice
eventOut SFInt32 whichChoice
] {
Group {
children [
Box { size .3 .3 .3 }
DEF touch TouchSensor {}
]
}
Switch {
whichChoice IS set_whichChoice
choice [
Text {
string "Hello World!"
}
]
}
DEF script Script {
eventIn MFString SystemIn IS SystemIn
eventOut MFString SystemOut IS SystemOut
eventIn SFTime touchTime
eventIn SFInt32 set_whichChoice IS set_whichChoice
eventOut SFInt32 whichChoice IS whichChoice
field SFInt32 choice 0
url "java script:
function SystemIn( message ) {
type = message[ 0 ];
if ( type == 'init' ) {
SystemOut = new MFString('declareEvents', 'whichChoice');
}
}
function touchTime( e, t ) {
choice = ( 1 - choice ) % 2;
whichChoice = choice;
}
"
}
ROUTE touch.touchTime TO script.touchTime
}
HelloWorld {}
-------------------------------------------------------
Notice that in VRS there are no clunky SharedEvent nodes or
SharedObject nodes. Instead, every event you plan on sending out is
declared in the object's proto. The corresponding eventin is prefixed
with set_. The SystemIn and SystemOut nodes are a component of every
shared object. They carry messages from and to the server. When the
shared object first loads, before it receives any events, it is sent an
"init" event. During that time, it must declare any eventOuts in its
proto that are to be shared:
SystemOut = new MFString('declareEvents', 'whichChoice');
That's really all there is to it. Note that the last value of every
event sent out is saved at the server. Then, when a user comes to the
space, they receive these last values <--> shared object persistance.
I have placed the example inside the Nexus world at vrspace.org.
--
-------------------------------------------------------
VRSpace - An open source, modular, cross-platform,
multi-user vrml system with persistent shared objects.
Check out the Nexus at http://www.vrspace.org/
-------------------------------------------------------
| |
|
| i not very understand what is vrspace..is it a place for user to upload
things?? then i just need to upload my html file embeded vrml and java
applet class file?
deepmatrix provide chat client and logging vrml world facility, so we just
need do code in vrml file, then how to do in vrspace?
i very blur with the documentation in vrspace.org..
| |
| Muaddib 2004-08-24, 4:14 pm |
| Hi Apple,
> i not very understand what is vrspace..is it a place for user to upload
> things?? then i just need to upload my html file embeded vrml and java
> applet class file?
VRS is a multiuser platform with both server and client, in the
same way as Blaxxun, VNet, DeepMatrix, et al. However, in these other
systems the role of the server is to provide: a) Chat, b) User Movement,
c) Support of Shared Objects (Blaxxun, DM), d) Community functionality
(Blaxxun). These functionalities live on top of an underlying vrml
file. They add functionality to it.
VRS differs from them in one major respect: Everything is a Shared
Object. When you come to a VRS world, you don't download one big vrml
file. You login to the server, and IT populates your world. Imagine
one super System node(the client) that logs you in to a foreign server,
and that server sends back messages on how to populate your Scene, using
repeated createVrmlFromURL calls. Chatting is something the shared
object "Console" does. User movement is something that your shared
object "User" does.
This is why you may have gotten an emphasis on uploading files to
the server from the docs. When you want to add a new vrml file to your
world ( say a comp.lang.vrml newsreader ), you tell the server there is
a new object in the world, and it pops it in. Everything you see is
dynamically constructed, which has the upshot of being dynamically
manipulable. You can add, remove, move objects in real time and
collaboratively. Bottom line, when you want to add a new object to the
world, you upload it or tell the server a url where the file is located.
> deepmatrix provide chat client and logging vrml world facility, so we just
> need do code in vrml file, then how to do in vrspace?
If your shared object is composed only of a vrml file ( which is
all that is support for SOs in most servers ), then you create a new
object in the world to house it, and you are done.
If you want server side java then you extend the class VrmlFile,
and place the class files in a directory beneath your server jar. If
want client side java then you extend a class NodeManager, and place the
class files in a directory beneath the client jar.
Since everything is gpl here, and everything is a shared object,
you will find that the source itself contains many, many examples.
--
-------------------------------------------------------
VRSpace - An open source, modular, cross-platform,
multi-user vrml system with persistent shared objects.
Check out the Nexus at http://www.vrspace.org/
-------------------------------------------------------
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|