本文整理汇总了C#中SharpGL.OpenGL.Perspective方法的典型用法代码示例。如果您正苦于以下问题:C# OpenGL.Perspective方法的具体用法?C# OpenGL.Perspective怎么用?C# OpenGL.Perspective使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpGL.OpenGL
的用法示例。
在下文中一共展示了OpenGL.Perspective方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BasicResize
//utilities
public static void BasicResize(OpenGL _context, Size _size)
{
//ThrowIfNull(_context);
// Set the projection matrix.
_context.MatrixMode(OpenGL.GL_PROJECTION);
// Load the identity.
_context.LoadIdentity();
// Create a perspective transformation.
_context.Perspective(60.0f, _size.Width / _size.Height, 0.01, 100.0);
// Use the 'look at' helper function to position and aim the camera.
_context.LookAt(0, 0, 2, 0, 0, 0, 0, 1, 0);
// Set the modelview matrix.
_context.MatrixMode(OpenGL.GL_MODELVIEW);
}
示例2: Resized
public void Resized(OpenGL gl, double aspect)
{
// Set the projection matrix.
gl.MatrixMode(OpenGL.GL_PROJECTION);
// Load the identity.
gl.LoadIdentity();
// Create a perspective transformation.
gl.Perspective(60.0f, aspect, 0.01, 100.0);
CamController.Aspect = aspect;
// Use the 'look at' helper function to position and aim the camera.
CamController.SetCam(gl);
// Set the modelview matrix.
gl.MatrixMode(OpenGL.GL_MODELVIEW);
}
示例3: Resized
//Handles the Resized event of the openGLControl1 control
private void Resized(ref OpenGL gl, double Width, double Height)
{
// Set the projection matrix.
gl.MatrixMode(OpenGL.GL_PROJECTION);
// Load the identity.
gl.LoadIdentity();
if (!TexturesInitialised)
{
gl.Ortho(-1, 1, -1, 1, -1, 1);
}
else
{
gl.Ortho(0, gImage1.Width, gImage1.Height, 0, -1, 1);
}
gl.MatrixMode(OpenGL.GL_MODELVIEW);
gl.Disable(OpenGL.GL_DEPTH_TEST);
// Create a perspective transformation.
gl.Perspective(45.0f, (double)Width / (double)Height, 1.0, 1000.0);
gl.Viewport(0, 0, (int)Width, (int)Height);
// Use the 'look at' helper function to position and aim the camera.
gl.LookAt(-5, 5, -5, 0, 0, 0, 0, 1, 0);
// Set the modelview matrix.
gl.MatrixMode(OpenGL.GL_MODELVIEW);
}
示例4: SetCam
public static void SetCam(OpenGL gl)
{
gl.Perspective(60.0f, Aspect, 0.01, 100.0);
gl.LookAt(_x, _y, 30, _x, _y, 0, 0, 1, 0);
}