本文整理匯總了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);
}