public virtual void OnResetDevice() { Info.OnResetDevice(); effect.Projection = Matrix.CreatePerspectiveFieldOfView(FieldOfView, AspectRatio, NearPlane, FarPlane); UpdateView(); //Device.SetRenderState(RenderState.Ambient, Ambient); //Device.SetLight(0, light); //Device.EnableLight(0, true); }
protected override void Initialize() { basicEffect = new BasicEffect(GraphicsDevice); basicEffect.TextureEnabled = true; basicEffect.VertexColorEnabled = true; basicEffect.View = XNAMatrix.CreateLookAt( orgCameraPosition, XNAVector3.Zero, XNAVector3.Up ); basicEffect.Projection = XNAMatrix.CreatePerspectiveFieldOfView( XNAMathHelper.ToRadians(45.0f), (float)GraphicsDevice.Viewport.Width / GraphicsDevice.Viewport.Height, 1.0f, 10000.0f ); basicEffect.Texture = null; dummyTexture = XNATexture.Load(GraphicsDevice, "./dummyTexture.png"); }
public static Matrix CreatePerspective(float fov, float aspect, float near, float far) { return(new Matrix(Matrix4x4.CreatePerspectiveFieldOfView(fov, aspect, near, far))); }