Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > CreateVrmlfromString
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 23rd April 10:18
unregistered
External User
 
Posts: 1
Default CreateVrmlfromString



Hi,

I wonder if there is a way to accept image texture and then from a ne
node? Example


newvrml = 'DEF ROOT Group {';
newvrml +=' children [';
newvrml +=' Transform {';
newvrml +=' translation -2 2 0';
newvrml +=' children [';
newvrml +=' DEF TOUCH TouchSensor {}';
newvrml +=' Shape {';
newvrml +=' appearance Appearance {';
newvrml +=' texture ImageTexture {
newvrml +=' url "imagefile.gif" ';
newvrml +=' geometry Sphere {}';
newvrml +=' }';
newvrml +=' ]';
newvrml +=' }';
newvrml +=' ]';
newvrml +='}';


I tried the above and the browser complains about this line url
"imagefile.gif" ';

Is there escape character in vrmlscript? Or is there anyway I ca
include a gif file? I am using cortona browser. Thanks

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message28768.htm
  Reply With Quote


  sponsored links


2 23rd April 10:18
herbert stocker
External User
 
Posts: 1
Default CreateVrmlfromString



Use
newvrml +=' url \"imagefile.gif\" ';
for the respective line.

The problem is that you have the whole script inside a string.
I.e. the whole script is surrounded by " . And when the browser finds
the " before imagefile.gif it must think that the script ends there.
Then it cannot understand the word imagefile.gif . Therefore you
must quote the " before and after imagefile.gif . Herbert

--
Herbert Stocker (aka hersto)
http://www.hersto.de
http://www.bitmanagement.de
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666