TouchSensor Problem

New Message Reply Date view Thread view Subject view Author view

From: joel.whittle++at++iname.com
Date: 03/06/2000 03:22:57


I am currently developing a virtual warehouse for a company who produce product tracking software.

The aim is to be able to navigate around the warehouse, and when required, be able to click on a desired location which should then display the content of that location in the form of a text message. I have managed to get all this working fine, except for when I click on a location. Instead of that single location displaying a text message, all 2000 locations in the warehouse instantly display their own text messages.

This is not only visually confusing, but is also causing considerable performance problems due to the processing requirements of the operation.

The following is a segment of my code which produces a location / text switch. This is basically repeated with the various names changed, to produce the other 1999 locations. How can I alter this so that a single location will display its text as opposed to all of them ?

Joel Whittle.

#VRML V2.0 utf8

DEF TS1 TouchSensor { }
DEF MySwitch1 Switch {
    whichChoice 0
    choice [
     Transform {
      translation 0 0 0
      children Shape {
        appearance Appearance {
            material Material { diffuseColor 0 1 0 }
        }
        geometry Box { size 1 1 1 }
      }
     }
      Transform {
       translation 0 0.25 0
       children Shape {
       appearance Appearance {
           material Material { diffuseColor 1 1 1 }
       }
       geometry Text {
       string [ " THIS IS WHERE THE DATA GOES",
                " ",
                "DATA DATA DATA DATA DATA DATA",
                " ",
                "DATA DATA DATA DATA DATA DATA",
                " ",
                "39857389783783967387683636486", ]
       fontStyle FontStyle {
          family "SANS"
           style "BOLD"
            size 0.1
         justify "MIDDLE"
     }
    }
   }
  }
]
}

DEF MyScript Script {
    eventIn SFTime switchTime
    eventOut SFInt32 whichChoice
    
    url "vrmlscript:
        function switchTime( ) {
        if (whichChoice == 0)
            whichChoice = 1;
        else whichChoice = 0;
    }"
}

ROUTE TS1.touchTime TO MyScript.switchTime
ROUTE MyScript.whichChoice TO MySwitch1.whichChoice
 

----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Mar 06 2000 - 03:23:03 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.