This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > April 2004 > Can VRML tell if you're idling?





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]

Author Can VRML tell if you're idling?
Wik

2004-04-26, 5:35 pm

I'm working on a project, and I've come to two roadblocks.

First, I want to attach something to an avatar that starts running text
when the user isn't actively navigating through the space, like a
screensaver. But I have no idea where to start with something like this.

Second, I would like the text to be randomly pulled from a text file so
that it truly feels random, and I'm not stuck with just making a really
long animated gif. I know you can pull stuff out of another .wrl while in
a scene, but can you pull from a .txt?

Thanks in advance for your help.

Joerg Scheurich aka MUFTI

2004-04-26, 5:35 pm

> Second, I would like the text to be randomly pulled from a text file so
> that it truly feels random, ...
> ... I know you can pull stuff out of another .wrl while in
> a scene, but can you pull from a .txt?


All you need is a little program that stores the data from .txt in
a .wrl file.
You only need a VRML node with a MFString field, e.g. a WorldInfo or Text

With UNIX/Linux/MacOSX/cygwin you can use something like

$ echo blah blah > some.txt
$ echo bang bang >> some.txt
$ cat some.txt
blah blah
bang bang
$ cat test.sh
cat > some.wrl << EOT
#VRML V2.0 utf8

WorldInfo
{
info
[
EOT

awk '{print "\"" $0 "\""}' some.txt >> some.wrl

cat >> some.wrl << EOT
]
}
EOT
$ sh test.sh
$ cat some.wrl
#VRML V2.0 utf8

WorldInfo
{
info
[
"blah blah"
"bang bang"
]
}
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews