当前位置: 首页>>代码示例>>C#>>正文


C# OpenGL.LookAt方法代码示例

本文整理汇总了C#中SharpGL.OpenGL.LookAt方法的典型用法代码示例。如果您正苦于以下问题:C# OpenGL.LookAt方法的具体用法?C# OpenGL.LookAt怎么用?C# OpenGL.LookAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SharpGL.OpenGL的用法示例。


在下文中一共展示了OpenGL.LookAt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw

 public void Draw(OpenGL renderer)
 {
     renderer.MatrixMode(SharpGL.Enumerations.MatrixMode.Modelview);
     renderer.LookAt(_eye.X * Radius, _eye.Y * Radius, _eye.Z * Radius, _center.X * Radius, _center.Y * Radius, _center.Z * Radius, _up.X, _up.Y, _up.Z);
     renderer.Translate(_position.X, _position.Y, _position.Z);
 }
开发者ID:cvanherk,项目名称:3d-engine,代码行数:6,代码来源:Camera.cs

示例2: 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);
        }
开发者ID:mkramers,项目名称:Projects,代码行数:20,代码来源:MainWindow.xaml.cs

示例3: openGLControl_OpenGLDraw

 private void openGLControl_OpenGLDraw(object sender, RenderEventArgs e)
 {
     _gl = openGLControl.OpenGL;
     _gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);
     _gl.LoadIdentity();
     _gl.LookAt(0, 0, _w, 0, 0, 0, 0, 1, 0); //-10, 10, _w, 0, 0, 0, 0, 1, 0
     _gl.Rotate((float)_rotX, (float)_rotY, (float)_rotZ);
     _gl.Translate(_transX, _transY, _transZ);
     foreach (Polygon polygon in _polygons)
         {
             if (!polygon.IsEnabled) continue;
             polygon.PushObjectSpace(_gl);
             polygon.Render(_gl, SharpGL.SceneGraph.Core.RenderMode.Render);
             polygon.PopObjectSpace(_gl);
         }
 }
开发者ID:MaKiPL,项目名称:FF8-Rinoa-s-Toolset,代码行数:16,代码来源:SharpGLForm.cs

示例4: 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);
        }
开发者ID:EternalEnvy,项目名称:SmackBrosClient,代码行数:29,代码来源:GameplayScreen.cs

示例5: 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);
 }
开发者ID:Vinic,项目名称:TomatoEngine,代码行数:5,代码来源:CamController.cs


注:本文中的SharpGL.OpenGL.LookAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。