Solved

VRML anchor problem

Posted on 1998-01-12
13
523 Views
Last Modified: 2013-12-25
I have a VRML file with specific viewpoints.  Is it possible to be able to link one of these viewpoints to display a *.html file in another target frame.  That is - I want a picture to appear in a different frame, WHEN I click to move on to my next viewpoint.

I had tried simply to wrap an anchor round my Perspective camera node, and although i got no errors, I got no results either!!

I would much appreciate any suggestions.....
0
Comment
Question by:garyennis
  • 7
  • 6
13 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1856349
When you activate a Viewpoint, as far as i've understood it, the Viewpoint sends an isBound eventOut TRUE.

So you could simply trap this event in a Javascript script to open the desired page.
0
 
LVL 1

Author Comment

by:garyennis
ID: 1856350
Appreciate the response julio, but any chance of giving an axample of the script.....  I've never come across this isBound eventOut stuff before, nor have I used Javascript and VRML together (seperate yes, but together no!).

Thanks!
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1856351
 Hello back.

Well i had some troubles because _everything_is_case_sensitive!, and the specs are not very stable.

Anyway here is a template, asuuming there's an existing "FRAME_0" frame as target:

--//--
#VRML V2.0 utf8

Group {
  children [

    DEF OpenUrl Script {
      eventIn SFBool isBound
      field MFString AUrl "http://some.site.com"
      field MFString AParameter "target=FRAME_0"
      url "javascript:
        function isBound(val) {
          if(val) {
            Browser.loadURL(AUrl, AParameter);
          }
        }
      "
    }

    Viewpoint {
      description "V0"
    }
    DEF V1 Viewpoint {
      description "V1"
    }

  ]
}

ROUTE V1.isBound TO OpenUrl.isBound
--//--

Now, each time you select the "V1" Viewpoint, an AUrl is loaded in frame "FRAME_0".

Hope this is what you're looking for.
0
 
LVL 1

Author Comment

by:garyennis
ID: 1856352
Quick question to Julio before i give you the points....

I see your code is for VRML ver2.  Will it also work in ver1, if not, any work-arounds?

Cheers!
0
 
LVL 5

Accepted Solution

by:
julio011597 earned 150 total points
ID: 1856353
No, VRML ver1 does not support any kind of dynamic stuff, and i'm afraid there's no workaround.

This is because of design philosophy: in the VRML development process, only one particular area was to be attacked with each major version; VRML 1.0 was designed to be static scenes only; version 2 introduced animation and programmable behaviour.

Regards and good work.

P.S. BTW, when you want to add comments without rejecting an answer (e.g., if you need clarifications), just write your comment and hit submit without checking any grading box.
0
 
LVL 1

Author Comment

by:garyennis
ID: 1856354
Julio, if I had any more points to give I would!!

Thanks for the time and patience...!  Although I'm only developing in VRML 1 at the mo., your comments will help greatly when we eventually do decide to upgrade!!

Thanks again!
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Author Comment

by:garyennis
ID: 1856355
Julio, tried your code now that we're working with VRML2.

Looks like it would work, but am getting an arror after I've clicked the viewpoint - "Script node OpenUrl: No supported script format specified"

Any comments, please advise....Thanks, Gary
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1856356
Really, don't know.

I have CosmoPlayer2.0 on Communicator4.0.

May the problem have to do with your configuration?
(because that sample works for me!)
0
 
LVL 1

Author Comment

by:garyennis
ID: 1856357
Julio......

Looking for another way around this....(for 100 points!)

Is it possible to do it using a technique like the one you gave me for displaying both a htm and wrl file from a anchor in the vrml file. (using    

Anchor { url
"javascript:top.jump('htm file','wrl file')"    etc.etc...


The reason is that i still get the above error when implementing your code above AND i will be setting up a number of views which i want to automatically display pictures, - dont want to write to much code, so using some sort of function might speed things up....

Any ideas???

0
 
LVL 5

Expert Comment

by:julio011597
ID: 1856358
Please, try this one first:

--//--
#VRML V2.0 utf8

DEF V0 Viewpoint {
  description "V0"
}
DEF V1 Viewpoint {
  description "V1"
}

Group {
  children [
  ]
}

DEF SC Script {
  eventIn SFBool V0_isBound
  eventIn SFBool V1_isBound

  field MFString V0_URL "V0.gif"
  field MFString V1_URL "V1.gif"

  field MFString VPar "target=AFrame"

  url "javascript:
    function V0_isBound(val) {
      if(val) Browser.loadURL(V0_URL, VPar);
    }
    function V1_isBound(val) {
      if(val) Browser.loadURL(V1_URL, VPar);
    }
  "
}

ROUTE V0.isBound TO SC.V0_isBound
ROUTE V1.isBound TO SC.V1_isBound
--//--

The bad news is that there's no easy way to avoid a lot of code typing.

Let me know, julio
0
 
LVL 1

Author Comment

by:garyennis
ID: 1856359
heres the deal....

The code works fine for CP2 on the PC, but most of my development is done on the unix with an older version of cosmo which apparently doesnt like any javascript script (only vrml script) and therefore doesnt like the browser.LoadURL command!!!!

(gives the same error as before!)

Ant possible ideas using older specifications, which would work on all systems????
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1856360
First a doubt: Javascript is case-sensitive, so

 browser.LoadURL()

if fact *is* wrong, because it should look like:

  Browser.loadURL()

Anyway, you are probably right about your browser handling VRMLScript only, but, then, i have no idea of how to work out the problem. An Anchor would work, but - AFAIK - there's no way to ROUTE a Viewpoint isBound to an Anchor...

Have you got a reference to a VRMLScript tutorial on-line, for me to have a look at it, given that i couldn't find any with search engines?

-julio
0
 
LVL 1

Author Comment

by:garyennis
ID: 1856361
Julio..... problem solved...

I upgraded our version of cosmoplayer to 1.02 for the unix, and unlike the last one, this does support Browser.loadURL() with Vrmlscript!!!

Thanks anyway for the help...., I'll post 100 points for you in the "lounge" ok...

Cheers again!!!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
website content maintenance 3 57
Problem to echo 6 53
Pick image, show data 4 33
Navigation funky on tablet in portrait view 2 54
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now