当前位置: 首页>>代码示例>>Python>>正文


Python GuaVE.GuaVE类代码示例

本文整理汇总了Python中examples_common.GuaVE.GuaVE的典型用法代码示例。如果您正苦于以下问题:Python GuaVE类的具体用法?Python GuaVE怎么用?Python GuaVE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GuaVE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

 def run(self):
     guaVE = GuaVE()
     guaVE.start(locals(), globals(), show_banner=False)
     tmp = self.camera.EnableFrustumCulling.value
     self.camera.EnableFrustumCulling.value = False
     self.viewer.frame()
     self.camera.EnableFrustumCulling.value = tmp
     self.viewer.run()
开发者ID:DreadNoize,项目名称:avango,代码行数:8,代码来源:application.py

示例2: launch

    def launch(self, otherlocals):
        print("Launch")
        guaVE = GuaVE()
        z = globals().copy()
        z.update(otherlocals)
        guaVE.start(locals(), z)

        self.viewer.run()
开发者ID:EasyLivinGuitar,项目名称:GroupwareVR,代码行数:8,代码来源:core.py

示例3: start

def start():
  # setup scenegraph
  graph = avango.gua.nodes.SceneGraph(Name="scenegraph")
  loader = avango.gua.nodes.TriMeshLoader()

  volumeloader = avango.gua.nodes.VolumeLoader()
  volume_geode = volumeloader.load("volume", "/opt/gua_vrgeo_2013/data/objects/head_w256_h256_d225_c1_b8.raw", 0)

  transform = avango.gua.nodes.TransformNode(
    Children=[volume_geode]
  )

  size = avango.gua.Vec2ui(1024, 768)

  window = avango.gua.nodes.GlfwWindow(
    Size=size,
    LeftResolution=size
  )

  avango.gua.register_window("window", window)

  cam = avango.gua.nodes.CameraNode(
    LeftScreenPath="/screen",
    SceneGraph="scenegraph",
    Resolution=size,
    OutputWindowName="window",
    Transform=avango.gua.make_trans_mat(0.0, 0.0, 1.5)
  )

  cam.PipelineDescription.value.Passes.value.append(avango.gua.nodes.VolumePassDescription())

  screen = avango.gua.nodes.ScreenNode(
    Name="screen",
    Width=2,
    Height=1.5,
    Children=[cam],
    Transform=avango.gua.make_trans_mat(0.0, 0.0, 1.5)
  )

  graph.Root.value.Children.value = [transform, screen]

  #setup viewer
  viewer = avango.gua.nodes.Viewer()
  viewer.SceneGraphs.value = [graph]
  viewer.Windows.value = [window]

  updater = TimedRotate()

  timer = avango.nodes.TimeSensor()
  updater.TimeIn.connect_from(timer.Time)

  transform.Transform.connect_from(updater.MatrixOut)

  guaVE = GuaVE()
  guaVE.start(locals(), globals())

  viewer.run()
开发者ID:flair2005,项目名称:avango,代码行数:57,代码来源:main.py

示例4: start

def start():
	avango.gua.load_shading_models_from("data/materials")
	avango.gua.load_materials_from("data/materials")

	# Quat to texture with portal view
	portal = avango.gua.nodes.TexturedQuadNode(Name = "portal",
																							Texture = "room",
																							Width = 1.6,
																							Height = 0.9)

	portal.Transform.value = avango.gua.make_trans_mat(0,2.5,2.0) *\
														avango.gua.make_rot_mat(-90.0, 0, 1, 0) *\
														avango.gua.make_scale_mat(2.0,6.0,2.0)

	simplescene.Root.value.Children.value.append(portal)

	# Portal updater for angle of view
	#portal_updater = UpdatePortalTransform()
	#portal_updater.PortalTransformIn.connect_from(portal.Transform)
	#portal_updater.ViewTransformIn.connect_from(simplescene["/screen/head"].Transform)
	#portal_updater.ScreenTransformIn.connect_from(simplescene["/screen"].Transform)
	#simpleroom["/screen/head"].Transform.connect_from(portal_updater.ViewTransformOut)

	# create pipeline, portal and frame
	pipe = create_pipeline("SimpleScene", "SimpleRoom", "firstpipe")

	# create navigator
	navigator = examples_common.navigator.Navigator()
	nav_node = simplescene["/screen"]
	nav_node.Transform.value = avango.gua.make_trans_mat(2.0,3.0,0.0)

	navigator.StartLocation.value = nav_node.Transform.value.get_translate()
	navigator.OutTransform.connect_from(nav_node.Transform)

	navigator.RotationSpeed.value = 0.2
	navigator.MotionSpeed.value = 0.04

	nav_node.Transform.connect_from(navigator.OutTransform)

	viewer = avango.gua.nodes.Viewer()
	viewer.Pipelines.value = [pipe]
	viewer.SceneGraphs.value = [simpleroom,simplescene]

	# If user ist near portal --> change the scene
	portal_user = PortalUser()
	portal_user.my_constructor(viewer, portal, nav_node)
	portal_user.UserPositionIn.connect_from(nav_node.Transform)

	guaVE = GuaVE()
	guaVE.start(locals(), globals())

	viewer.run()
开发者ID:basticirca,项目名称:portal_tests,代码行数:52,代码来源:main.py

示例5: start

def start(filename):

  # setup scenegraph
  graph = avango.gua.nodes.SceneGraph(Name = "scenegraph")

  plodloader = avango.gua.nodes.PLODLoader()
  plodloader.UploadBudget.value = 32
  plodloader.RenderBudget.value = 2048
  plodloader.OutOfCoreBudget.value = 4096
  plod_geode = plodloader.create_geometry_from_file("point_cloud",
                  filename, avango.gua.LoaderFlags.DEFAULTS)


  light = avango.gua.nodes.PointLightNode(Name = "light", Color = avango.gua.Color(1.0, 1.0, 1.0))
  light.Transform.value = avango.gua.make_trans_mat(1, 1, 2) * avango.gua.make_scale_mat(15, 15, 15)

  eye = avango.gua.nodes.TransformNode(Name = "eye")
  eye.Transform.value = avango.gua.make_trans_mat(0.0, 0.0, 3.5)

  screen = avango.gua.nodes.ScreenNode(Name = "screen", Width = 4, Height = 3)
  screen.Children.value = [eye]

  graph.Root.value.Children.value = [plod_geode, light, screen]

  # setup viewing
  size = avango.gua.Vec2ui(1024, 768)
  pipe = avango.gua.nodes.Pipeline(Camera = avango.gua.nodes.Camera(LeftEye = "/screen/eye",
                                                                    RightEye = "/screen/eye",
                                                                    LeftScreen = "/screen",
                                                                    RightScreen = "/screen",
                                                                    SceneGraph = "scenegraph"),
                                   Window = avango.gua.nodes.Window(Size = size,
                                                                    LeftResolution = size),
                                   LeftResolution = size)
  pipe.EnableBackfaceCulling.value = False

  #setup viewer
  viewer = avango.gua.nodes.Viewer()
  viewer.Pipelines.value = [pipe]
  viewer.SceneGraphs.value = [graph]

  timer = avango.nodes.TimeSensor()

  guaVE = GuaVE()
  guaVE.start(locals(), globals())

  viewer.run()
开发者ID:AnimationInVR,项目名称:avango,代码行数:47,代码来源:main.py

示例6: start

def start(filename):

  # setup scenegraph
  graph = avango.gua.nodes.SceneGraph(Name = "scenegraph")

  pbrloader = avango.gua.nodes.PBRLoader()
  pbr_geode = pbrloader.create_geometry_from_file("pbr",
                  filename)


  light = avango.gua.nodes.LightNode(
      Type=avango.gua.LightType.POINT,
      Name = "light", Color = avango.gua.Color(1.0, 1.0, 1.0))
  light.Transform.value = avango.gua.make_trans_mat(1, 1, 2) * avango.gua.make_scale_mat(15, 15, 15)

  eye = avango.gua.nodes.TransformNode(Name = "eye")
  eye.Transform.value = avango.gua.make_trans_mat(0.0, 0.0, 3.5)

  screen = avango.gua.nodes.ScreenNode(Name = "screen", Width = 4, Height = 3)
  screen.Children.value = [eye]

  graph.Root.value.Children.value = [pbr_geode, light, screen]

  # setup viewing
  size = avango.gua.Vec2ui(1024, 768)
  pipe = avango.gua.nodes.Pipeline(Camera = avango.gua.nodes.Camera(LeftEye = "/screen/eye",
                                                                    RightEye = "/screen/eye",
                                                                    LeftScreen = "/screen",
                                                                    RightScreen = "/screen",
                                                                    SceneGraph = "scenegraph"),
                                   Window = avango.gua.nodes.Window(Size = size,
                                                                    LeftResolution = size),
                                   LeftResolution = size)
  pipe.EnableBackfaceCulling.value = False

  #setup viewer
  viewer = avango.gua.nodes.Viewer()
  viewer.Pipelines.value = [pipe]
  viewer.SceneGraphs.value = [graph]

  timer = avango.nodes.TimeSensor()

  guaVE = GuaVE()
  guaVE.start(locals(), globals())

  viewer.run()
开发者ID:flair2005,项目名称:avango,代码行数:46,代码来源:main.py

示例7: start

def start():

  # setup scenegraph
  graph = avango.gua.nodes.SceneGraph(Name = "scenegraph")

  loader = avango.gua.nodes.TriMeshLoader()
  monkey = loader.create_geometry_from_file("monkey", "data/objects/monkey.obj", "data/materials/Stones.gmd", avango.gua.LoaderFlags.DEFAULTS)

  light = avango.gua.nodes.PointLightNode(Name = "light", Color = avango.gua.Color(1.0, 1.0, 1.0))
  light.Transform.value = avango.gua.make_trans_mat(1, 1, 2) * avango.gua.make_scale_mat(15, 15, 15)

  eye = avango.gua.nodes.TransformNode(Name = "eye")
  eye.Transform.value = avango.gua.make_trans_mat(0.0, 0.0, 3.5)

  screen = avango.gua.nodes.ScreenNode(Name = "screen", Width = 4, Height = 3)
  screen.Children.value = [eye]

  graph.Root.value.Children.value = [monkey, light, screen]

  # setup viewing
  size = avango.gua.Vec2ui(1024, 768)
  pipe = avango.gua.nodes.Pipeline(Camera = avango.gua.nodes.Camera(LeftEye = "/screen/eye",
                                                                    RightEye = "/screen/eye",
                                                                    LeftScreen = "/screen",
                                                                    RightScreen = "/screen",
                                                                    SceneGraph = "scenegraph"),
                                   Window = avango.gua.nodes.Window(Size = size,
                                                                    LeftResolution = size),
                                   LeftResolution = size)

  #setup viewer
  viewer = avango.gua.nodes.Viewer()
  viewer.Pipelines.value = [pipe]
  viewer.SceneGraphs.value = [graph]

  monkey_updater = TimedRotate()

  timer = avango.nodes.TimeSensor()
  monkey_updater.TimeIn.connect_from(timer.Time)

  monkey.Transform.connect_from(monkey_updater.MatrixOut)

  guaVE = GuaVE()
  guaVE.start(locals(), globals())

  viewer.run()
开发者ID:AnimationInVR,项目名称:avango,代码行数:46,代码来源:main.py

示例8: start


#.........这里部分代码省略.........
        Height=2.7,
        Transform=avango.gua.make_trans_mat(0.0, 0.0, -2.5))

    camera = avango.gua.nodes.CameraNode(
        Name="cam",
        LeftScreenPath="/cam/screen",
        RightScreenPath="/cam/screen",
        SceneGraph="scene",
        Resolution=size,
        OutputWindowName="window",
        EyeDistance=0.2,
        EnableStereo=False,
        Children=[screen],
        Transform=avango.gua.make_trans_mat(0.0, 0.0, 7.0))

    res_pass = avango.gua.nodes.ResolvePassDescription()
    res_pass.EnableSSAO.value = True
    res_pass.SSAOIntensity.value = 3.0
    res_pass.SSAOFalloff.value = 20.0
    res_pass.SSAORadius.value = 10.0
    res_pass.EnvironmentLightingTexture.value = "day_skymap"
    res_pass.AlternativeEnvironmentLightingTexture.value = "night_skymap"
    res_pass.EnvironmentLightingMode.value = avango.gua.EnvironmentLightingMode.CUBEMAP
    res_pass.ToneMappingMode.value = avango.gua.ToneMappingMode.UNCHARTED
    res_pass.Exposure.value = 1.0
    res_pass.VignetteColor.value = avango.gua.Vec4(0, 0, 0, 0.7)
    res_pass.VignetteCoverage.value = 0.0
    res_pass.EnableFog.value = True
    res_pass.FogStart.value = 30
    res_pass.FogEnd.value = 100
    res_pass.BackgroundMode.value = avango.gua.BackgroundMode.CUBEMAP_TEXTURE
    res_pass.BackgroundTexture.value = "day_skymap"
    res_pass.AlternativeBackgroundTexture.value = "night_skymap"

    sky_pass = avango.gua.nodes.SkyMapPassDescription(
        OutputTextureName="day_skymap")

    avango.gua.create_texture_cube(
        "night_skymap",
        "data/textures/stars/purple-nebula/purple-nebula_right1.jpg",
        "data/textures/stars/purple-nebula/purple-nebula_left2.jpg",
        "data/textures/stars/purple-nebula/purple-nebula_bottom4.jpg",
        "data/textures/stars/purple-nebula/purple-nebula_top3.jpg",
        "data/textures/stars/purple-nebula/purple-nebula_front5.jpg",
        "data/textures/stars/purple-nebula/purple-nebula_back6.jpg")

    pipeline_description = avango.gua.nodes.PipelineDescription(
        Passes=[
            sky_pass, avango.gua.nodes.TriMeshPassDescription(
            ), avango.gua.nodes.LightVisibilityPassDescription(), res_pass,
            avango.gua.nodes.TexturedScreenSpaceQuadPassDescription()
        ])

    camera.PipelineDescription.value = pipeline_description

    graph.Root.value.Children.value.append(camera)

    window = avango.gua.nodes.Window(
        Size=size,
        Title="shadows",
        LeftResolution=size,
        RightResolution=size,
        EnableVsync=False,
        StereoMode=avango.gua.StereoMode.MONO)

    avango.gua.register_window("window", window)

    navigator = examples_common.navigator.Navigator()
    navigator.StartLocation.value = camera.Transform.value.get_translate()
    navigator.OutTransform.connect_from(camera.Transform)

    navigator.RotationSpeed.value = 0.2
    navigator.MotionSpeed.value = 0.04

    camera.Transform.connect_from(navigator.OutTransform)

    viewer = avango.gua.nodes.Viewer()
    viewer.SceneGraphs.value = [graph]
    viewer.Windows.value = [window]

    timer = avango.nodes.TimeSensor()

    fps_updater = FPSUpdater(FPSResource=fps, Window=window, Viewer=viewer)
    fps_updater.TimeIn.connect_from(timer.Time)

    sun_updater = SunUpdater(TimeScale=3500)
    sun_updater.TimeIn.connect_from(timer.Time)
    sun_light.Transform.connect_from(sun_updater.MatrixOut)
    sun_light.Color.connect_from(sun_updater.SunColorOut)
    sky_pass.LightDirection.connect_from(sun_updater.DirectionOut)
    sky_pass.GroundColor.connect_from(sun_updater.GroundColorOut)
    res_pass.BackgroundTextureBlendFactor.connect_from(
        sun_updater.BlendFactorOut)
    res_pass.EnvironmentLightingTextureBlendFactor.connect_from(
        sun_updater.BlendFactorOut)

    guaVE = GuaVE()
    guaVE.start(locals(), globals())

    viewer.run()
开发者ID:flair2005,项目名称:avango,代码行数:101,代码来源:main.py

示例9: start

def start():

    graph = avango.gua.nodes.SceneGraph(Name="big_scenegraph")
    loader = avango.gua.nodes.TriMeshLoader()

    root_node = avango.gua.nodes.TransformNode(
        Name="Root",
        Transform=avango.gua.make_scale_mat(0.5, 0.5, 0.5)
        )

    root_monkey = loader.create_geometry_from_file(
        "root_ape",
        "data/objects/monkey.obj",
        get_random_material()
        )

    root_node.Children.value = [root_monkey]
    graph.Root.value.Children.value.append(root_node)

    monkey_updater = TimedRotate()
    timer = avango.nodes.TimeSensor()
    monkey_updater.TimeIn.connect_from(timer.Time)
    root_monkey.Transform.connect_from(monkey_updater.MatrixOut)

    add_lights(graph, 40)
    setup_scene(graph, root_monkey, 4)

    size = avango.gua.Vec2ui(1500, int(1500*9/16))

    camera = avango.gua.nodes.CameraNode(
        LeftScreenPath="/screen",
        SceneGraph="big_scenegraph",
        Resolution=size,
        OutputWindowName="window",
        Transform=avango.gua.make_trans_mat(0.0, 0.0, 2.5)
        )

    screen = avango.gua.nodes.ScreenNode(
        Name="screen",
        Width=1.6,
        Height=0.9,
        Children=[camera],
        Transform=avango.gua.make_trans_mat(0.0, 0.0, 0.5)
        )

    graph.Root.value.Children.value.append(screen)

    window = avango.gua.nodes.Window(
        Size=size,
        LeftResolution=size
        )

    avango.gua.register_window("window", window)

    guaVE = GuaVE()
    guaVE.start(locals(), globals())

    viewer = avango.gua.nodes.Viewer()
    viewer.SceneGraphs.value = [graph]
    viewer.Windows.value = [window]

    viewer.run()
开发者ID:DreadNoize,项目名称:avango,代码行数:62,代码来源:main.py

示例10: start

def start():
    # setup scenegraph
    graph = avango.gua.nodes.SceneGraph(Name="scenegraph")
    loader = avango.gua.nodes.TriMeshLoader()

    monkey = loader.create_geometry_from_file(
        "monkey",
        "data/objects/monkey.obj",
        avango.gua.LoaderFlags.NORMALIZE_SCALE)

    monkey.Material.value.set_uniform(
        "Color",
        avango.gua.Vec4(1.0, 0.766, 0.336, 1.0))
    monkey.Material.value.set_uniform("Roughness", 0.3)
    monkey.Material.value.set_uniform("Metalness", 1.0)

    transform = avango.gua.nodes.TransformNode(
        Children=[monkey]
        )

    light = avango.gua.nodes.LightNode(
        Type=avango.gua.LightType.POINT,
        Name="light",
        Color=avango.gua.Color(1.0, 1.0, 1.0),
        Brightness=100.0,
        Transform=(avango.gua.make_trans_mat(1, 1, 5) *
                   avango.gua.make_scale_mat(30, 30, 30))
        )

    size = avango.gua.Vec2ui(1024, 768)

    window = avango.gua.nodes.GlfwWindow(
        Size=size,
        LeftResolution=size
        )

    avango.gua.register_window("window", window)

    cam = avango.gua.nodes.CameraNode(
        LeftScreenPath="/screen",
        SceneGraph="scenegraph",
        Resolution=size,
        OutputWindowName="window",
        Transform=avango.gua.make_trans_mat(0.0, 0.0, 3.5)
        )

    res_pass = avango.gua.nodes.ResolvePassDescription()
    res_pass.EnableSSAO.value = True
    res_pass.SSAOIntensity.value = 4.0
    res_pass.SSAOFalloff.value = 10.0
    res_pass.SSAORadius.value = 7.0

    #res_pass.EnableScreenSpaceShadow.value = True

    res_pass.EnvironmentLightingColor.value = avango.gua.Color(0.1, 0.1, 0.1)
    res_pass.ToneMappingMode.value = avango.gua.ToneMappingMode.UNCHARTED
    res_pass.Exposure.value = 1.0
    res_pass.BackgroundColor.value = avango.gua.Color(0.45, 0.5, 0.6)

    anti_aliasing = avango.gua.nodes.SSAAPassDescription()

    pipeline_description = avango.gua.nodes.PipelineDescription(
        Passes=[
            avango.gua.nodes.TriMeshPassDescription(),
            avango.gua.nodes.LightVisibilityPassDescription(),
            res_pass,
            anti_aliasing,
            ])

    cam.PipelineDescription.value = pipeline_description

    screen = avango.gua.nodes.ScreenNode(
        Name="screen",
        Width=2,
        Height=1.5,
        Children=[cam]
        )

    graph.Root.value.Children.value = [transform, light, screen]

    #setup viewer
    viewer = avango.gua.nodes.Viewer()
    viewer.SceneGraphs.value = [graph]
    viewer.Windows.value = [window]

    # make monkey look at the mouse cursor
    mouse_move = MouseMove()
    mouse_move.Resolution.connect_from(window.LeftResolution)
    window.on_move_cursor(mouse_move.on_move_cursor)
    transform.Transform.connect_from(mouse_move.MatrixOut)

    guaVE = GuaVE()
    guaVE.start(locals(), globals())

    viewer.run()
开发者ID:DreadNoize,项目名称:avango,代码行数:95,代码来源:mouse-app.py

示例11: start


#.........这里部分代码省略.........

  floor = mesh_loader.create_geometry_from_file(
    "floor",
    "data/objects/plane.obj",
    avango.gua.LoaderFlags.DEFAULTS
  )
  
  floor.Transform.value = avango.gua.make_scale_mat(4, 1, 4) * avango.gua.make_trans_mat(0, -0.2, 0)
  floor.ShadowMode.value = 1
  graph.Root.value.Children.value.append(floor)

  width = 1920;
  height = int(width * 9.0 / 16.0)
  size = avango.gua.Vec2ui(width, height)

  screen = avango.gua.nodes.ScreenNode(Name = "screen",
                                       Width = 4.8,
                                       Height = 2.7)

  screen.Transform.value = avango.gua.make_trans_mat(0.0, 0.0, -2.5)

  camera = avango.gua.nodes.CameraNode(
    Name = "cam",
    LeftScreenPath = "/cam/screen",
    RightScreenPath = "/cam/screen",
    SceneGraph = "scene",
    Resolution = size,
    OutputWindowName = "window",
    EyeDistance = 0.2,
    EnableStereo = False,
    Children = [screen],
    Transform = avango.gua.make_trans_mat(0.0, 0.0, 2.0)
  )

  res_pass = avango.gua.nodes.ResolvePassDescription()
  res_pass.EnableSSAO.value = False
  res_pass.SSAOIntensity.value = 3.0
  res_pass.SSAOFalloff.value = 20.0
  res_pass.SSAORadius.value = 10.0
  res_pass.EnvironmentLightingColor.value = avango.gua.Color(0.1,0.1,0.1)
  res_pass.ToneMappingMode.value = avango.gua.ToneMappingMode.UNCHARTED
  res_pass.Exposure.value = 1.0
  res_pass.BackgroundMode.value = avango.gua.BackgroundMode.CUBEMAP_TEXTURE
  res_pass.BackgroundTexture.value = "awesome_skymap"
  # res_pass.BackgroundColor.value = avango.gua.Color(0.45, 0.5, 0.6)
  res_pass.VignetteColor.value = avango.gua.Vec4(0, 0, 0, 1)

  plod_pass = avango.gua.lod.nodes.PLodPassDescription()
  plod_pass.SurfelRenderMode.value = avango.gua.lod.RenderFlags.HQ_TWO_PASS
  #plod_pass.SurfelRenderMode.value = avango.gua.lod.RenderFlags.LQ_ONE_PASS

  pipeline_description = avango.gua.nodes.PipelineDescription(
    Passes = [
      avango.gua.nodes.TriMeshPassDescription(),
      plod_pass,
      avango.gua.nodes.SkyMapPassDescription(
        OutputTextureName="awesome_skymap"
      ),
      avango.gua.nodes.LightVisibilityPassDescription(),
      res_pass,
      avango.gua.nodes.DebugViewPassDescription()
    ],
    EnableABuffer = False
  )

  camera.PipelineDescription.value = pipeline_description

  graph.Root.value.Children.value.append(camera)

  window = avango.gua.nodes.Window(
    Size = size,
    Title = "shadows",
    LeftResolution = size,
    RightResolution = size,
    EnableVsync = False,
    StereoMode = avango.gua.StereoMode.MONO
  )

  avango.gua.register_window("window", window)

  navigator = examples_common.navigator.Navigator()
  navigator.StartLocation.value = camera.Transform.value.get_translate()
  navigator.OutTransform.connect_from(camera.Transform)

  navigator.RotationSpeed.value = 0.2
  navigator.MotionSpeed.value = 0.04

  camera.Transform.connect_from(navigator.OutTransform)

  viewer = avango.gua.nodes.Viewer()
  # viewer.DesiredFPS.value = 200
  viewer.SceneGraphs.value = [graph]
  viewer.Windows.value = [window]

  timer = avango.nodes.TimeSensor()

  guaVE = GuaVE()
  guaVE.start(locals(), globals())

  viewer.run()
开发者ID:scholli,项目名称:avango,代码行数:101,代码来源:main.py

示例12: start

def start(filename):
    # setup scenegraph
    graph = avango.gua.nodes.SceneGraph(Name="scenegraph")
    loader = avango.gua.nodes.TriMeshLoader()

    spointsloader = avango.gua.nodes.SPointsLoader()
    spoints_geode = spointsloader.load("kinect", filename)

    transform1 = avango.gua.nodes.TransformNode(Children=[spoints_geode])

    light = avango.gua.nodes.LightNode(
        Type=avango.gua.LightType.POINT,
        Name="light",
        Color=avango.gua.Color(1.0, 1.0, 1.0),
        Brightness=100.0,
        Transform=(avango.gua.make_trans_mat(1, 1, 5) *
                   avango.gua.make_scale_mat(30, 30, 30)))

    size = avango.gua.Vec2ui(1024, 768)

    window = avango.gua.nodes.GlfwWindow(Size=size, LeftResolution=size)

    avango.gua.register_window("window", window)

    cam = avango.gua.nodes.CameraNode(
        LeftScreenPath="/screen",
        SceneGraph="scenegraph",
        Resolution=size,
        OutputWindowName="window",
        Transform=avango.gua.make_trans_mat(0.0, 0.0, 3.5))

    res_pass = avango.gua.nodes.ResolvePassDescription()
    res_pass.EnableSSAO.value = True
    res_pass.SSAOIntensity.value = 4.0
    res_pass.SSAOFalloff.value = 10.0
    res_pass.SSAORadius.value = 7.0

    #res_pass.EnableScreenSpaceShadow.value = True

    res_pass.EnvironmentLightingColor.value = avango.gua.Color(0.1, 0.1, 0.1)
    res_pass.ToneMappingMode.value = avango.gua.ToneMappingMode.UNCHARTED
    res_pass.Exposure.value = 1.0
    res_pass.BackgroundColor.value = avango.gua.Color(0.45, 0.5, 0.6)

    anti_aliasing = avango.gua.nodes.SSAAPassDescription()

    pipeline_description = avango.gua.nodes.PipelineDescription(
        Passes=[
            avango.gua.nodes.TriMeshPassDescription(),
            avango.gua.nodes.LightVisibilityPassDescription(),
            avango.gua.nodes.SPointsPassDescription(),
            res_pass,
            anti_aliasing,
        ])

    cam.PipelineDescription.value = pipeline_description

    screen = avango.gua.nodes.ScreenNode(
        Name="screen",
        Width=2,
        Height=1.5,
        Children=[cam])

    graph.Root.value.Children.value = [transform1, light, screen]

    #setup viewer
    viewer = avango.gua.nodes.Viewer()
    viewer.SceneGraphs.value = [graph]
    viewer.Windows.value = [window]

    monkey_updater = TimedRotate()

    timer = avango.nodes.TimeSensor()
    monkey_updater.TimeIn.connect_from(timer.Time)

    transform1.Transform.connect_from(monkey_updater.MatrixOut)

    guaVE = GuaVE()
    guaVE.start(locals(), globals())

    viewer.run()
开发者ID:scholli,项目名称:avango,代码行数:81,代码来源:main.py

示例13: start

def start():

  # setup scenegraph
  graph = avango.gua.nodes.SceneGraph(Name = "scenegraph")

  loader = avango.gua.nodes.TriMeshLoader()
  monkey = loader.create_geometry_from_file("monkey", "data/objects/monkey.obj", avango.gua.LoaderFlags.DEFAULTS)

  light = avango.gua.nodes.LightNode(
    Type=avango.gua.LightType.POINT,
    Name = "light",
    Color = avango.gua.Color(1.0, 1.0, 1.0),
    Brightness = 10
  )
  light.Transform.value = avango.gua.make_trans_mat(1, 1, 2) * avango.gua.make_scale_mat(15, 15, 15)

  # setup viewing
  width = 1024
  height = 768
  eye_size = avango.gua.Vec2ui(width, height)
  window_size = avango.gua.Vec2ui(width, height)
  left_pos = avango.gua.Vec2ui(0, 0)
  right_pos = avango.gua.Vec2ui(0, 0)

  if STEREO_MODE == avango.gua.StereoMode.SIDE_BY_SIDE:
    right_pos.x = width + 1
    window_size.x *= 2

  window = avango.gua.nodes.GlfwWindow(Size = window_size,
                                       LeftPosition = left_pos,
                                       LeftResolution = eye_size,
                                       RightPosition = right_pos,
                                       RightResolution = eye_size,
                                       StereoMode = STEREO_MODE)

  avango.gua.register_window("window", window)

  cam = avango.gua.nodes.CameraNode(
    Name = "cam",
    LeftScreenPath = "/screen",
    RightScreenPath = "/screen",
    SceneGraph = "scenegraph",
    Resolution = eye_size,
    EyeDistance = 1.2,
    EnableStereo = True,
    OutputWindowName = "window",
    Transform = avango.gua.make_trans_mat(0.0, 0.0, 3.5)
  )

  screen = avango.gua.nodes.ScreenNode(Name = "screen", Width = 4, Height = 3)
  screen.Children.value = [cam]

  graph.Root.value.Children.value = [monkey, light, screen]

  #setup viewer
  viewer = avango.gua.nodes.Viewer()
  viewer.SceneGraphs.value = [graph]
  viewer.Windows.value = [window]

  monkey_updater = TimedRotate()

  timer = avango.nodes.TimeSensor()
  monkey_updater.TimeIn.connect_from(timer.Time)

  monkey.Transform.connect_from(monkey_updater.MatrixOut)

  guaVE = GuaVE()
  guaVE.start(locals(), globals())

  viewer.run()
开发者ID:Nyran,项目名称:avango,代码行数:70,代码来源:main.py

示例14: start


#.........这里部分代码省略.........
  #_path = "/media/SSD_500GB/CONVERTED_Seradina_Parts/" # ssd path 

  _node = _loader.create_geometry_from_file("seradina1_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_01.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("seradina2_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_02.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("seradina3_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_03.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("seradina4_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_04.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)    
  _node = _loader.create_geometry_from_file("seradina5_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_05.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina6_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_06.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina7_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_07.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina8_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_08.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina9_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_09.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina10_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_10.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina11_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_11.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina12_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_12.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina13_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_13.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina14_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_14.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina15_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_15.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  _node = _loader.create_geometry_from_file("seradina16_", "/mnt/pitoti/Seradina_FULL_SCAN/Parts/sera_part_16.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)            
  
  # seradina rock
  _path = "/mnt/pitoti/XYZ_ALL/new_pitoti_sampling/" # opt path
  #_path = "/media/SSD_500GB/Pitoti_Resampled/" # ssd path
  _node = _loader.create_geometry_from_file("rock", _path + "TLS_Seradina_Rock-12C.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  
  # seradina pitoti
  _node = _loader.create_geometry_from_file("pitoti1", _path + "Area-1_Warrior-scene_P01-1.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti2", _path + "Area-1_Warrior-scene_P01-2.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti3", _path + "Area-1_Warrior-scene_P01-3.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti4", _path + "Area-1_Warrior-scene_P01-4.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti5", _path + "Area-1_Warrior-scene_P02-1.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti6", _path + "Area-1_Warrior-scene_P02-2.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti7", _path + "Area-1_Warrior-scene_P02-3.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti8", _path + "Area-1_Warrior-scene_P02-4.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti9", _path + "Area-1_Warrior-scene_P03-1.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti10", _path + "Area-1_Warrior-scene_P03-2.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti11", _path + "Area-1_Warrior-scene_P03-3.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti12", _path + "Area-1_Warrior-scene_P03-4.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)

  _node = _loader.create_geometry_from_file("pitoti13", _path + "Area-2_Plowing-scene_P01-1.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti14", _path + "Area-2_Plowing-scene_P01-2.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)  
  _node = _loader.create_geometry_from_file("pitoti15", _path + "Area-2_Plowing-scene_P01-3.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)  
  _node = _loader.create_geometry_from_file("pitoti16", _path + "Area-2_Plowing-scene_P01-4.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti17", _path + "Area-2_Plowing-scene_P02-1.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti18", _path + "Area-2_Plowing-scene_P02-2.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)  
  _node = _loader.create_geometry_from_file("pitoti19", _path + "Area-2_Plowing-scene_P02-3.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)  
  _node = _loader.create_geometry_from_file("pitoti20", _path + "Area-2_Plowing-scene_P02-4.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
    
  _node = _loader.create_geometry_from_file("pitoti21", _path + "Area-10_Hunting_Scene_P01.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti22", _path + "Area-10_Hunting_Scene_P02.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti23", _path + "Area-10_Hunting_Scene_P03.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)    

  _node = _loader.create_geometry_from_file("pitoti24", _path + "Area-6_house_P01.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti25", _path + "Area-6_house_P02.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)  

  _node = _loader.create_geometry_from_file("pitoti26", _path + "Area-3_Archers_P01.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)
  _node = _loader.create_geometry_from_file("pitoti27", _path + "Area-3_Archers_P02.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)    
  
  _node = _loader.create_geometry_from_file("pitoti28", _path + "Area_4_hunter_with_bow.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)

  _node = _loader.create_geometry_from_file("pitoti29", _path + "Area-5_hunter_with_speer_P01.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)              
  _node = _loader.create_geometry_from_file("pitoti30", _path + "Area-5_hunter_with_speer_P02.kdn", avango.gua.PLODLoaderFlags.DEFAULTS)      
  # END PLOD stuff
  '''

  # get the display instance
  for _display in displays:
    if _display.name == display_name:
      handled_display_instance = _display

  # create a viewer
  viewer = avango.gua.nodes.Viewer()

  # Create a view for each displaystring (= slot)
  _string_num = 0
  views = []

  for _displaystring in handled_display_instance.displaystrings:

    _view = View()
    _view.my_constructor(graph, 
                         viewer,
                         handled_display_instance, 
                         workspace_id,
                         display_group_id,
                         screen_id,
                         _string_num)
    views.append(_view)
    _string_num += 1

  viewer.SceneGraphs.value = [graph]

  # create client portal manager
  portal_manager = ClientPortalManager()
  portal_manager.my_constructor(graph, views)

  shell_client = GuaVE()
  shell_client.start(locals(), globals())

  # start rendering process
  viewer.run()
开发者ID:Manko10,项目名称:navigation-viewing-framework,代码行数:101,代码来源:main.py

示例15: start


#.........这里部分代码省略.........
        )

    size = avango.gua.Vec2ui(1024, 768)

    window = avango.gua.nodes.GlfwWindow(
        Size=size,
        LeftResolution=size
        )

    avango.gua.register_window("window", window)

    cam = avango.gua.nodes.CameraNode(
        LeftScreenPath="/screen",
        SceneGraph="scenegraph",
        Resolution=size,
        OutputWindowName="window",
        Transform=avango.gua.make_trans_mat(0.0, 0.0, 3.5)
        )

    res_pass = avango.gua.nodes.ResolvePassDescription()
    res_pass.EnableSSAO.value = True
    res_pass.SSAOIntensity.value = 4.0
    res_pass.SSAOFalloff.value = 10.0
    res_pass.SSAORadius.value = 7.0

    #res_pass.EnableScreenSpaceShadow.value = True

    res_pass.EnvironmentLightingColor.value = avango.gua.Color(0.1, 0.1, 0.1)
    res_pass.ToneMappingMode.value = avango.gua.ToneMappingMode.UNCHARTED
    res_pass.Exposure.value = 1.0
    res_pass.BackgroundColor.value = avango.gua.Color(0.45, 0.5, 0.6)

    anti_aliasing = avango.gua.nodes.SSAAPassDescription()

    pipeline_description = avango.gua.nodes.PipelineDescription(
        Passes=[
            avango.gua.nodes.TriMeshPassDescription(),
            avango.gua.nodes.LightVisibilityPassDescription(),
            res_pass,
            anti_aliasing,
            ])

    cam.PipelineDescription.value = pipeline_description

    screen = avango.gua.nodes.ScreenNode(
        Name="screen",
        Width=2,
        Height=1.5,
        Children=[cam]
        )

    graph.Root.value.Children.value = [
        left_pos_transform,
        right_pos_transform,
        light,
        screen
        ]

    #setup viewer
    viewer = avango.gua.nodes.Viewer()
    viewer.SceneGraphs.value = [graph]
    viewer.Windows.value = [window]

    # device sensor listening to the daemon values
    device = avango.daemon.nodes.DeviceSensor(
        DeviceService=avango.daemon.DeviceService()
        )
    # station name determines which device is used
    device.Station.value = "gua-device-xbox-0"  # 0 for first xbox controller

    # field container to set rotation of left monkey
    left_rotation_updater = DeviceRotate()
    left_rotation_updater.RotY.connect_from(device.Value0)
    left_rotation_updater.RotX.connect_from(device.Value1)
    left_rot_transform.Transform.connect_from(left_rotation_updater.MatrixOut)

    # field container to set rotation of right monkey
    right_rotation = DeviceRotate()
    right_rotation.RotY.connect_from(device.Value2)
    right_rotation.RotX.connect_from(device.Value3)
    right_rot_transform.Transform.connect_from(right_rotation.MatrixOut)

    # all buttons change the background color
    bgcolor_updater = RandomColor()
    bgcolor_updater.Trigger.connect_from(device.Button0)
    bgcolor_updater.Trigger.connect_from(device.Button1)
    bgcolor_updater.Trigger.connect_from(device.Button2)
    bgcolor_updater.Trigger.connect_from(device.Button3)
    bgcolor_updater.Trigger.connect_from(device.Button4)
    bgcolor_updater.Trigger.connect_from(device.Button5)
    bgcolor_updater.Trigger.connect_from(device.Button6)
    bgcolor_updater.Trigger.connect_from(device.Button7)
    bgcolor_updater.Trigger.connect_from(device.Button8)
    bgcolor_updater.Trigger.connect_from(device.Button9)
    res_pass.BackgroundColor.connect_from(bgcolor_updater.ColorOut)

    guaVE = GuaVE()
    guaVE.start(locals(), globals())

    viewer.run()
开发者ID:flair2005,项目名称:avango,代码行数:101,代码来源:xbox-controller-app.py


注:本文中的examples_common.GuaVE.GuaVE类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。