This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > January 2004 > CreateVrmlfromString





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 CreateVrmlfromString
Unregistered

2004-01-05, 9:06 pm

Hi,

I wonder if there is a way to accept image texture and then from a new 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 can include a gif file? I am using cortona browser. Thanks!
Herbert Stocker

2004-01-06, 4:28 am



Unregistered wrote:
quote:

> Hi,
>
> I wonder if there is a way to accept image texture and then from a new
> 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 can
> include a gif file? I am using cortona browser. Thanks!
>



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
quote:

>
> Unregistered -
> ------------------------------------------------------------------------
> Posted via http://www.forum4designers.com
> ------------------------------------------------------------------------
> View this thread: http://www.forum4designers.com/message28768.html
>




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

Sponsored Links


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