budnhead/org.budnhead/graphics/GLSceneOrientation.cs

44 lines
730 B
C#

using System;
using OpenTK;
using OpenTK.Graphics.OpenGL;
namespace org.budnhead.graphics
{
public class GLSceneOrientation
{
protected Matrix4
_mCamera,
_mProjection;
public GLSceneOrientation()
{
_mCamera = Matrix4.Identity;
_mProjection = Matrix4.CreatePerspectiveFieldOfView(
MathHelper.PiOver4,
1.0f,
50.0f,
100000.0f
);
}
public Matrix4 mCamera(){
return this._mCamera;
}
public Matrix4 mProjection(){
return this._mProjection;
}
public virtual void setViewport(int width, int height){
float aspect = width / height;
_mProjection = Matrix4.CreatePerspectiveFieldOfView(
MathHelper.PiOver2,
aspect,
1.0f,
100000.0f
);
}
}
}