VRML JavaScript Tutorial
Sunday, April 18, 1999
Rev. Bob's Rectory
[lightly edited]
[Club Owner] revbob [475] : So what say let's get started?
Xopher [170] : cool
[Block Deputy] Bandersnatch [130] : ok
[Club Owner] revbob [475] : Everybody click on "Links"
in the frame to the right and click on the only link there
[Club Owner] revbob [475] : Make that page smaller so
you can still see the chat
[Club Owner] revbob [475] : The examples aren't very big
[Club Owner] revbob [475] : Everybody there?
[Block Deputy] titmus [655] : Yes
[Block Deputy] Bandersnatch [130] : yes
Mindlord [2610] : [nods]
Xopher [170] : yes
[Club Owner] revbob [475] : OK, click on the link marked
[1]
[Club Owner] revbob [475] : What we're going to be trying
to do for the first part of the tutorial is to turn on a lighbulb
[Club Owner] revbob [475] : How many Revs does it take
to turn on a lightbulb? ;-)
[Block Deputy] titmus [655] : LOL
[Club Owner] revbob [475] : So first, we'll try it without
a script
[Club Owner] revbob [475] : I've marked the important
stuff in red text
[Club Owner] revbob [475] : So we've got a really crummy
looking lightbulb
[Club Owner] revbob [475] : As you'll see in a minute
[Club Owner] revbob [475] : The first line in red is a
light
[Club Owner] revbob [475] : Scroll on down some and you'll
see a TouchSensor
[Club Owner] revbob [475] : Which our guests in our virtual
world will click on to turn on the light
[Club Owner] revbob [475] : And at the very bottom, we
ROUTE the two together
[Club Owner] revbob [475] : Now if you've done some of
this, you know we've got a problem here already, but let's take a look at a picture of what we're doing
[Club Owner] revbob [475] : Hit "Back" and click
on the link marked [2]
Xopher [170] : VRML Event model[2]?
[Club Owner] revbob [475] : Yup
[Club Owner] revbob [475] : We've got two nodes. I'm calling
one a Sensor and the other one an Effector
[Club Owner] revbob [475] : Although the "Sensor"
can be anything that's got an eventOut
[Club Owner] revbob [475] : and an Effector is anything
that's got an eventIn
[Club Owner] revbob [475] : And you ROUTE the two of them
together with a ROUTE statement
[Club Owner] revbob [475] : Now hit Back and click on
the link marked [3] and we'll see what's wrong with this
model for our lightbulb
[Club Owner] revbob [475] : Click on the lightbulb, and
you'll see that it lights up the little cube below it and to the left
[Club Owner] revbob [475] : But when you let go of the
mouse, the light goes off
[Club Owner] revbob [475] : Yuck.
[Club Owner] revbob [475] : Everybody there?
Xopher [170] : yes
[Block Deputy] Bandersnatch [130] : yup
[Block Deputy] titmus [655] : Sure am Rev
[Club Owner] revbob [475] : The problem is, a TouchSensor
sends *two* events for isActive
[Club Owner] revbob [475] : One when you click the mouse
and one when you release it
[Club Owner] revbob [475] : So to keep the light lit,
we need to add a Script
[Club Owner] revbob [475] : Click Back and click on the
link marked [4]
[Club Owner] revbob [475] : If you've got Cosmo Player
and a pitiful machine like mine, this will take approximately forever
[Block Deputy] titmus [655] : LOL
[Club Owner] revbob [475] : And here's our script
[Club Owner] revbob [475] : OK, click Back and click [5] and we'll show you some things about the Script
[Club Owner] revbob [475] : The first thing is pretty
simple. Instead of routing from the sensor to the effector,
[Club Owner] revbob [475] : you route from the Sensor
to the Script and from the Script to the effector
[Club Owner] revbob [475] : OK so far?
Xopher [170] : think so
[Block Deputy] titmus [655] : Yes
[Block Deputy] Bandersnatch [130] : I'm with you
[Club Owner] revbob [475] : OK, click Back and click [6]
[Club Owner] revbob [475] : Now we're going to look at
the eventOuts
[Club Owner] revbob [475] : You have to declare the name
of the eventOut you're going to send
[Club Owner] revbob [475] : And you declare it in the
Script node
[Club Owner] revbob [475] : And your script has got to
write something to that eventOut
[Club Owner] revbob [475] : OK, hit Back and [7]
[Club Owner] revbob [475] : And we'll look at eventIns
[Club Owner] revbob [475] : eventIns have to be declared
just like eventOuts
[Club Owner] revbob [475] : But this time you have to
have a function in your Script that has the same name as the eventIn
[Club Owner] revbob [475] : If you don't have a function
by that name, the script doesn't do anything
[Block Deputy] titmus [655] : OK
[Club Owner] revbob [475] : Which brings up a point if
you're doing scripts -- check your spelling!
Xopher [170] : makes sense
[Club Owner] revbob [475] : Uppercase/lowercase does matter
[Block Deputy] titmus [655] : Are they Caps Sensitive?
[Club Owner] revbob [475] : He he
[Block Deputy] titmus [655] : You beat me!!
[Club Owner] revbob [475] : Now you're probably wondering
what your script is supposed to actually do
[Club Owner] revbob [475] : Click Back and click [8]
[Club Owner] revbob [475] : The eventIn is of type SFBool
[Club Owner] revbob [475] : Now how did we know that?
[Club Owner] revbob [475] : RTFM
[Block Deputy] titmus [655] : Boolean - true/false?
[Club Owner] revbob [475] : Yup, but SFBool is a little
bit different -- it's a VRML type
[Block Deputy] titmus [655] : OK
[Block Deputy] Bandersnatch [130] : ok
[Club Owner] revbob [475] : By RTFM, I meant look at the
spec and see what the type is for a TouchSensor's isActive eventOut
[Club Owner] revbob [475] : Your eventIn has to be of
the same type or your VRML browser will complain about your ROUTE
Xopher [170] : no mixing MF and SFBool
[Club Owner] revbob [475] : Now it turns out we're also
sending an SFBool eventOut, but as I'll show in a couple of minutes, it doesn't have to
Xopher [170] : ?
[Club Owner] revbob [475] : You bet no mixing SF and MF
[Block Deputy] Bandersnatch [130] : what is MF?
[Club Owner] revbob [475] : An SFsomething is one of the
type. An MFsomething is an array of the type
[Club Owner] revbob [475] : One more important thing before
we get off this page
[Club Owner] revbob [475] : The value of the event (in
this case TRUE or FALSE) is passed in the parameter to the function
[Club Owner] revbob [475] : I called it "value"
but you can call it "gazorninplatz" or anything you like
[Block Deputy] titmus [655] : OK
[Club Owner] revbob [475] : So the logic of the script
is -- if the value of the mouse click (is true) then send the eventOut
[Club Owner] revbob [475] : Note one more thing -- if
it's false, nothing happens -- no eventOut gets sent because no function writes to the eventOut
Xopher [170] : so it isn't that sensitive provided you are
consistent throughout?
[Club Owner] revbob [475] : Oh yeah.
[Club Owner] revbob [475] : One more thing -- outside
a Script an SFBool is TRUE or FALSE, but a boolean inside a script is true or false
[Club Owner] revbob [475] : Most VRML browsers will read
a TRUE inside a script and say "oh, he meant true"
[Club Owner] revbob [475] : But don't rely on it
[Club Owner] revbob [475] : Now we're finally ready to
look at our world
[Club Owner] revbob [475] : Hit Back and hit [9]
[Club Owner] revbob [475] : Now when you click on the
light, it stays on
[Club Owner] revbob [475] : Oops -- how do you turn it
off?
[Club Owner] revbob [475] : You can't
[Block Leader] Goldeneye007 [2243] : bob, can I ask something?
[Club Owner] revbob [475] : So hit Back and hit [10]
[Club Owner] revbob [475] : Sure Goldeneye
[Club Owner] revbob [475] : Hi, cym
[Block Leader] Goldeneye007 [2243] : In blaxxun contact,
how do you get thAT WEIRDE TOUCH SYMBOX, YOU KNOW, JUST THE CIRCLE
[Block Leader] Goldeneye007 [2243] : sorry, I was casing
for a sec
[Block Leader] Goldeneye007 [2243] : er, symbol
[Block Leader] cym [2640] : hello revbob :-)
[Block Leader] cym [2640] : hey hermetic_cab
[Club Owner] revbob [475] : The browser makes its own
symbol if it finds a sensor
[Club Owner] revbob [475] : Hi, hermie
[Block Leader] Goldeneye007 [2243] : oh, cool
[Block Leader] Goldeneye007 [2243] : hiya herm
[Block Leader] Goldeneye007 [2243] : I'm learnin me some
script
[World Builder] hermetic_cab [3308] : hiya
[Club Owner] revbob [475] : All you new kids (yeah, right)
click on links, click on the only link there, and click on the link marked [10]
[World Builder] hermetic_cab [3308] : wow
[Block Leader] Goldeneye007 [2243] : so are all of us but
rev
[Club Owner] revbob [475] : Ok we just showed a script
that turns a light on, but doesn't turn it off
[Block Leader] Goldeneye007 [2243] : dude, Just by looking
at this one script I understand alot better
[Club Owner] revbob [475] : This one turns it off
[Club Owner] revbob [475] : First thing to notice is that
we have *two* TouchSensors now
[Club Owner] revbob [475] : One on the glass of the bulb
and one on the base
[Club Owner] revbob [475] : And scroll down a little farther
and you see a new function called "turn_off()"
[Club Owner] revbob [475] : Anybody want to guess what
that one does?
[Club Owner] revbob [475] : ;-)
[Block Leader] Goldeneye007 [2243] : turns it on again?
[Block Leader] Goldeneye007 [2243] : lol
[Club Owner] revbob [475] : Wait a minute, I've got a
dunce cap around here someplace
[Block Leader] Goldeneye007 [2243] : or does the light explode
when you click it?
[Club Owner] revbob [475] : ;-)
[Block Leader] Goldeneye007 [2243] : lol
[Block Leader] Goldeneye007 [2243] : anyway, let's continue
[Block Deputy] Bandersnatch [130] : how does it know that
Sensor1 is turnon and Sensor2 is turnoff?
[Club Owner] revbob [475] : Does the script logic make
sense?
[Block Leader] Goldeneye007 [2243] : After the tutorial,
I need to talk to u, rev
[Club Owner] revbob [475] : Check the ROUTE statements
at the bottom
[Block Deputy] Bandersnatch [130] : opps --thanks
[Club Owner] revbob [475] : OK, click Back and click [11] and see if it works
[Block Leader] cym [2640] : I gotta go 3D - I've been screengrabbing
this whole lecture again :-)
[Block Leader] Goldeneye007 [2243] : yup, it worx
[Club Owner] revbob [475] : Incidentally, Bandersnatch,
you've made a good point there
[Block Deputy] Bandersnatch [130] : thanks
[Club Owner] revbob [475] : You notice I had to move TouchSensor1
so that it was under just the glass, not the whole bulb
[Club Owner] revbob [475] : When you've got a sensor that
doesn't seem to be sensing, check that you haven't got one TouchSensor wrapped inside another one
[Club Owner] revbob [475] : OK, that last world was sort
of OK, but it would be nice to click the bulb to turn it on, click it again to turn it off
[Club Owner] revbob [475] : So the bulb has to remember
what state it was in
[Club Owner] revbob [475] : Or actually, the script remembers
[Club Owner] revbob [475] : Click Back and click [12]
[Club Owner] revbob [475] : I'll wait for Cosmo Player
owners to get there
[Club Owner] revbob [475] : ;-)
[World Builder] hermetic_cab [3308] : <--- sits quiet
in the edge and smiles ;))
[Club Owner] revbob [475] : The first line in red just
shows that I moved the TouchSensor back where it was before
[Club Owner] revbob [475] : And the next red line shows
a new field in our Script node -- a "field" field
[Club Owner] revbob [475] : A field stores a "persistent"
state
[Club Owner] revbob [475] : Persistent as long as you've
got the world loaded
[Club Owner] revbob [475] : So now the logic says -- if
it's a mouse button down
[Club Owner] revbob [475] : and if it was lit last time
[Club Owner] revbob [475] : turn it off
[Club Owner] revbob [475] : otherwise, turn it on
[Club Owner] revbob [475] : And btw, save the state ("lit")
for next time
[Block Leader] Goldeneye007 [2243] : hey, lit could be foo
or poop or anything and it would work, right?
[Block Deputy] Bandersnatch [130] : why is lit FALSE in the
Fiels statment?
[Club Owner] revbob [475] : Sure -- the name's up to you
[Block Deputy] Bandersnatch [130] : sorry--field
[Block Leader] Goldeneye007 [2243] : because when it starts
out it isnt lit
[Club Owner] revbob [475] : Let me hit two things to answer
those questions
[Block Leader] Goldeneye007 [2243] : then, it knows that
if lit = fakse, then turn light on
[Block Leader] Goldeneye007 [2243] : but I'll shutup, it's
bob's tutorial
[Club Owner] revbob [475] : First, you're exactly right,
Goldeneye -- the light itself starts off as off, so you better make the state variable (lit) match
[Club Owner] revbob [475] : Second, note that while a
Script's eventIns and eventOuts don't have an intiial value
[Club Owner] revbob [475] : you have to declare an initial
value for fields
[Club Owner] revbob [475] : VRML browsers are very persnickety
about that -- events can't have an initial value and fields must have one
[Block Deputy] Bandersnatch [130] : so that line is only
executed when the world is loaded?
[Club Owner] revbob [475] : Yup
[Block Deputy] Bandersnatch [130] : ok, got it
[Block Leader] Goldeneye007 [2243] : lol@germ
[Block Leader] Goldeneye007 [2243] : er, herm
[Club Owner] revbob [475] : Did we see the world yet?
[Block Leader] Goldeneye007 [2243] : nope
[Block Leader] Goldeneye007 [2243] : I did though ;)
[Club Owner] revbob [475] : If not, click Back and click
[13]
[Club Owner] revbob [475] : Clap on, clap off
[Club Owner] revbob [475] : Do they have commercials for
the clapper where you're from?
Xopher [170] : oh yes
[Block Deputy] Bandersnatch [130] : unfortunatly
[Club Owner] revbob [475] : So Ron Popeil is an old friend
Xopher [170] : lol
[Club Owner] revbob [475] : OK, that bulb works OK, but
it isn't realistic
[Club Owner] revbob [475] : I mean, the object next to
the bulb lights up, but the bulb doesn't
[Club Owner] revbob [475] : So let's fix that
[Club Owner] revbob [475] : So click Back and click the
link I forgot to mark [14] ;-( [later:
I marked it]
[Club Owner] revbob [475] : You can tell I'm Southern
by the way I give directions
[World Builder] hermetic_cab [3308] : LOL -nice lessons bob
-I'm waving CU
[Club Owner] revbob [475] : "Well you head on down
the road and you turn right just beyond where Buford's house use to be"
[Club Owner] revbob [475] : Cya
[Club Owner] revbob [475] : I put some names on the Material
nodes because I'm going to write to them
[Club Owner] revbob [475] : Now the script looks a little
bit complicated, so let me say at the front that there are two ways to write to an array value (like an SFColor)
[Club Owner] revbob [475] : And I show both of them here
[Club Owner] revbob [475] : The first way is to use a
constructor: new SFColor(r,g,b);
[Club Owner] revbob [475] : And the second way is to set
up a field that's already initialized to the color you want, and then just assign it
[Club Owner] revbob [475] : One thing that bites me from
time to time: while commas are optional in VRML, they aren't optional in constructors and functions in javascript
[Club Owner] revbob [475] : You gotta have them
[Club Owner] revbob [475] : Take a look at the ROUTEs
at the bottom so you can see where these colors are going
[Club Owner] revbob [475] : We're going to make the glass
emit white and the base a sort of dull yellow
[Club Owner] revbob [475] : OK, that was a complicated
one. How are we doing?
[Block Leader] Goldeneye007 [2243] : fine....I'm getting
a huge understanding of Script
tex-skii [80] : hi bob
Xopher [170] : Bumbling but beginning to see through the
murk
[Club Owner] revbob [475] : So click Back and click [15] and check it out
[Block Leader] Goldeneye007 [2243] : are u gonna discuss
the others or u ant us to just take a look at them?
[Club Owner] revbob [475] : Let's go take a look. I'm
game if you are
[Club Owner] revbob [475] : We've just finished the main
part of the tutorial and we're into script tricks now
[Club Owner] revbob [475] : Click Back and click [16]
[Club Owner] revbob [475] : There's a special method in
Scripts called initialize()
[Block Leader] Goldeneye007 [2243] : I was booted
[Club Owner] revbob [475] : Oops
[Block Deputy] Bandersnatch [130] : me too
[Club Owner] revbob [475] : Bandersnatch, did you get
the last couple of lines
[Club Owner] revbob [475] : Sorry
[Block Leader] Goldeneye007 [2243] : are we discussing shutDown
today?
[Club Owner] revbob [475] : No, because I could never
figure out what it did
[later: I actually do know what it does, but I don't know what it's good for]
[Block Leader] Goldeneye007 [2243] : lol...ok
[Block Deputy] Bandersnatch [130] : im with you
[Club Owner] revbob [475] : Anyhow, if you can make it
to the web page without crashing, click 16 and let's
look at initialize()
[Club Owner] revbob [475] : initialize() is a special
method. You don't need an eventIn for it
[Club Owner] revbob [475] : And it executes whenever your
world [loads]
[Club Owner] revbob [475] : Now I could have just used
initialize() to set some values
[Club Owner] revbob [475] : But since this is a "script
tricks" section I was tricky
[Club Owner] revbob [475] : You can call one function
from another in javascript
[Club Owner] revbob [475] : So I did
[Club Owner] revbob [475] : And the purpose of this little
trick is to start out with the light on
[Club Owner] revbob [475] : so initialize() calls touched()
and gives it a true
[Club Owner] revbob [475] : Meaning: turn on the light
[Club Owner] revbob [475] : If you're crashing, maybe
you don't want to click on the world
[Club Owner] revbob [475] : You can take my word for it
[Block Deputy] Bandersnatch [130] : I see, but now the light
bulb color does not change?
[Club Owner] revbob [475] : Huh? It better change next
time you click on it
[Club Owner] revbob [475] : Let me look -- I may crash
[Block Leader] Goldeneye007 [2243] : it changes
[Club Owner] revbob [475] : Whew
Xopher [170] : stem changes bulb doesn't
[Block Leader] Goldeneye007 [2243] : oh, no, the light bulb
itself color dont change
[Block Deputy] Bandersnatch [130] : For me the base and the
box changes but the bulb stays white?
Xopher [170] : same here
[Block Leader] Goldeneye007 [2243] : me too
[Club Owner] revbob [475] : Totally weird!
[Club Owner] revbob [475] : It works in Cosmo Player
[Club Owner] revbob [475] : Hmmmmmm
[Block Leader] Goldeneye007 [2243] : I'm in CC3D
[Block Leader] Goldeneye007 [2243] : Contact
[Block Deputy] Bandersnatch [130] : i'm with Gold
Xopher [170] : blaxxun
[Club Owner] revbob [475] : I believe that's a bug
[Block Leader] robrich [505] : thanks for the tutorial revbob
got to go
[Club Owner] revbob [475] : So we've learned that having
one script call another may not be reliable
[Club Owner] revbob [475] : Sure
[Club Owner] revbob [475] : Hmmmmm
[Block Deputy] Bandersnatch [130] : what if you leave out
"lit= false"?
[Club Owner] revbob [475] : OK, forget that one and try
[18]
[Block Leader] Goldeneye007 [2243] : if you leave lit=false
out, it wont turn off
[Club Owner] revbob [475] : Totally weird
[Block Deputy] Bandersnatch [130] : I got it from avatara.com
[Club Owner] revbob [475] : OK, this one is about a Browser
method -- a simple one
[Block Leader] Goldeneye007 [2243] : ooh!Mouseovers!
[Block Leader] Goldeneye007 [2243] : *Jumps up and down and
screams like a girl*
Xopher [170] : calls bubble text description?
[Club Owner] revbob [475] : You'll find the documentation
on the Browser methods in the spec in 4.12.10
[Club Owner] revbob [475] : Not in the Javascript annex
[Club Owner] revbob [475] : Notice one thing about setDescription()
-- at least in Cosmo Player, you've got to set it blank when the mouse isn't over it
[Club Owner] revbob [475] : You have to have the "else"
in there
[Block Leader] Goldeneye007 [2243] : hmm...lemme see what happend in Contact
[Club Owner] revbob [475] : Otherwise the description
string just stays there
[Block Leader] Goldeneye007 [2243] : nothing happens in contact
[Block Leader] Goldeneye007 [2243] : nothing
[Club Owner] revbob [475] : Drat!
[Block Deputy] Bandersnatch [130] : Same here.
[Club Owner] revbob [475] : Well now you see why I wanted
to end the tutorial where I did
[Club Owner] revbob [475] : I'll make a note on the web
pages
Xopher [170] : that might be 4.1 beta prob. I've noticed
getting names by mouseovering avs is really dodgy now
[Block Leader] Goldeneye007 [2243] : you're probobly right,
Xopher
[Club Owner] revbob [475] : OK, if you're really brave,
click [23]
[Club Owner] revbob [475] : You should see a walking bot.
[Club Owner] revbob [475] : When you click on him (in
Cosmo Player) he stops and turns toward you and bows
Xopher [170] : hey come back with that bottle
[Block Deputy] Bandersnatch [130] : Sorry, I don't see anything.
[Club Owner] revbob [475] : Rats!
[Block Leader] Goldeneye007 [2243] : I do
[Club Owner] revbob [475] : Does the click work?
[Block Leader] Goldeneye007 [2243] : It worx in Contact
[Block Leader] Goldeneye007 [2243] : yup
Xopher [170] : yes
[Club Owner] revbob [475] : Yaaaaaaay!
[Block Leader] Goldeneye007 [2243] : lol
[Block Deputy] Bandersnatch [130] : yes, I see it now??
[Block Leader] Goldeneye007 [2243] : *Slowly backs away from
bob*
Xopher [170] : if you don't click he turns and walks through
you
[Block Leader] Goldeneye007 [2243] : did you make the person
by hand?
[Club Owner] revbob [475] : You should have Walk [navigation],
so you can back up
[Club Owner] revbob [475] : I got the bot from the Cosmo
Software site -- it was done by Viewpoint Datalabs
[Club Owner] revbob [475] : But I had to reparent all
the limbs
[Block Leader] Goldeneye007 [2243] : woah, complicated script!
[Club Owner] revbob [475] : Oh yeah.
[Club Owner] revbob [475] : Here's what that script does.
It acts like a filter
[Club Owner] revbob [475] : The animation goes from TimeSensors
to Interpolators
[Club Owner] revbob [475] : But it passes through the
script, and if the logic is right, the script will pass the animation through
[Club Owner] revbob [475] : If the logic isn't right,
it won't pass the animation
[Club Owner] revbob [475] : For example, when you're bowing,
the walking isn't passed
[Block Deputy] Bandersnatch [130] : how long did it take
you to write?
[Club Owner] revbob [475] : A long time. And in fact,
after I wrote it I discovered that WorldView and Cosmo Player did it differently
Xopher [170] : wonderful
[Club Owner] revbob [475] : Cosmo Player started off with
the bot walking and WorldView didn't
[Block Leader] Goldeneye007 [2243] : can we hurry along?I
have to go really soon...
[Club Owner] revbob [475] : And it turned out the reason
was that the spec didn't specify how a VisibilitySensor should react in initial conditions
[Club Owner] revbob [475] : So the spec was changed at
the last minute
[Club Owner] revbob [475] : And now both of them work
the same way
[Block Deputy] Bandersnatch [130] : cool
[Club Owner] revbob [475] : There's another trick there
with a VisibilitySensor
[Club Owner] revbob [475] : I stop the animation when
you can't see the bot
[Club Owner] revbob [475] : A cycle saved is a cycle earned
[Block Leader] Goldeneye007 [2243] : lol
[Club Owner] revbob [475] : So I'm out of examples
[Block Leader] Goldeneye007 [2243] : we're done?
[Club Owner] revbob [475] : What would you like to ask?
[Club Owner] revbob [475] : You bet
[Block Leader] Goldeneye007 [2243] : tell them about createVrmlFromString
[Club Owner] revbob [475] : Or I'll hang around and answer
anything
Xopher [170] : Good Lord I'd be six months trying to sort
out the parenthesise
[Club Owner] revbob [475] : (I find it's no trouble at
all to say "I don't know")
[Block Deputy] Bandersnatch [130] : I just started learning
java, so I am unable to ask any more questions.
[Block Leader] Goldeneye007 [2243] : I'm learning Java too
[Club Owner] revbob [475] : Use vi or vim -- move the
cursor over one paren, hit '%' and it finds the closing paren
[Club Owner] revbob [475] : Ditto square brackets and
curly braces
[Block Leader] Goldeneye007 [2243] : tell them about createVrmlFromString
[Club Owner] revbob [475] : No
[Club Owner] revbob [475] : It's a secret
[Block Leader] Goldeneye007 [2243] : why not?
[Block Leader] Goldeneye007 [2243] : lol
[Club Owner] revbob [475] : You have to pay to learn createVrmlFromString()
[Club Owner] revbob [475] : ;-)
[Block Leader] Goldeneye007 [2243] : lol
Xopher [170] : oh thanks, this has been great! I'm being
deafened by the crash of pennies dropping.
[Block Leader] Goldeneye007 [2243] : can I tell em?
[Club Owner] revbob [475] : Sure
[Block Leader] Goldeneye007 [2243] : ok
[Block Deputy] Bandersnatch [130] : Thanks alot for the session.
[Block Deputy] Bandersnatch [130] : Ok
[Block Leader] Goldeneye007 [2243] : There is another Browser
method called createVrmlFromString
[Club Owner] revbob [475] : Sure. Hunt me down if you
have some other questions
Xopher [170] : thanks
[Block Leader] Goldeneye007 [2243] : It makes it so when
you click on something, it makes something appear in your VRML world
Xopher [170] : I read your postings regularly
[Block Leader] Goldeneye007 [2243] : as if you could route
a TouchSensor to a group's addChildren
[Block Leader] Goldeneye007 [2243] : the function is an eventIn,
right?
[Block Leader] Goldeneye007 [2243] : hello?
Xopher [170] : here
[Block Leader] Goldeneye007 [2243] : or is it an eventOut?
[Block Deputy] Bandersnatch [130] : Wow! I'm not sure I understand
but I will try it out.
[Club Owner] revbob [475] : yup
[Block Leader] Goldeneye007 [2243] : I havent finished yet
[Block Deputy] Bandersnatch [130] : oh
[Block Leader] Goldeneye007 [2243] : which one, bob?
[Block Deputy] Bandersnatch [130] : :)
[Club Owner] revbob [475] : which one what?
[Block Leader] Goldeneye007 [2243] : is the function an eventOut
or In?
[Block Leader] Goldeneye007 [2243] : hello?
[Club Owner] revbob [475] : addChilden is an eventIn of
grouping nodes
[Block Leader] Goldeneye007 [2243] : I know that
[Club Owner] revbob [475] : It should be an eventOut of
your script
[Block Leader] Goldeneye007 [2243] : ok, I'll go on then
[Club Owner] revbob [475] : Which you route to the eventIn
of the grouping node where you want to add the children
[Block Leader] Goldeneye007 [2243] : you make your eventOut(let's
say add)
[Block Leader] Goldeneye007 [2243] : and an eventIn(let's
say created)
[Block Leader] Goldeneye007 [2243] : then make the function
add and place value in the parenthases
[Block Leader] Goldeneye007 [2243] : then, in the function,
Xopher [170] : script to repeat until value =X ?
[Block Leader] Goldeneye007 [2243] : place value = Browser.createVrmlFromString('VRML
here')
[Club Owner] revbob [475] : http://home.hiwaay.net/~crispen/vrmlworks/faq/add.wrl
[Block Leader] Goldeneye007 [2243] : what this does is say
"When clicked on, build this stuff"
[Block Leader] Goldeneye007 [2243] : Then, use your routes
Xopher [170] : ok
[Block Leader] Goldeneye007 [2243] : ROUTE Touch.isActive
TO AddScript.add
[Block Leader] Goldeneye007 [2243] : ROUTE AddScript.create
TO Transform.addChildren
[Block Leader] Goldeneye007 [2243] : and you have a perfect
TouchSensor addChildren
[Block Leader] Goldeneye007 [2243] : was that all right,
bob?
[Club Owner] revbob [475] : Yup
[Block Leader] Goldeneye007 [2243] : ok
[Club Owner] revbob [475] : I found an example
[Block Leader] Goldeneye007 [2243] : cool
[Club Owner] revbob [475] : at http://home.hiwaay.net/~crispen/vrmlworks/faq/add.wrl
[Block Deputy] Bandersnatch [130] : Cool, I'll check it out.
Xopher [170] : got it
Xopher [170] : thanks
[Club Owner] revbob [475] : http://home.hiwaay.net/~crispen/vrmlworks/faq/remove.wrl
[Block Leader] Goldeneye007 [2243] : cool, ya found an example
[Club Owner] revbob [475] : removes children
[Block Leader] Goldeneye007 [2243] : oh yeah, remove children
[Block Leader] Goldeneye007 [2243] : I dont know how to do
that one
[Block Leader] Goldeneye007 [2243] : cool
[Block Leader] Goldeneye007 [2243] : ok, anyway, I have to
go
[Block Deputy] Bandersnatch [130] : Thanks Gold
[Block Leader] Goldeneye007 [2243] : thanks for the tutorial
Bob
[Block Leader] Goldeneye007 [2243] : my pleasure
[Block Deputy] Bandersnatch [130] : Thanks again bob.
Xopher [170] : see you gold
[Club Owner] revbob [475] : Sure
[Club Owner] revbob [475] : Thanks for coming
[Block Leader] Goldeneye007 [2243] : anyway, later all of
ya
Xopher [170] : btw bob you a real rev.?
[Block Leader] Goldeneye007 [2243] : have a good one, bob
[Block Deputy] Bandersnatch [130] : I got to go too. See
you all later.
[Block Leader] cym [2640] : C U all who is leaving
Bandersnatch waves good-bye to everyone
[Club Owner] revbob [475] : cya
Xopher [170] : thanks bob
Xopher [170] : good-bye all
[Block Leader] cym [2640] : hey tutorial is over?
[Block Leader] cym [2640] : sorry revbob for not being very
talkative
[Club Owner] revbob [475] : Yup unless you want to ask
something
[Block Leader] cym [2640] : I recorded the whole lesson and
hope to be able to go through it before next class
[Club Owner] revbob [475] : Oops, I better figure out
something new to say
[Block Leader] cym [2640] : If I have any questions I will
let you know
[Club Owner] revbob [475] : Great
[Block Leader] cym [2640] : something new?
[Block Leader] cym [2640] : oh - one thing
[Club Owner] revbob [475] : Sure
[Block Leader] cym [2640] : adding target="_new"
to a URL anchor field does not work
[Block Leader] cym [2640] : not in the VRML file
[Club Owner] revbob [475] : Rats
[Club Owner] revbob [475] : That's the paremeter field,
right?
[Club Owner] revbob [475] : parameter
[Block Leader] cym [2640] : not sure
[Block Leader] cym [2640] : but VRML doesn't know 'target'
[Club Owner] revbob [475] : The spec has an example by
the Anchor node of that very thing
[Block Leader] cym [2640] : yes? cool
[Block Leader] cym [2640] : so I will first check that
[Block Leader] cym [2640] : okay - gotta go fix my bicycle
now
[Club Owner] revbob [475] : It was a FAQ on www-vrml when
they were writing the spec
[Club Owner] revbob [475] : Cya
[Block Leader] cym [2640] : di dyou see the water chute?
[Club Owner] revbob [475] : No, I got here late. I'll
come by later
[Club Owner] revbob [475] : Thanks for the invite
[Block Leader] cym [2640] : okay - you are welcome
[Block Leader] cym [2640] : C U
[Club Owner] revbob [475] : bye