This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > September 2004 > accessing DEF'ed instances of Inlined Files





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 accessing DEF'ed instances of Inlined Files
John Andrews

2004-08-23, 7:19 pm

hello all,
i've designed an interface ("main.wrl") with numerous buttons which do
things like turn on/off various Inlined files (which represent surfaces
within an oil field). The work-in-progress is posted at:


http://www.beg.XXXXXX.edu/resprog/fullerton/vr/main.htm


I'm trying to add a new kind of button in main.wrl that allows the user
to change the texture on one of the Inlined surfaces ("surface.wrl").
Within surface.wrl i have the requesite code:

textureTransform DEF surfaceTrans TextureTransform { }


My problem, of course, is that "the names you define with DEF may only
be used again later within the *same* file" (from the VRML Sourcebook,
Ames et al). Thus, when I put the following in main.wrl:

ROUTE javaScriptFunction.new_translation TO surfaceTrans.set_translation

i get an error because the DEF "surfaceTrans" exists in the Inlined
file, not main.wrl. This all works fine if i include the Button-code
within the surface.wrl file, but for various reasons i cannot do this.


my question: How to get around this? Is there any way to access a DEF
instance of an Inlined node from outside that node?

thanks,
john

Joe D Williams

2004-08-24, 4:16 am

> Is there any way to access a DEF
> instance of an Inlined node from outside that node?


Have a look at;

http://www.web3d.org/x3d/specifications/
ISO-IEC-19775-FDIS-X3dAbstractSpecification/
Part01/concepts.html#ImportExportsemantics

Then find an X3D browser that will do it.

Best Regards,
Joe


> hello all,
> i've designed an interface ("main.wrl") with numerous buttons which do
> things like turn on/off various Inlined files (which represent surfaces
> within an oil field). The work-in-progress is posted at:
>
>
> http://www.beg.XXXXXX.edu/resprog/fullerton/vr/main.htm
>
>
> I'm trying to add a new kind of button in main.wrl that allows the user
> to change the texture on one of the Inlined surfaces ("surface.wrl").
> Within surface.wrl i have the requesite code:
>
> textureTransform DEF surfaceTrans TextureTransform { }
>
>
> My problem, of course, is that "the names you define with DEF may only
> be used again later within the *same* file" (from the VRML Sourcebook,
> Ames et al). Thus, when I put the following in main.wrl:
>
> ROUTE javaScriptFunction.new_translation TO surfaceTrans.set_translation
>
> i get an error because the DEF "surfaceTrans" exists in the Inlined
> file, not main.wrl. This all works fine if i include the Button-code
> within the surface.wrl file, but for various reasons i cannot do this.
>
>
> my question: How to get around this? Is there any way to access a DEF
> instance of an Inlined node from outside that node?
>
> thanks,
> john
>



john

2004-08-24, 4:14 pm

thanks for the advice, Joe. I read the link, and it looks like X3D
handles this problem/issue well. questions for you/others:

1. Is there a work-around in VRML (without having to resort to x3d,
which i know nothing about)? I ask because I've invested alot of time
over the last year into writing conversion programs from
GIS/Geo-science software to VRML. for this reason, i'd prefer to
stick with VRML if at all possible. for now, anyway. (although i
did look at the x3d syntax, and it doesn't seem to be that much
different than vrml). anyway, back to the work-around: i know you
can manipulate scaling/translation, etc, of an inlined-file thru the
Transform Node containing the file; i'm wondering if there might be a
similar way to swap the textures on this same file.

2. I've been testing my VRML visualizations/models using Cosmo on an
SGI and Contact5.1 on a PC. Over the few months i will be generating
a number of visualizations for state-agency & small-business
employees, the vast majority of whom will not have previously
installed a VRML plug-in. On my intro site i will probably recommend
potential viewers to install the Contact5.1 (or latest) plug-in. does
this seem reasonable?

thanks again,
john



"Joe D Williams" <joedwil@earthlink.net> wrote in message news:<3LxWc.11307$3O3.7264@newsread2.news.pas.earthlink.net>...[color=darkred]
>
> Have a look at;
>
> http://www.web3d.org/x3d/specifications/
> ISO-IEC-19775-FDIS-X3dAbstractSpecification/
> Part01/concepts.html#ImportExportsemantics
>
> Then find an X3D browser that will do it.
>
> Best Regards,
> Joe
>
>
sam

2004-08-25, 6:17 am

Instead of Inlines, you'll need to use Protos.

Google 'vrml proto tutorial' , there are lots.
Here's one: www.vruniverse.com/tutorials.html




"John Andrews" <john.andrews@beg.XXXXXX.edu> wrote in message
news:412A637D.1B761B6E@beg.XXXXXX.edu...
> hello all,
> i've designed an interface ("main.wrl") with numerous buttons which do
> things like turn on/off various Inlined files (which represent surfaces
> within an oil field). The work-in-progress is posted at:
>
>
> http://www.beg.XXXXXX.edu/resprog/fullerton/vr/main.htm
>
>
> I'm trying to add a new kind of button in main.wrl that allows the user
> to change the texture on one of the Inlined surfaces ("surface.wrl").
> Within surface.wrl i have the requesite code:
>
> textureTransform DEF surfaceTrans TextureTransform { }
>
>
> My problem, of course, is that "the names you define with DEF may only
> be used again later within the *same* file" (from the VRML Sourcebook,
> Ames et al). Thus, when I put the following in main.wrl:
>
> ROUTE javaScriptFunction.new_translation TO surfaceTrans.set_translation
>
> i get an error because the DEF "surfaceTrans" exists in the Inlined
> file, not main.wrl. This all works fine if i include the Button-code
> within the surface.wrl file, but for various reasons i cannot do this.
>
>
> my question: How to get around this? Is there any way to access a DEF
> instance of an Inlined node from outside that node?
>
> thanks,
> john
>



Joerg Scheurich aka MUFTI

2004-08-25, 6:17 am

>> Is there any way to access a DEF[color=darkred]

To send/get informations from code in a other VRML file, you need to
use a EXTERNPROTO file instead a normal Inlined file (or maybe load/route
things dynamicly in Scripts).

so long
MUFTI
--
A number of the Windows-based application programming interfaces (APIs) that
are documented as accepting only a module handle are defined incorrectly.
(aus einer M$Windows Dokumentation)
John Andrews

2004-08-26, 12:28 pm

Joerg Scheurich aka MUFTI wrote:

>
> To send/get informations from code in a other VRML file, you need to
> use a EXTERNPROTO file instead a normal Inlined file (or maybe load/route
> things dynamicly in Scripts).
>
> so long
> MUFTI
> --
> A number of the Windows-based application programming interfaces (APIs) that
> are documented as accepting only a module handle are defined incorrectly.
> (aus einer M$Windows Dokumentation)


exactly what i'm looking for, thanks...

Joerg Scheurich aka MUFTI

2004-08-31, 11:16 pm

>> Is there any way to access a DEF[color=darkred]

To send/get informations from code in a other VRML file, you need to
use a EXTERNPROTO file instead a normal Inlined file (or maybe load/route
things dynamicly in Scripts).

so long
MUFTI
--
A number of the Windows-based application programming interfaces (APIs) that
are documented as accepting only a module handle are defined incorrectly.
(aus einer M$Windows Dokumentation)
John Andrews

2004-09-01, 12:17 pm

Joerg Scheurich aka MUFTI wrote:

>
> To send/get informations from code in a other VRML file, you need to
> use a EXTERNPROTO file instead a normal Inlined file (or maybe load/route
> things dynamicly in Scripts).
>
> so long
> MUFTI
> --
> A number of the Windows-based application programming interfaces (APIs) that
> are documented as accepting only a module handle are defined incorrectly.
> (aus einer M$Windows Dokumentation)


exactly what i'm looking for, thanks...

Sponsored Links


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