making VRML objects disappear (also SWITCH statement) 
Author Message
 making VRML objects disappear (also SWITCH statement)

I'm trying to design a model such that when a user clicks on a node (a
touchsensor) it disappears (not turns background color - actually isn't
rendered any more).  So far I haven't been able to devise such a way... I
was thinking of making a switch statement with the visible objects USEd in
one children block and *not* used in another block.  However... the switch
statement seems useless - I have to define which case is executed at
development time???  I can't find good documentation of using a switch
actually as a SWITCH...

Any ideas, or another way to turn off an object?

Thanks...

--
+--------------------+---------------------------------------------------+
|  Rich Rubel        |  Happiness is an AWD Subaru!                      |  

|                    |     http://www.*-*-*.com/ ~rrubel1/outback.html  |
+--------------------+---------------------------------------------------+



Mon, 10 Apr 2000 03:00:00 GMT  
 making VRML objects disappear (also SWITCH statement)


Quote:
> I'm trying to design a model such that when a user clicks on a node (a
> touchsensor) it disappears (not turns background color - actually isn't
> rendered any more).  So far I haven't been able to devise such a way... I
> was thinking of making a switch statement with the visible objects USEd in
> one children block and *not* used in another block.  However... the switch
> statement seems useless - I have to define which case is executed at
> development time???  I can't find good documentation of using a switch
> actually as a SWITCH...
> Any ideas, or another way to turn off an object?

Switch is the way to go, as it's fast/efficient and also does
yank out objects for renderning purposes. I don't see the
problem, maybe I'm stupid, but you could just have one entry in
the Switch node, and then you turn this lonely child entry off by
setting the Switch node field whichChoice from 0 (show the only
child) to -1 (turn off the only child). Maybe you need a script
node handling this if you want to keep track of state and such.
--Kent

---
"From action the diversity of the world is produced."



Thu, 13 Apr 2000 02:00:00 GMT  
 making VRML objects disappear (also SWITCH statement)

: Switch is the way to go, as it's fast/efficient and also does
: yank out objects for renderning purposes. I don't see the
: problem, maybe I'm stupid, but you could just have one entry in
: the Switch node, and then you turn this lonely child entry off by
: setting the Switch node field whichChoice from 0 (show the only
: child) to -1 (turn off the only child). Maybe you need a script
: node handling this if you want to keep track of state and such.

Thanks.  I eventually realized how to do just that using Switch (which
didn't seem to be working logically, but that's taken care of as well).  

--
+--------------------+---------------------------------------------------+
|  Rich Rubel        |  Happiness is an AWD Subaru!                      |  

|                    |     http://alumni.umbc.edu/~rrubel1/outback.html  |
+--------------------+---------------------------------------------------+



Mon, 17 Apr 2000 03:00:00 GMT  
 making VRML objects disappear (also SWITCH statement)


: > I'm trying to design a model such that when a user clicks on a node (a
: > touchsensor) it disappears (not turns background color - actually isn't
: > rendered any more).
:
: Switch is the way to go, as it's fast/efficient and also does
: yank out objects for renderning purposes. I don't see the
: problem, maybe I'm stupid, but you could just have one entry in
: the Switch node, and then you turn this lonely child entry off by
: setting the Switch node field whichChoice from 0 (show the only
: child) to -1 (turn off the only child). Maybe you need a script
: node handling this if you want to keep track of state and such.
: --Kent

You must use a script node, regardless of whether or not you are keeping
track of state or any other data.

To control the switch you must send data into the whichChoice exposedField,
which requires data sent from an SFInt32 eventOut. There is no realistic method
to generate this eventOut, since the only way to solicit data from a user
is by using a Sensor of some sort and none of the Sensors generate SFInt32
events.

The best way is to use a JavaScript Script node that contains an SFTime or
SFBool eventIn and causes an SFInt32 eventOut.

dave



Fri, 21 Apr 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Switch statement with nested If statement

2. My VRML converter makes everything one Object :(

3. making things appear on mouseEnter and disappear on mouseLeave

4. control statements: nothing similar to SWITCH()?

5. non-ordered 'switch' statement

6. Eiffel approach to switch statements

7. multi-dimensional switch statements

8. Switch statement in (A)Rexx

9. VRML Scene disappear when FontPage 98 WebServer running?

10. MIPS switch statement

11. newbie: switch/case statement in VC++ asm

12. Accessing Switch Statement Argument

 

 
Powered by phpBB® Forum Software