# but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU Lesser General Public # # License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. # # # ########################################################################## from avango import display import avango import avango.script import sys argv = display.init(sys.argv) view = display.make_view() view.EnableTrackball.value = True def field_dump(script): buffer = "" for i in xrange(script._get_num_fields()): field = script._get_field(i) field_name = field._get_name() field_type = field._get_type() buffer += "Field: <" + str(field_name) + "> of type: <" + str( field_type) + "> = <" + str(field.value) + ">\n" return buffer class MouseListener(avango.script.Script):
rotation = RotateMatrix() rotation.TimeIn.connect_from(time_sensor.Time) transform = avango.osg.nodes.MatrixTransform() transform.Matrix.connect_from(rotation.MatrixOut) transform.Children.value = [ avango.osg.nodes.Geode(Drawables=[geometry], StateSet=state_set) ] root.Children.value.append(transform) return root, rtt_root, keep_alive + [rotation] argv = display.init(sys.argv) view1 = display.make_view() view1.BackgroundColor.value = avango.osg.Vec4(0.5, 0.5, 0.5, 1.) ortho_projection = False if "ortho" in argv: ortho_projection = True time_sensor = avango.nodes.TimeSensor() quad_geom, rtt_root, keep_alive = build_quad(time_sensor) transform = avango.osg.nodes.MatrixTransform(Children=[quad_geom, rtt_root], Matrix=avango.osg.make_trans_mat( 0, 1.7, -2.2)) view1.Root.value = transform display.run()
root = avango.osg.nodes.Group() rtt_root = avango.osg.nodes.Group() texture2d, keep_alive = build_texture(time_sensor, rtt_root) state_set = avango.osg.nodes.StateSet(Texture0 = texture2d) rotation = RotateMatrix() rotation.TimeIn.connect_from(time_sensor.Time) transform = avango.osg.nodes.MatrixTransform() transform.Matrix.connect_from(rotation.MatrixOut) transform.Children.value = [avango.osg.nodes.Geode(Drawables=[geometry], StateSet=state_set)] root.Children.value.append(transform) return root, rtt_root, keep_alive+[rotation] argv = display.init(sys.argv) view1 = display.make_view() view1.BackgroundColor.value = avango.osg.Vec4(0.5, 0.5, 0.5, 1.) ortho_projection = False if "ortho" in argv: ortho_projection = True time_sensor = avango.nodes.TimeSensor() quad_geom, rtt_root, keep_alive = build_quad(time_sensor) transform = avango.osg.nodes.MatrixTransform(Children=[quad_geom,rtt_root], Matrix=avango.osg.make_trans_mat(0, 1.7, -2.2)) view1.Root.value = transform display.run()
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU Lesser General Public # # License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. # # # ########################################################################## from avango import display import avango import avango.script import sys argv = display.init(sys.argv) view = display.make_view() view.EnableTrackball.value = True def field_dump(script): buffer = "" for i in xrange(script._get_num_fields()): field = script._get_field(i) field_name = field._get_name() field_type = field._get_type() buffer += "Field: <"+ str(field_name) + "> of type: <" + str(field_type) + "> = <" + str(field.value) + ">\n" return buffer class MouseListener(avango.script.Script): MousePosNorm = avango.osg.SFVec2() MousePos = avango.osg.SFVec2()