OpenGL VRML Shockwave 3D
Home Tutorials Books Applications Tools Docs Models Textures

Send me bugs and suggestions, please
VRML Script Tutorial
Full list

VRML Interactive Tutorial

Introduction
VRML File Structure
Drawing: Shape node
Geometry Nodes:
Box
Sphere
Cone
Cylinder
PointSet
IndexedLineSet
IndexedFaceSet
Extrusion
ElevationGrid
Example: Chessboard
Text
FontStyle
Appearance
Material
Textures
Image Texture
Movie Texture
Pixel Texture
Texture Coordinate
Texture Transform
Let there be Light
Directional Light
Point Light
Spot Light
Materials with Colored Lights
Hierarchical Node Structures
Group
Transform
Collision
Anchor
Billboard
Switch
Inlining Files
Defining and Instancing Nodes
Defining Levels of Detail
Events in VRML
Creating Paths between events: ROUTE
Generating Events based on Timers or User Actions
Timers
Touch Sensor
Visibility Sensor
Dragging Sensors
Plane Sensor
Sphere Sensor
Cylinder Sensor
Proximity Sensors
Example: Proximity sensor
Interpolators
Color
Coordinate
Normal
Orientation
Position
Scalar
Example
Let the Music Play
Sound
AudioClip
Bindable Nodes
Who Am I: NavigationInfo
Where Am I: ViewPoint
Adding Realism to the world
Background
Fog
Information about your world
WorldInfo
Definition for Auxiliary Nodes
Coordinate
Color
Normal

SphereSensor Node


The SphereSensor node maps the mouse movement into a surface of a conceptual sphere, rotating the shape about the center of its local coordinate system. See Dragging Sensors for more information on this type of sensors.

Syntax:
SphereSensor {
enabled TRUE
offset 0 1 0 0
autoOffset TRUE
}


In addition to the exposed fields presented in the syntax the SphereSensor node generates the following events (see Dragging Sensors for a description of their meaning):
  • isActive (boolean)
  • rotation_changed (3D vector plus angle)
  • trackPoint_changed (3D point)
  • Example: Using a SphereSensor to rotate a Box.

    First one needs to create a group node which will include both the sensor and a Transform node containg a Box geometry.

    Example:
    #VRML V2.0 utf8

    Group {
    children [
    DEF ss SphereSensor {}
    DEF tr Transform {
    children Shape {geometry Box {}}
    }

    ]

    }


    Now we need to create a route between the eventOut rotation_changed from the SphereSensor to the exposed field rotation of the Transform node. The route to achieve this is:

    ROUTE ss.rotation_changed TO tr.set_rotation

    Note: On the VRML example provided the axes are not inside the same group as the sensor.



    Site designed and maintained by António Ramires Fernandes
    Your comments, suggestions and references to further material are welcome!

    Lighthouse 3D privacy statement