Single Event -> Multiple Event 
Author Message
 Single Event -> Multiple Event

Greetings,

Previously I have raised the questions of whether we could animate
the background sky color using e.g. the ColorInterpolator.  It seems
not possible as Background do not have children parameter. Maybe
that's why I do not receive any reply. :<

Now I am trying to animate the background using multiple scripts node.
Each script have a short delay loop and would bind one background node in
the scene when leaving the script node(suppose 3 bg node and 3 script
node there)

At the start, I thought I could trigger a sequence by:
. one touch sensor --ROUTE--> script1
. (after half second)
   script1 --ROUTE--> bind one bg node
           --ROUTE--> trigger script2 node by sending the timestamp
. (after half second)
   script2 --ROUTE--> bind another bg node
           --ROUTE--> trigger script3 node
. (after half second)
   script3 --ROUTE--> bind another bg node

However though I know there is a binding event as the console of LR
tells me, the background would change color only after the sequence is
finished!  That is, the bg color would 'jump' to the final bg color
instead of gradually changing from one to another one.

I am believed the reason is in the view of browser the single event
by the touchsensor would treat all the subsequent event happened
*simultaneouly*.  So the browser's main concern is the final result.

So is that possible to trigger one event and then fork multiple event?
Sorry that if I have stated something wrong.  I am also seeking
to implement this by other alternative.  Thanks for your help in
advance.

Gerry

-----------------------------------------------------
Gerry Lau
vrml Model designer

    http://www.*-*-*.com/ ~gerry/
Current Project:
Constructing the VRML model of my University, HKUST
    http://www.*-*-*.com/
-----------------------------------------------------



Sat, 14 Aug 1999 03:00:00 GMT  
 Single Event -> Multiple Event


Quote:
> Greetings,

> Previously I have raised the questions of whether we could animate
> the background sky color using e.g. the ColorInterpolator.  It seems
> not possible as Background do not have children parameter. Maybe
> that's why I do not receive any reply. :<

To me it seems possible to animate the skyColor by using a Script. The
Script is needed to make the SFColor from the ColorInterpolator a MFColor
for the Background.

Quote:
> Now I am trying to animate the background using multiple scripts node.
> Each script have a short delay loop and would bind one background node in
> the scene when leaving the script node(suppose 3 bg node and 3 script
> node there)

> At the start, I thought I could trigger a sequence by:
> . one touch sensor --ROUTE--> script1
> . (after half second)
>    script1 --ROUTE--> bind one bg node
>            --ROUTE--> trigger script2 node by sending the timestamp
> . (after half second)
>    script2 --ROUTE--> bind another bg node
>            --ROUTE--> trigger script3 node
> . (after half second)
>    script3 --ROUTE--> bind another bg node

> However though I know there is a binding event as the console of LR
> tells me, the background would change color only after the sequence is
> finished!  That is, the bg color would 'jump' to the final bg color
> instead of gradually changing from one to another one.

All events from the same cascade have the same timestamp, unless you set
the timestamp yourself. Simply waiting in your Script doesn't change this
(but only makes the script slower). I suppose it is possible to change the
timestamp, but I don't knowe how. Alternatively, you could use a
TimeInterpolator to call a Script every 0.5 seconds, and have that Script
change the skyColor.

Quote:
> I am believed the reason is in the view of browser the single event
> by the touchsensor would treat all the subsequent event happened
> *simultaneouly*.  So the browser's main concern is the final result.

Rigkt.

Quote:
> So is that possible to trigger one event and then fork multiple event?

The spec says script languages might allow it, but I can't find if Java
can do it. Read the spec for further information.

I hope I've given anough info. All this information is purely theoretical,
I have no idea how it works out in reality.

Bey,
        Marijn

-------------------------------------------------------------
 ros et vies dot rue dot enel
-------------------------------------------------------------
 Commercial and/or unsolicited email and/or spam will be
 processed for a DFL100 handling fee. Unsolicited sending
 constitutes acceptance.  
-------------------------------------------------------------



Sun, 15 Aug 1999 03:00:00 GMT  
 Single Event -> Multiple Event



: To me it seems possible to animate the skyColor by using a Script. The
: Script is needed to make the SFColor from the ColorInterpolator a MFColor
: for the Background.

Since I am a novice in writing java (which is the supported programming
language in Liquid Reality), I still cannot find the way to connect the
parameter of Background node (or the node without children) to Script.

: All events from the same cascade have the same timestamp, unless you set
: the timestamp yourself. Simply waiting in your Script doesn't change this
: (but only makes the script slower). I suppose it is possible to change the
: timestamp, but I don't knowe how. Alternatively, you could use a
: TimeInterpolator to call a Script every 0.5 seconds, and have that Script
: change the skyColor.

I thought there is no node in spec which would perform as
'TimeInterpolator'.  In fact I have tried to deliberately change the
timestamp before it passes to other script node so as to 'mask' the
browser they are not happened at the same time.  But the result is
the timestamp could not be altered and all the subsequent script
are still passing the same timestamp.  Could any expert point out
the error in the following code?

java code:   nextScript.setValue(e.getTimeStamp()+1);
                                                 ^^ arbitrary number
wrl code:    ROUTE SCRIPT1.nextScript TO SCRIPT2.startNow

: > So is that possible to trigger one event and then fork multiple event?
: The spec says script languages might allow it, but I can't find if Java
: can do it. Read the spec for further information.
: I hope I've given anough info. All this information is purely theoretical,
: I have no idea how it works out in reality.

Yet thanks your patience to read my very long post, and to all others.

Gerry

-----------------------------------------------------
Gerry Lau
VRML Model designer

   http://www.hk.linkage.net/~gerry/
Current Project:
Constructing the VRML model of my University, HKUST
   http://cmlms01.ee.ust.hk/vrust/
-----------------------------------------------------



Sun, 15 Aug 1999 03:00:00 GMT  
 Single Event -> Multiple Event


Quote:


> : To me it seems possible to animate the skyColor by using a Script. The
> : Script is needed to make the SFColor from the ColorInterpolator a MFCol=
or
> : for the Background.
>=20
> Since I am a novice in writing java (which is the supported programming
> language in Liquid Reality), I still cannot find the way to connect the
> parameter of Background node (or the node without children) to Script.

I'm sorry to hear that. Can you post a URL of a small world/java-script
trying it? That way we can see more easily what you (don't) know. I know
that reading Fields is not easy, I'm trying it too.

Quote:
> : All events from the same cascade have the same timestamp, unless you se=
t
> : the timestamp yourself. Simply waiting in your Script doesn't change th=
is
> : (but only makes the script slower). I suppose it is possible to change =
the
> : timestamp, but I don't knowe how. Alternatively, you could use a
> : TimeInterpolator to call a Script every 0.5 seconds, and have that Scri=
pt
> : change the skyColor.
>=20
> I thought there is no node in spec which would perform as=20
> 'TimeInterpolator'.

Oops, sorry, I meant TimeSensor. That'll do the trick.

Quote:
> In fact I have tried to deliberately change the timestamp before it
> passes to other script node so as to 'mask' the browser they are not
> happened at the same time.  But the result is the timestamp could not be
> altered and all the subsequent script are still passing the same
> timestamp.  Could any expert point out the error in the following code?=
=20
>=20
> java code:   nextScript.setValue(e.getTimeStamp()+1);
>                                                  ^^ arbitrary number

The problem is that you set the Value of the event, not the timestamp.
Every event has a value and a timestamp. For SFTime events, they are
normally the same, but you can change at least the Value.

Try (read try): nextscript.setTimeStamp(e.getTimeStamp()+1);

But the TimeSensor is simpler, more OO, etc.

Bye,
=09Marijn

-------------------------------------------------------------
 ros et vies dot rue dot enel
-------------------------------------------------------------
 Commercial and/or unsolicited email and/or spam will be
 processed for a DFL100 handling fee. Unsolicited sending
 constitutes acceptance. =20
-------------------------------------------------------------



Mon, 16 Aug 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problem with writing single event handler for multiple widgets

2. using multiple event structures polling for panel closing event

3. Tcl Event Loop vs TK Event Loop issues with Asynchronous Events

4. Consuming input events in a single method

5. <<ListboxSelect>> virtual event

6. listbox and <<ListboxSelect>> event

7. Receiving Apple Events in a RB app (HandleAppleEvent event)

8. Event structure always capturing events, no matter where it is placed in a VI

9. Boolean controls don't respond to input when inside an event in the event structure

10. Event case missing mouse events on active-x component

11. Event Structure and Events

12. Disambiguating java.awt.Event and vrml.Event?

 

 
Powered by phpBB® Forum Software