?: changing object apperance by dragging another object 
Author Message
 ?: changing object apperance by dragging another object

Hi,

I want to change the object appearance of my Sphere in my VRML-world. I
have a movable box and by dragging the box over the sphere the apperance
of the sphere should change (e.g. the color). How could I do this? Is
there anyone who could help me?

Thanks a lot for your help,

mike

------------------------------------------------------------------------------

#VRML V2.0 utf8

Group {
  children [
    DEF PS PlaneSensor { minPosition 100 0
                         maxPosition -100 0  }
    DEF T Transform {
      translation 0 0 0
        children [
          Shape {
            appearance Appearance {
              material Material {
                diffuseColor 0.9 0.9 0.9
              }
            }
            geometry Box { size 0.1 0.7 5.2 }
          }
        ]
      }
   ]

Quote:
}

Shape {
  appearance Appearance {
    material Material {
      diffuseColor 0 0.8 0
    }
  }
  geometry Sphere { radius 0.3 }

Quote:
}

ROUTE PS.translation_changed TO T.set_translation


Fri, 15 Aug 2003 21:29:28 GMT  
 ?: changing object apperance by dragging another object
#VRML V2.0 utf8

Group {
  children [
    DEF PS PlaneSensor { minPosition 100 0
                         maxPosition -100 0  }
    DEF T Transform {
      translation 0 0 0
        children [
          Shape {
            appearance Appearance {
              material Material {
                diffuseColor 0.9 0.9 0.9
              }
            }
            geometry Box { size 0.1 0.7 5.2 }
          }
        ]
      }
   ]

Quote:
}

DEF sw Switch {
  whichChoice 0
  choice [
    Shape {
      appearance Appearance {
        material Material {
          diffuseColor 0 0.8 0
        }
      }
      geometry Sphere { radius 0.3 }
    }
    Shape {
      appearance Appearance {
        material Material {
        }
      }
      geometry Box

        size 0.6 0.6 0.6
      }
    }
  ]

Quote:
}

DEF sc Script {
  eventIn SFVec3f set_translation
  eventOut SFInt32 choice_changed
  url "javascript:
  function set_translation(sfvec3f,tm){
    if(sfvec3f.x > 0){
      choice_changed = 1
    } else {
      choice_changed = 0
    }
  }
  "
Quote:
}

ROUTE PS.translation_changed TO sc.set_translation
ROUTE sc.choice_changed TO sw.whichChoice
ROUTE PS.translation_changed TO T.set_translation


Sat, 16 Aug 2003 04:56:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. object changing itself to another object

2. function-objects and code-objects ( was: re-creating objects and security )

3. Object Binding DatabaseQueries and drag-and-drop

4. Transparency while dragging windows or objects?

5. Allowing the user to drag objects in a window

6. Cosmo: Click and Drag Objects?

7. Difficulty with click-dragging objects

8. Scrolling canvas by dragging objects within them

9. Drag Objects using motif/tcl-tk

10. APL Objects: DCOs (Dyalog Component Objects)

11. Correct way of invoking an object inside an ole object

12. Survey referencing objects to an object

 

 
Powered by phpBB® Forum Software