lineset2
#VRML V2.0 utf8 # Information about this scene WorldInfo { title "Indexed Lineset" info [ "Description: Indexed LineSet for rotating star", "Programming by Roland Smeenk", "Last modified: 13 may 1998", ] } # Navigation Info NavigationInfo { headlight TRUE speed 0.8 type "WALK" } # OK, we make the viewing point a little more interesting DEF VP1 Viewpoint { position -1 0.3 3 orientation 0.2 1 0 -0.4 description "view" } # Transformation node DEF Star Transform { children [ DEF S1 TimeSensor { startTime 0 # Start immediately cycleInterval 6 # One timing loop takes 6 seconds loop TRUE # Keep on generating timing events } DEF P1 OrientationInterpolator { key [0.0,0.25,0.5, 0.75 1.0] keyValue [1 0 0 0, 0.9 0.1 0 1.57, 0.9 -0.1 0 3.14, 0.9 0.1 0 4.71, 1 0 0 0] } Shape { # make the lines appear white appearance Appearance { material Material { emissiveColor 1 1 1 } } geometry IndexedLineSet { # declare some points (x,y,z) coord Coordinate { point [ -1 0 0, 1 0 0, 0 -1 0, 0 1 0, 0 0 -1, 0 0 1, 0.71 0.71 0, -0.71 -0.71 0, 0.71 -0.71 0, -0.71 0.71 0, 0.71 0 0.71, -0.71 0 -0.71, 0.71 0 -0.71, -0.71 0 0.71, 0 0.71 0.71, 0 -0.71 -0.71, 0 0.71 -0.71, 0 -0.71 0.71, ] } # Lines are generated by refering to the index numbers # of the coordinates declared above coordIndex [ 0, 1, -1, # the x-axis 2, 3, -1, # the y-axis 4, 5, -1, # the z-axis 6, 7, -1, 8, 9, -1, 10, 11, -1, 12, 13, -1, 14, 15, -1, 16, 17, -1, ] } } ] } ROUTE S1.fraction_changed TO P1.set_fraction ROUTE P1.value_changed TO Star.rotation