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


Python GuaVE.start方法代码示例

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


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

示例1: run

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
 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,代码行数:10,代码来源:application.py

示例2: launch

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
    def launch(self, otherlocals):
        print("Launch")
        guaVE = GuaVE()
        z = globals().copy()
        z.update(otherlocals)
        guaVE.start(locals(), z)

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

示例3: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:59,代码来源:main.py

示例4: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:54,代码来源:main.py

示例5: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:49,代码来源:main.py

示例6: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:48,代码来源:main.py

示例7: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:48,代码来源:main.py

示例8: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
def start():
    graph = avango.gua.nodes.SceneGraph(Name="scene")
    loader = avango.gua.nodes.TriMeshLoader()

    fps_size = avango.gua.Vec2(170, 55)

    fps = avango.gua.gui.nodes.GuiResourceNode()
    fps.TextureName.value = "fps"
    fps.URL.value = "asset://gua/data/html/fps.html"
    fps.Size.value = fps_size

    fps_quad = avango.gua.nodes.TexturedScreenSpaceQuadNode(
        Name="fps_quad",
        Texture="fps",
        Width=int(fps_size.x),
        Height=int(fps_size.y),
        Anchor=avango.gua.Vec2(1.0, 1.0))
    graph.Root.value.Children.value.append(fps_quad)

    fallback_mat = avango.gua.create_material(
        avango.gua.MaterialCapabilities.COLOR_VALUE |
        avango.gua.MaterialCapabilities.ROUGHNESS_VALUE)
    fallback_mat.set_uniform("Roughness", 0.6)

    for x in range(0, CUBE_COUNT_X):
        for y in range(0, CUBE_COUNT_Y):
            for z in range(0, CUBE_COUNT_Z):

                new_cube = loader.create_geometry_from_file(
                    "cube" + str(x) + str(y) + str(z),
                    "data/objects/monkey.obj", fallback_mat,
                    avango.gua.LoaderFlags.DEFAULTS)

                new_cube.Transform.value = avango.gua.make_trans_mat(x*2, y*2, z*2) * \
                                   avango.gua.make_scale_mat(0.3, 0.3, 0.3)
                graph.Root.value.Children.value.append(new_cube)
                new_cube.ShadowMode.value = 1

    sun_light = avango.gua.nodes.LightNode(
        Name="sun_light",
        Type=avango.gua.LightType.SUN,
        Color=avango.gua.Color(1.0, 1.0, 0.7),
        EnableShadows=True,
        ShadowMapSize=1024,
        ShadowOffset=0.0005,
        ShadowCascadedSplits=[0.1, 4, 7, 20],
        ShadowMaxDistance=30,
        ShadowNearClippingInSunDirection=100,
        ShadowFarClippingInSunDirection=100,
        Brightness=4)
    graph.Root.value.Children.value.append(sun_light)

    floor = loader.create_geometry_from_file(
        "floor", "data/objects/plane.obj", fallback_mat,
        avango.gua.LoaderFlags.DEFAULTS)
    floor.Transform.value = avango.gua.make_scale_mat(
        200, 1, 200) * avango.gua.make_trans_mat(-0.5, -0.2, -0.5)
    floor.ShadowMode.value = 0
    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,
        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"
#.........这里部分代码省略.........
开发者ID:flair2005,项目名称:avango,代码行数:103,代码来源:main.py

示例9: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:64,代码来源:main.py

示例10: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:97,代码来源:mouse-app.py

示例11: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
def start():

  graph  = avango.gua.nodes.SceneGraph(Name = "scene")
  mesh_loader = avango.gua.nodes.TriMeshLoader()
  
  #configure lod backend
  lod_loader = avango.gua.lod.nodes.LodLoader()
  lod_loader.UploadBudget.value = 64
  lod_loader.RenderBudget.value = 2048
  lod_loader.OutOfCoreBudget.value = 4096
  
  fallback_mat = avango.gua.create_material(avango.gua.MaterialCapabilities.COLOR_VALUE)


  
  plod_node = lod_loader.load_lod_pointcloud(
                  "/opt/3d_models/point_based/plod/pig_pr.bvh",
                  avango.gua.lod.LoaderFlags.NORMALIZE_SCALE |
                  avango.gua.lod.LoaderFlags.NORMALIZE_POSITION
                  )

  new_cube = mesh_loader.create_geometry_from_file(
    "cube",
    "data/objects/monkey.obj",
    fallback_mat,
    avango.gua.LoaderFlags.DEFAULTS
  )
  
  #plod_node.Material.value.set_uniform("Color", avango.gua.Vec4(1.0, 1.0, 1.0, 1.0))
  plod_node.Material.value.set_uniform("Emissivity", 1.0)

  new_cube.Transform.value = avango.gua.make_trans_mat(-1, 0.3, 0) * \
                             avango.gua.make_scale_mat(0.3, 0.3, 0.3)
  
  
  
  plod_node.Transform.value = avango.gua.make_trans_mat(0, 0.3, 0) * \
                              avango.gua.make_scale_mat(0.3, 0.3, 0.3)
  
  graph.Root.value.Children.value.append(plod_node)
  plod_node.ShadowMode.value = 1
  graph.Root.value.Children.value.append(new_cube)
  new_cube.ShadowMode.value = 1


  spot_light_1 = avango.gua.nodes.LightNode(Name = "spot_light_1",
                                         Type = avango.gua.LightType.SPOT,
                                         Color = avango.gua.Color(1.0, 1.0, 1.0),
                                         EnableShadows = True,
                                         ShadowMapSize = 1024,
                                         ShadowOffset = 0.002,
                                         ShadowMaxDistance = 10,
                                         Falloff = 1.5,
                                         ShadowNearClippingInSunDirection = 0.1,
                                         ShadowFarClippingInSunDirection = 10.0,
                                         Softness = 2,
                                         Brightness = 20)
  spot_light_1.Transform.value = avango.gua.make_trans_mat(0.0, 3.0, 0.0) * avango.gua.make_rot_mat(-90, 1, 0, 0) * avango.gua.make_scale_mat(4)
  graph.Root.value.Children.value.append(spot_light_1)

  point_light1 = avango.gua.nodes.LightNode(
                                         Type = avango.gua.LightType.POINT,
                                         Name = "point_light1",
                                         Color = avango.gua.Color(0.2, 1.0, 1.7),
                                         EnableShadows = True,
                                         ShadowMapSize = 1024,
                                         ShadowMaxDistance = 10,
                                         ShadowOffset = 0.03,
                                         Falloff = 0.5,
                                         ShadowNearClippingInSunDirection = 0.1,
                                         ShadowFarClippingInSunDirection = 10.0,
                                         Brightness = 20)
                                         
  point_light1.Transform.value = avango.gua.make_trans_mat(1.5, 1.0, 1.5) * avango.gua.make_scale_mat(4)
  graph.Root.value.Children.value.append(point_light1)

  sun_light = avango.gua.nodes.LightNode(Name = "sun_light",
                                         Type = avango.gua.LightType.SUN,
                                         Color = avango.gua.Color(1.0, 1.0, 0.7),
                                         EnableShadows = True,
                                         ShadowMapSize = 1024,
                                         ShadowOffset = 0.0005,
                                         ShadowCascadedSplits = [0.1, 4, 7, 20],
                                         ShadowMaxDistance = 30,
                                         ShadowNearClippingInSunDirection = 100,
                                         ShadowFarClippingInSunDirection = 100,
                                         Brightness = 2
                                         )
  sun_light.Transform.value = avango.gua.make_rot_mat(210, 0, 1, 0) * avango.gua.make_rot_mat(-50.0, 1.0, 0.0, 0.0)
  #graph.Root.value.Children.value.append(sun_light)

  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)
#.........这里部分代码省略.........
开发者ID:scholli,项目名称:avango,代码行数:103,代码来源:main.py

示例12: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:83,代码来源:main.py

示例13: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
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,代码行数:72,代码来源:main.py

示例14: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
def start():

  # disable logger warningss
  logger = avango.gua.nodes.Logger(EnableWarning = False)

  # get the server ip
  server_ip = str(sys.argv[1])

  # get the workspace config file #
  workspace_config_file = str(sys.argv[2])
  exec('from ' + workspace_config_file.replace("/", ".").replace(".py", "") + ' import displays', globals())

  # get the workspace id
  workspace_id = int(sys.argv[3])

  # get the display group id
  display_group_id = int(sys.argv[4])

  # get the screen id
  screen_id = int(sys.argv[5])

  # get the display name
  display_name = str(sys.argv[6])

  # get own hostname
  hostname = open('/etc/hostname', 'r').readline()
  hostname = hostname.strip(" \n")

  print("This client is running on", hostname, "and listens to server", server_ip)
  print("It is responsible for workspace", workspace_id, ", display group", display_group_id, "and screen", screen_id)

  # preload materials and shading models
  avango.gua.load_shading_models_from("data/materials")
  avango.gua.load_materials_from("data/materials")
  
  # create distribution node
  nettrans = avango.gua.nodes.NetTransform(
                Name = "net",
                # specify role, ip, and port
                Groupname = "AVCLIENT|{0}|7432".format(server_ip)
                )

  # create a dummy scenegraph to be extended by distribution
  graph = avango.gua.nodes.SceneGraph(Name = "scenegraph")

  graph.Root.value.Children.value = [nettrans]

  # create material updaters as this cannot be distributed
  avango.gua.load_shading_models_from("data/materials")
  avango.gua.load_materials_from("data/materials")
  
  timer = avango.nodes.TimeSensor()
  
  water_updater = ClientMaterialUpdaters.TimedMaterialUniformUpdate()
  water_updater.MaterialName.value = "data/materials/Water.gmd"
  water_updater.UniformName.value = "time"
  water_updater.TimeIn.connect_from(timer.Time)

  '''
  # PLOD Stuff
  _loader = avango.gua.nodes.PLODLoader()
  _loader.UploadBudget.value = 256
  _loader.RenderBudget.value = 4*1024
  _loader.OutOfCoreBudget.value = 24*1024

  
  # Valcamonica
  _path = "/mnt/pitoti/KDN_LOD/PITOTI_KDN_LOD/01_SFM-Befliegung_Seradina_PointCloud/" # opt path
  #_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)
#.........这里部分代码省略.........
开发者ID:Manko10,项目名称:navigation-viewing-framework,代码行数:103,代码来源:main.py

示例15: start

# 需要导入模块: from examples_common.GuaVE import GuaVE [as 别名]
# 或者: from examples_common.GuaVE.GuaVE import start [as 别名]
def start():
    # setup scenegraph
    graph = avango.gua.nodes.SceneGraph(Name="scenegraph")
    loader = avango.gua.nodes.TriMeshLoader()

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

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

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

    right_monkey.Material.value.set_uniform(
        "Color", avango.gua.Vec4(1.0, 0.266, 0.136, 1.0))
    right_monkey.Material.value.set_uniform("Roughness", 0.6)
    right_monkey.Material.value.set_uniform("Metalness", 0.0)

    left_rot_transform = avango.gua.nodes.TransformNode(
        Children=[left_monkey]
        )
    left_pos_transform = avango.gua.nodes.TransformNode(
        Transform=avango.gua.make_trans_mat(-0.5, 0.0, 0.0),
        Children=[left_rot_transform]
        )
    right_rot_transform = avango.gua.nodes.TransformNode(
        Children=[right_monkey]
        )
    right_pos_transform = avango.gua.nodes.TransformNode(
        Transform=avango.gua.make_trans_mat(0.5, 0.0, 0.0),
        Children=[right_rot_transform]
        )

    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 = [
        left_pos_transform,
#.........这里部分代码省略.........
开发者ID:flair2005,项目名称:avango,代码行数:103,代码来源:xbox-controller-app.py


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