2017-04-25 22:01:18 +02:00
|
|
|
|
using System;
|
2017-04-28 11:51:02 +02:00
|
|
|
|
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using OpenTK.Graphics.OpenGL;
|
|
|
|
|
|
2017-05-09 23:41:50 +02:00
|
|
|
|
namespace org.budnhead.graphics
|
2017-04-25 22:01:18 +02:00
|
|
|
|
{
|
|
|
|
|
public class GLSceneOrientation
|
|
|
|
|
{
|
2017-04-28 11:51:02 +02:00
|
|
|
|
protected Matrix4
|
|
|
|
|
_mCamera,
|
|
|
|
|
_mProjection;
|
2017-04-25 22:01:18 +02:00
|
|
|
|
|
|
|
|
|
public GLSceneOrientation()
|
|
|
|
|
{
|
2017-04-28 11:51:02 +02:00
|
|
|
|
_mCamera = Matrix4.Identity;
|
|
|
|
|
_mProjection = Matrix4.CreatePerspectiveFieldOfView(
|
|
|
|
|
MathHelper.PiOver4,
|
|
|
|
|
1.0f,
|
|
|
|
|
50.0f,
|
|
|
|
|
100000.0f
|
|
|
|
|
);
|
2017-04-25 22:01:18 +02:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-28 11:51:02 +02:00
|
|
|
|
public Matrix4 mCamera(){
|
|
|
|
|
return this._mCamera;
|
|
|
|
|
}
|
|
|
|
|
public Matrix4 mProjection(){
|
|
|
|
|
return this._mProjection;
|
|
|
|
|
}
|
2017-05-26 15:12:22 +02:00
|
|
|
|
|
|
|
|
|
public virtual void setViewport(int width, int height){
|
|
|
|
|
float aspect = width / height;
|
|
|
|
|
|
|
|
|
|
_mProjection = Matrix4.CreatePerspectiveFieldOfView(
|
|
|
|
|
MathHelper.PiOver2,
|
|
|
|
|
aspect,
|
2017-05-26 15:48:09 +02:00
|
|
|
|
50.0f,
|
2017-05-26 15:12:22 +02:00
|
|
|
|
100000.0f
|
|
|
|
|
);
|
|
|
|
|
}
|
2017-04-25 22:01:18 +02:00
|
|
|
|
}
|
|
|
|
|
}
|