• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICamera类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: LevelView

 public LevelView(ILevel level, ISpriteBatch spriteBatch, ITexture texture, ICamera camera)
 {
     _level = level;
     _spriteBatch = spriteBatch;
     _texture = texture;
     _camera = camera;
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:LevelView.cs


示例2: VisualisationWindow

 public VisualisationWindow(ZArrayDescriptor desc, ICamera cam, int width, int height, int fsaa_samples, bool vsync)
     : base(width, height, new GraphicsMode(32, 24, 0, fsaa_samples))
 {
     this.cam = cam;
     if(!vsync)
         this.VSync = VSyncMode.Off;
 }
开发者ID:r457r2,项目名称:bakaTest,代码行数:7,代码来源:VisualisationWindow.cs


示例3: RenderEventArg

 /// <summary>
 /// Initializes a new instance of the <see cref="RenderEventArg"/> class.
 /// </summary>
 /// <param name="renderMode">render mode.</param>
 /// <param name="camera">camera used during rendering.</param>
 /// <param name="pickingGeometryType">Target geometry type(point, line, triangle, quad or polygon) for color-coded-picking when <paramref name="renderMode"/> is <see cref="RenderModes.ColorCodedPicking"/>; otherwise useless.</param>
 public RenderEventArg(RenderModes renderMode, Rectangle viewport, ICamera camera, GeometryType pickingGeometryType = GeometryType.Point)
 {
     this.RenderMode = renderMode;
     this.CanvasRect = viewport;
     this.Camera = camera;
     this.PickingGeometryType = pickingGeometryType;
 }
开发者ID:chantsunman,项目名称:CSharpGL,代码行数:13,代码来源:IRenderable.cs


示例4: CameraTracker

        public CameraTracker(Game game, ICamera camera)
            : base(game)
        {
            Camera = camera;

            Tension = 0;
            Bias = 0;
            Continuity = 0;

            Waypoints = new List<Waypoint>();

            float time = 0.0f;
            float delta = 3.0f;

            // Waypoints und LookAt-Directions initialisieren
            Waypoints.Add(CreateWaypoint(new Vector3(10.0f, 5.0f, 10.0f), new Vector3(0.0f, 0.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(10.0f, 3.0f, -10.0f), new Vector3(0.0f, 3.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(-10.0f, 5.0f, -10.0f), new Vector3(0.0f, 0.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(-10.0f, 3.0f, 10.0f), new Vector3(0.0f, 3.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(-15.0f, 10.0f, 15.0f), new Vector3(5.0f, 0.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(-15.0f, 10.0f, -15.0f), new Vector3(0.0f, 0.0f, 5.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(1.0f, 5.0f, -1.0f), new Vector3(0.0f, 0.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(15.0f, 10.0f, 15.0f), new Vector3(0.0f, 0.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(10.0f, 5.0f, 0.0f), new Vector3(0.0f, 0.0f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(0.0f, 0.2f, 0.0f), new Vector3(-1.0f, 0.2f, 0.0f), time += delta));
            Waypoints.Add(CreateWaypoint(new Vector3(-10.0f, 5.0f, 0.0f), new Vector3(0.0f, 0.0f, 0.0f), time += delta));
        }
开发者ID:sp-alex-osou,项目名称:Safari,代码行数:27,代码来源:CameraTracker.cs


示例5: EnableCameraTracking

 public void EnableCameraTracking(ICamera camera)
 {
     this.AddLine("ViewPort: {0}", () => camera.SceneViewport);
     this.AddLine("Translation: {0}", () => camera.SceneTranslationVector);
     this.AddLine("Position: {0}", () => camera.Position);
     this.AddLine("Zooming: {0:f1}", () => camera.ZoomFactor);
 }
开发者ID:plaurin,项目名称:MonoGameEngine2D,代码行数:7,代码来源:DiagnosticHudConfiguration.cs


示例6: GenerateShadowMatrix

 public void GenerateShadowMatrix(ICamera camera, ILight light, out Matrix view, out Matrix projection)
 {
     /// view transforms into Lightspace. Depth is saved. The depth value is then written to the shadowmap position defined by projection (the normal modelviewprojection matrix)
     /// but this is nonsense cause projection will not generate the same position for every pixel across a ray originatin from the lightposition
     view = new Matrix();
     projection = new Matrix();
 }
开发者ID:DelBero,项目名称:XnaScrap,代码行数:7,代码来源:CBeroPerspectiveShadowMap.cs


示例7: Load

        public override void Load(IModel model, ICamera camera, int width, int height)
        {
            _camera = camera;

            GL.MakeCurrent();
            GL.Enable(OpenGL.GL_TEXTURE_2D);
            GL.Enable(OpenGL.GL_CULL_FACE);
            GL.Enable(OpenGL.GL_DEPTH_TEST);
            GL.Enable(OpenGL.GL_BLEND);
            GL.Enable(OpenGL.GL_VERTEX_ARRAY);

            GL.Hint(HintTarget.LineSmooth, HintMode.Nicest);
            GL.Enable(OpenGL.GL_LINE_SMOOTH);
            GL.Enable(OpenGL.GL_BLEND);
            GL.BlendFunc(BlendingSourceFactor.SourceAlpha, BlendingDestinationFactor.OneMinusSourceAlpha);

            GL.Enable(OpenGL.GL_MULTISAMPLE);

            GL.MinSampleShading(4.0f);

            GL.PolygonMode(FaceMode.FrontAndBack, PolygonMode.Filled);

            _postProcesser = new PostProcesser(GL,width,height);

            _backgroundRenderer = new BackgroundRenderer(GL);

            var octreeModel = model as OctreeModel;
            if (octreeModel != null)
            {
                _octreeRenderer = new OctreeRenderer(octreeModel, GL);
            }
        }
开发者ID:veggielane,项目名称:OpenCAD,代码行数:32,代码来源:OpenGLRenderer.cs


示例8: Render

        public void Render(GameTime gameTime, ICamera camera)
        {
            if (_basicEffect != null)
            {
                // Set the effect's parameters.
                Matrix projectionMatrix, viewMatrix;
                camera.GetMatrices(out projectionMatrix, out viewMatrix);

                _basicEffect.Projection = projectionMatrix;
                _basicEffect.View = viewMatrix;
                _basicEffect.World = SceneNode.Transformation;

                // Set the rasterizer state.
                _graphics.DepthStencilState = DepthStencilState.Default;
                _graphics.BlendState = BlendState.AlphaBlend;
                _graphics.RasterizerState = _rasterizerState;

                // Draw the vertex buffer.
                foreach (var effectPass in _basicEffect.CurrentTechnique.Passes)
                {
                    effectPass.Apply();
                    _graphics.DrawUserPrimitives(PrimitiveType.TriangleList, _particleVertices, 0, _particles.Length, VertexPositionColor.VertexDeclaration);
                }
            }
        }
开发者ID:jwvdiermen,项目名称:LD28,代码行数:25,代码来源:DustCloud.cs


示例9: Initialize

        public async Task Initialize(ICamera camera, IStorage storage)
        {
            this.camera = camera;
            this.storage = storage;

            var cacheFolder = KnownFolders.PicturesLibrary;
            this.dropFolder = await cacheFolder.GetFolderAsync("securitysystem-cameradrop");
            this.dropFolderWatcher = dropFolder.CreateFileQuery();

            var images = await this.dropFolderWatcher.GetFilesAsync();
            var orderedImages = images.OrderByDescending(x => x.DateCreated);
            this.newestImage = orderedImages.FirstOrDefault();

            this.dropFolderWatcher.ContentsChanged += DropFolderWatcher_ContentsChanged;

            this.allJoynBusAttachment = new AllJoynBusAttachment();
            this.producer = new SecuritySystemProducer(this.allJoynBusAttachment);
            this.allJoynBusAttachment.AboutData.DefaultAppName = Package.Current.DisplayName;
            this.allJoynBusAttachment.AboutData.DefaultDescription = Package.Current.Description;
            this.allJoynBusAttachment.AboutData.DefaultManufacturer = Package.Current.Id.Publisher;
            this.allJoynBusAttachment.AboutData.SoftwareVersion = Package.Current.Id.Version.ToString();
            this.allJoynBusAttachment.AboutData.IsEnabled = true;
            this.producer.Service = this;
            this.producer.Start();
        }
开发者ID:VictorBarbosa,项目名称:securitysystem,代码行数:25,代码来源:AllJoynManager.cs


示例10: Update

        public override void Update(GameTime gameTime, ICamera camera)
        {
            if (_spaceShip == null || !Enabled)
            {
                return;
            }

            var keyboard = Keyboard.GetState();
            if (keyboard.IsKeyDown(Keys.W) || keyboard.IsKeyDown(Keys.Up))
            {
                _spaceShip.Thrust(Vector2.UnitY * -2500.0f);
            }
            if (keyboard.IsKeyDown(Keys.S) || keyboard.IsKeyDown(Keys.Down))
            {
                _spaceShip.Thrust(Vector2.UnitY * 2500.0f);
            }

            if (keyboard.IsKeyDown(Keys.E))
            {
                _spaceShip.Thrust(Vector2.UnitX * 2000.0f);
            }
            if (keyboard.IsKeyDown(Keys.Q))
            {
                _spaceShip.Thrust(Vector2.UnitX * -2000.0f);
            }

            if (keyboard.IsKeyDown(Keys.D) || keyboard.IsKeyDown(Keys.Right))
            {
                _spaceShip.Rotate(2500.0f);
            }
            if (keyboard.IsKeyDown(Keys.A) || keyboard.IsKeyDown(Keys.Left))
            {
                _spaceShip.Rotate(-2500.0f);
            }
        }
开发者ID:jwvdiermen,项目名称:LD28,代码行数:35,代码来源:PlayerController.cs


示例11: Terrain

		public Terrain( Game game, IHeightMap heightMap, ICamera camera )
			: base( game ) {
			mGame = game;
			mHeightMap = heightMap;
			mCamera = camera;
			mTerrainCells = new List<TerrainCell>();
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:Terrain.cs


示例12: SceneGraph

 public SceneGraph(ICamera camera, IMap map)
 {
     this._RootGraphList = new List<GameObject>();
     this.RootGraph = _RootGraphList.AsReadOnly();
     this.Camera = camera;
     this.Map = map;
 }
开发者ID:Wydra,项目名称:WickedEngine,代码行数:7,代码来源:SceneGraph.cs


示例13: Main

        public Main()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.SynchronizeWithVerticalRetrace = false;
            graphics.ApplyChanges();

            resolution = Settings.Default.WindowResolution;

            graphics.PreferredBackBufferWidth = resolution.X;
            graphics.PreferredBackBufferHeight = resolution.Y;

            Content.RootDirectory = "Content";

            camera = new FreeLookCamera(this);
            cameraHandler = new CameraHandler(this);
            fps = new FPS(this);
            hud = new HUD(this);

            Components.Add(camera);
            Components.Add(cameraHandler);
            Components.Add(fps);
            Components.Add(hud);

            Services.AddService(typeof(ICamera), camera);

            fakeViewFrustum = new BoundingFrustum(Matrix.Identity);
        }
开发者ID:sp-alex-osou,项目名称:TerrainLOD,代码行数:28,代码来源:Main.cs


示例14: Initialize

        public override void Initialize()
        {
            collisionManager = (ICollisionManager)Game.Services.GetService(typeof(ICollisionManager));
            camera = (ICamera)Game.Services.GetService(typeof(ICamera));

            base.Initialize();
        }
开发者ID:kmatzen,项目名称:EECS-494-Final-Project,代码行数:7,代码来源:StarPlane.cs


示例15: Configure

        public static void Configure(ICamera camera, GestureSensor gestureSensor)
        {
            var middleWidth = camera.ResolutionWidth/2;
            var middleHeight = camera.ResolutionHeight/2;
            var l = camera.LeftHand;
            var r = camera.RightHand;

            new GestureSlideLeft(l, middleWidth).SlideDetected += (s, a) =>
                gestureSensor.OnSlideLeft(new GestureEventArgs("Left Hand Slide Left"));
            new GestureSlideRight(l, middleWidth).SlideDetected += (s, a) =>
                gestureSensor.OnSlideRight(new GestureEventArgs("Left Hand Slide Right"));
            new GestureSlideUp(l, middleHeight).SlideDetected += (s, a) =>
                gestureSensor.OnSlideUp(new GestureEventArgs("Left Hand Slide Up"));
            new GestureSlideDown(l, middleHeight).SlideDetected += (s, a) =>
                gestureSensor.OnSlideDown(new GestureEventArgs("Left Hand Slide Down"));

            new GestureSlideLeft(r, middleWidth).SlideDetected += (s, a) =>
                gestureSensor.OnSlideLeft(new GestureEventArgs("Right Hand Slide Left"));
            new GestureSlideRight(r, middleWidth).SlideDetected += (s, a) =>
                gestureSensor.OnSlideRight(new GestureEventArgs("Right Hand Slide Right"));
            new GestureSlideUp(r, middleHeight).SlideDetected += (s, a) =>
                gestureSensor.OnSlideUp(new GestureEventArgs("Right Hand Slide Up"));
            new GestureSlideDown(r, middleHeight).SlideDetected += (s, a) =>
                gestureSensor.OnSlideDown(new GestureEventArgs("Right Hand Slide Down"));
        }
开发者ID:paulopine,项目名称:SharpSenses,代码行数:25,代码来源:GestureSlide.cs


示例16: Draw

        protected override void Draw(GameTime gt, IObject obj, RenderHelper render, ICamera cam, IList<ILight> lights)
        {
            Vector3 dir = cam.Target - cam.Position;
            dir.Normalize();
            _shader.Parameters["forward"].SetValue(dir);
            _shader.Parameters["camUp"].SetValue(cam.Up);
            _shader.Parameters["scaleX"].SetValue(scale.X);
            _shader.Parameters["scaleY"].SetValue(scale.Y);
            _shader.Parameters["xWorld"].SetValue(obj.PhysicObject.WorldMatrix);
            _shader.Parameters["xView"].SetValue(cam.View);
            _shader.Parameters["xProjection"].SetValue(cam.Projection);                        
            //_shader.Parameters["xBillboardTexture"].SetValue(obj.Modelo.getTexture(TextureType.DIFFUSE,0,0));
            render.Textures[0] = obj.Modelo.getTexture(TextureType.DIFFUSE, 0, 0);
            _shader.Parameters["atenuation"].SetValue(atenuation);

            render.PushRasterizerState(RasterizerState.CullNone);

            BatchInformation batchInfo = obj.Modelo.GetBatchInformation(0)[0];            
            {
                _shader.Parameters["alphaTest"].SetValue(alphaTestLimit);
                render.RenderBatch(batchInfo, _shader);
            }

            render.PopRasterizerState();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:DeferredSphericalBilboardShader.cs


示例17: Initialize

        public override void Initialize()
        {
            camera = (ICamera)Game.Services.GetService(typeof(ICamera));
            postprocessingManager = (IPostprocessingManager)Game.Services.GetService(typeof(IPostprocessingManager));

            projection = camera.Projection;
            view = camera.View;

            for (int i = 0; i < scenery.Length; ++i)
            {
                scenery[i] = new List<SceneryComponent>();
                for (int j = 0; j < OBJ_PER_LAYER; ++j)
                {

                    // Create initial scenery for each scenery channel, spawning them a random
                    // distance further behind the far plane.  This gives the impression that
                    // the scenery is coming in randomly, instead of initially appearing in a
                    // large group across the entire screen.
                    scenery[i].Add(CreateScenery(i == 0, j));
                    Vector3 pos = scenery[i][j].Position;
                    pos.Z -= (float)Utility.Prng.NextDouble() * 5000.0f;
                    scenery[i][j].Position = pos;
                    postprocessingManager.AddComponent(scenery[i][j]);
                }
            }

            base.Initialize();
        }
开发者ID:kmatzen,项目名称:EECS-494-Final-Project,代码行数:28,代码来源:SceneryManager.cs


示例18: UpdateBuffer

        /****************************************************************************************************
         * 
         ****************************************************************************************************/
        public void UpdateBuffer(DeviceContext context, Matrix world, ICamera camera)
        {
            var view = camera.CreateViewMatrix();
            var projection = camera.CreateProjectionMatrix(Resolution);
            Matrices[0] = Matrix.Transpose(world);
            Matrices[1] = Matrix.Transpose(view);
            Matrices[2] = Matrix.Transpose(projection);
            Matrices[3] = Matrix.Transpose(world * view);
            Matrices[4] = Matrix.Transpose(world * view * projection);
            Matrices[5] = Matrix.Transpose(view * projection);
            Matrices[6] = Matrix.Invert(world);
            Matrices[7] = Matrix.Invert(world * view);
            Matrices[8] = Matrix.Transpose(Matrix.Identity * Matrix.Scaling(LightPosition));
            Matrices[9] = new Matrix(new float[] 
            {
                LerpTime, AbsoluteTime, Resolution.X, Resolution.Y,
                BeatTime, Lead,0,0,
                Nisse0, Nisse1, Nisse2, Nisse3,
                0,0,0,0,
            });
            if (Buffer == null)
            {
                Buffer = new Buffer(context.Device, Matrices.Length * Utilities.SizeOf<Matrix>(), ResourceUsage.Default, BindFlags.ConstantBuffer, CpuAccessFlags.None, ResourceOptionFlags.None, 0);
            }

            context.UpdateSubresource(Matrices, Buffer);
        }
开发者ID:JoltSoftwareDevelopment,项目名称:Jolt.MashRoom,代码行数:30,代码来源:ShaderEnvironment.cs


示例19: Draw

        public void Draw(GameTime gameTime, ICamera cam, TextureCube skyTexture, Matrix proj)
        {
            // start the shader
            //oceanEffect.Begin();
            //oceanEffect.CurrentTechnique.Passes[0].Begin();

            // set the transforms
            oceanEffect.Parameters["World"].SetValue(Matrix.Identity);
            oceanEffect.Parameters["View"].SetValue(cam.CameraMatrix);
            oceanEffect.Parameters["Projection"].SetValue(proj);
            oceanEffect.Parameters["EyePos"].SetValue(cam.Position);

            // choose and set the ocean textures
            int oceanTexIndex = ((int)(gameTime.TotalGameTime.TotalSeconds) % 4);
            oceanEffect.Parameters["normalTex"].SetValue(OceanNormalMaps[(oceanTexIndex + 1) % 4]);
            oceanEffect.Parameters["normalTex2"].SetValue(OceanNormalMaps[(oceanTexIndex) % 4]);
            oceanEffect.Parameters["textureLerp"].SetValue((((((float)gameTime.TotalGameTime.TotalSeconds) - (int)(gameTime.TotalGameTime.TotalSeconds)) * 2 - 1) * 0.5f) + 0.5f);

            // set the time used for moving waves
            oceanEffect.Parameters["time"].SetValue((float)gameTime.TotalGameTime.TotalSeconds * 0.02f);

            // set the sky texture
            oceanEffect.Parameters["cubeTex"].SetValue(skyTexture);

            //oceanEffect.CommitChanges();
            oceanEffect.CurrentTechnique.Passes[0].Apply();
            // draw our geometry
            //Global.Graphics.VertexDeclaration = OceanVD;
            Global.Graphics.DrawUserPrimitives<VertexPositionNormalTexture>(PrimitiveType.TriangleList, OceanVerts, 0, 2);

            // and we're done!
            //oceanEffect.CurrentTechnique.Passes[0].End();
            //oceanEffect.End();
        }
开发者ID:nagyistoce,项目名称:flightsim,代码行数:34,代码来源:Ocean.cs


示例20: FollowCamera

 public FollowCamera(ICamera camera, IWorldObject target)
 {
     this.camera = camera;
     this.target = target;
     Distance = 1.0f;
     TicksToCatchUp = 200;
 }
开发者ID:nagysa1313,项目名称:Cannonball,代码行数:7,代码来源:FollowCamera.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICamera2D类代码示例发布时间:2022-05-24
下一篇:
C# ICallerContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap