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


C# Scene类代码示例

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


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

示例1: Run

        public static void Run()
        {
            // ExStart:Save3DScene
            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir();
                        
            // Load a 3D document into Aspose.3D
            Scene scene = new Scene();

            // Open an existing 3D scene
            scene.Open(MyDir + "document.fbx");

            // Save Scene to a stream
            MemoryStream dstStream = new MemoryStream();
            scene.Save(dstStream, FileFormat.FBX7500ASCII);
            
            // Rewind the stream position back to zero so it is ready for next reader.
            dstStream.Position = 0;

            // Save Scene to a local path
            scene.Save(MyDir + "output_out.fbx", FileFormat.FBX7500ASCII);
            // ExEnd:Save3DScene

            Console.WriteLine("\nConverted 3D document to stream successfully.");
        }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:25,代码来源:Save3DScene.cs

示例2: OnLevelActivate

 /// <summary>
 /// Recieve Event to change the current level portal's state. This will have a transition cause the player is present.
 /// </summary>
 /// <param name="scene"></param>
 /// <param name="state"></param>
 void OnLevelActivate(Scene scene, State state)
 {
     if (scene == sceneToLoad)
     {
         switch (state)
         {
             case State.Undefined:
                 break;
             case State.InActive:
                 mesh.renderer.material.mainTexture = _defaultTexture;
                 //gameObject.renderer.material.color = Color.red;
                 iTween.Stop(gameObject);
                 isActive = false;
                 break;
             case State.Active:
                 mesh.renderer.material.mainTexture = _activeTexture;
                 iTween.ShakePosition(gameObject, iTween.Hash("amount", Vector3.forward/4f, "time", .5f, "looptype", iTween.LoopType.loop));
                 iTween.ShakeRotation(gameObject, iTween.Hash("z", 5f, "time", .5f, "looptype", iTween.LoopType.loop));
                 isActive = true;
                 break;
             default:
                 throw new NotImplementedException();
         }
         
     }
 }
开发者ID:harjup,项目名称:WizardBroadcast,代码行数:31,代码来源:LevelPortal.cs

示例3: Run

        public static void Run()
        {
            // Initialize scene object
            Scene scene = new Scene();

            // Initialize Node class object
            Node cubeNode = new Node("cube");

            // Call Common class create mesh method to set mesh instance
            Mesh mesh = Common.CreateMesh();

            // Point node to the Mesh geometry
            cubeNode.Entity = mesh;

            // Set rotation
            cubeNode.Transform.Rotation = Quaternion.FromRotation(new Vector3(0, 1, 0), new Vector3(0.3, 0.5, 0.1));

            // Set translation
            cubeNode.Transform.Translation = new Vector3(0, 0, 20);

            // Add cube to the scene
            scene.RootNode.ChildNodes.Add(cubeNode);

            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir_GeometryAndHierarchy();
            MyDir = MyDir + "TransformationToNode.fbx";

            // Save 3D scene in the supported file formats
            scene.Save(MyDir, FileFormat.FBX7400ASCII);

            Console.WriteLine("\nTransformation added successfully to node.\nFile saved at " + MyDir);
        }
开发者ID:naeem244,项目名称:aspose3d_temp_naeem,代码行数:32,代码来源:TransformationToNode.cs

示例4: Run

        public static void Run()
        {
            // ExStart:AddAssetInformationToScene           
            // Initialize a 3D scene
            Scene scene = new Scene();
            
            // Set application/tool name
            scene.AssetInfo.ApplicationName = "Egypt";
            
            // Set application/tool vendor name
            scene.AssetInfo.ApplicationVendor = "Manualdesk";
            
            // We use ancient egyption measurement unit Pole
            scene.AssetInfo.UnitName = "pole";
            
            // One Pole equals to 60cm
            scene.AssetInfo.UnitScaleFactor = 0.6;            
            
            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir();
            MyDir = MyDir + RunExamples.GetOutputFilePath("InformationToScene.fbx");
                        
            // Save scene to 3D supported file formats
            scene.Save(MyDir, FileFormat.FBX7500ASCII);
            // ExEnd:AddAssetInformationToScene

            Console.WriteLine("\nAsset information added successfully to Scene.\nFile saved at " + MyDir);
        }
开发者ID:aspose-3d,项目名称:Aspose.3D-for-.NET,代码行数:28,代码来源:InformationToScene.cs

示例5: fixTrajectory

 /**
  * Invokes all possible checks for the trajectory
  * @param scene
  */
 public static void fixTrajectory(Scene scene)
 {
     fixSingleNode(scene);
     fixDuplicateNodes(scene);
     fixMissingNodes(scene);
     fixNodesWithSameLocation(scene);
 }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:11,代码来源:TrajectoryFixer.cs

示例6: GameAction

 /// <summary>
 /// Initializes a new instance of the <see cref="GameAction" /> class.
 /// </summary>
 /// <param name="name">Name of the game action.</param>
 /// <param name="scene">The scene</param>
 protected GameAction(string name, Scene scene = null)
 {
     this.IsSkippable = true;
     this.State = TaskState.None;
     this.Name = name;
     this.Scene = scene;
 }
开发者ID:WaveEngine,项目名称:Components,代码行数:12,代码来源:GameAction.cs

示例7: SceneComponent

        public SceneComponent(Scene aScene)
        {
            mScene = aScene;

            // Add Events
            AddEventListeners();
        }
开发者ID:eickegao,项目名称:MilkShake,代码行数:7,代码来源:SceneComponent.cs

示例8: LoadContent

        protected override async Task LoadContent()
        {
            await base.LoadContent();

            graphicsCompositor = new SceneGraphicsCompositorLayers
            {
                Cameras = { Camera.Get<CameraComponent>() },
                Master =
                {
                    Renderers =
                    {
                        new ClearRenderFrameRenderer { Color = Color.Green, Name = "Clear frame" },
                        new SceneDelegateRenderer(PreCameraRendererDraw),
                        new SceneCameraRenderer { Mode = SceneCameraRenderer },
                        new SceneDelegateRenderer(PostCameraRendererDraw),
                    }
                }
            };

            Scene = new Scene { Settings = { GraphicsCompositor = graphicsCompositor } };
            Scene.AddChild(Camera);

            var ambientLight = new Entity { new LightComponent { Type = new LightAmbient { Color = new LightColorRgb(Color.White) }, Intensity = 1 } };
            Scene.AddChild(ambientLight);

            SceneSystem.SceneInstance = new SceneInstance(Services, Scene);
        }
开发者ID:robterrell,项目名称:paradox,代码行数:27,代码来源:EngineTestBase.cs

示例9: Audio3Dupdate

        static WaveBank mPermWaveBank; // one permanant wave bank

        #endregion Fields

        #region Methods

        public static void Audio3Dupdate(Scene scene)
        {
            Audio3DCue c;

            if (mActiveCueList != null)
            {
                setListener(scene);

                for (int i = 0; i < mActiveCueList.Count; i++)
                {
                    c = mActiveCueList[i];

                    if (c.cue.IsDisposed)
                    {
                        mCueStack.Push(c);
                        mActiveCueList.RemoveAt(i);
                    }
                    else if (!c.cue.IsDisposed && c.cue.IsStopped)
                    {
                        c.cue.Dispose();
                        mCueStack.Push(c);
                        mActiveCueList.RemoveAt(i);
                    }
                    else
                        apply3Daudio(c);
                }
            }
        }
开发者ID:JISyed,项目名称:jis-dpu-gd2-airdrone,代码行数:34,代码来源:Sound.cs

示例10: CreateScene

        protected override Scene CreateScene()
        {
            var scene = new Scene("MainScene");
            scene.Add(new ColorLayer("Background", Color.CornflowerBlue));

            var spriteSheet = this.CreateSpriteSheet();

            this.entityLayer = new SpriteLayer("EntityMap");
            scene.Add(this.entityLayer);

            this.playerShipEntity = new PlayerShipEntity(this.entityLayer, spriteSheet);
            this.playerShipEntity.BindController(this.InputConfiguration);

            scene.Add(this.playerShipEntity);

            var yellowSprite = new Sprite(spriteSheet, "YellowEnemy") { Position = new Vector(250, 100) };
            var redSprite = new Sprite(spriteSheet, "RedEnemy") { Position = new Vector(300, 100) };
            var blueSprite = new Sprite(spriteSheet, "BlueEnemy") { Position = new Vector(350, 100) };

            this.entityLayer.AddSprite(yellowSprite);
            this.entityLayer.AddSprite(redSprite);
            this.entityLayer.AddSprite(blueSprite);

            return scene;
        }
开发者ID:plaurin,项目名称:MonoGameEngine2D,代码行数:25,代码来源:ShootEmUpScreen.cs

示例11: createScene

        private static void createScene()
        {
            XmlSerializer sceneSer = new XmlSerializer(typeof(Scene));

             try
             {
            using (FileStream xmlStream = File.OpenRead(Constants.SCENE))
            {
               layout = (Scene)sceneSer.Deserialize(xmlStream);
            }
             }
             catch (Exception e)
             {
            Console.WriteLine(e);
            return;
             }

             foreach (SphereMaterial mat in layout.Spheres)
             {
            layout.Shapes.Add(new Sphere(mat));
             }

             foreach (PlaneMaterial mat in layout.Planes)
             {
            layout.Shapes.Add(new Plane(mat, Constants.FLOOR_SHADING));
             }

             layout.Cam.setup();
        }
开发者ID:qrush,项目名称:q-tracer,代码行数:29,代码来源:Tracer.cs

示例12: BeginTransitionOn

        protected override void BeginTransitionOn()
        {
            spriteBatch = new SpriteBatch(device);
            font = content.Load<SpriteFont>("Consolas");

            scene = new Scene(kernel);

            var camera = new EntityDescription(kernel);
            camera.AddProperty(new TypedName<Camera>("camera"));
            camera.AddProperty(new TypedName<Viewport>("viewport"));
            camera.AddBehaviour<View>();
            var cameraEntity = camera.Create();
            cameraEntity.GetProperty(new TypedName<Camera>("camera")).Value = new Camera();
            cameraEntity.GetProperty(new TypedName<Viewport>("viewport")).Value = new Viewport() { Height = 1920, Width = 1080 };
            scene.Add(camera.Create());

            var renderer = scene.GetService<Renderer>();
            renderer.StartPlan()
                .Then<A>()
                .Then<B>()
                .Then<C>()
                .Then<D>()
                .Apply();

            base.OnShown();
        }
开发者ID:ylyking,项目名称:Myre,代码行数:26,代码来源:RenderPhaseDependancyTest.cs

示例13: Form1

        public Form1()
        {
            InitializeComponent();
            _openGLControl.InitializeContexts();
            _openGLControl.SizeChanged += new EventHandler(OnOpenGLControlResized);

            _input.Mouse = new Mouse(this, _openGLControl);
            _input.Keyboard = new Keyboard(_openGLControl);
            _scene = new Scene();

            InitializeDisplay();
           // InitializeSounds();
            InitializeTextures();
           // InitializeFonts();
            InitializeGameState();

            
            _layers = new Layers(_scene, _textureManager);
            _layers.Show();

            _modeComboBox.SelectedIndex = 1;
            

            _fastLoop = new FastLoop(GameLoop);
        }
开发者ID:iq110,项目名称:csharpgameprogramming,代码行数:25,代码来源:Form1.cs

示例14: getEquipMarkerNode

 public MarkerNode getEquipMarkerNode(Scene scene)
 {
     int[] ids = new int[1];
     ids[0] = 1;
     //return new MarkerNode(scene.MarkerTracker, "Equipment.txt", ids); //ids[1]);
     return new MarkerNode(scene.MarkerTracker, "EquipementMarkerConfig.txt", ids); //ids[1]);
 }
开发者ID:nmrabinovich,项目名称:MedAR,代码行数:7,代码来源:MarkerModule.cs

示例15: OnLevelActivate

 void OnLevelActivate(Scene scene, State state)
 {
     if (scene == Scene.Hub && state == State.Active)
     {
         StartCoroutine(StartGameTransition());
     }
 }
开发者ID:harjup,项目名称:WizardBroadcast,代码行数:7,代码来源:SessionInitializer.cs


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