Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads
 

SharpGL: A C# OpenGL Class Library

By , 22 Feb 2012
 
SharpGL_2.0_Binaries.zip
SharpGL Binaries
Debug
Apex.dll
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.Serialization.dll
SharpGL.WinForms.dll
SharpGL.WPF.dll
Release
Apex.dll
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.Serialization.dll
SharpGL.WinForms.dll
SharpGL.WPF.dll
SharpGL.vsix
SharpGL_2.0_Samples.zip
SharpGL 2.0 Samples
Apex.dll
Apple.cob
Crate.bmp
Decal.bmp
ducky.obj
ExtensionsSample.exe
HitTestSample.exe
NativeTexturesSample.exe
Normal Map.bmp
Particle.png
ParticleSystemSample.exe
PolygonLoadingSample.exe
RadialBlurSample.exe
RenderContextsSample.exe
SceneSample.exe
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.Serialization.dll
SharpGL.WinForms.dll
SharpGL.WPF.dll
SharpGLTexturesSample.exe
SimpleShaderSample.exe
TeapotSample.exe
TextRenderingSample.exe
SharpGL_2.0_Source_Code.zip
SharpGL
Assets
Images
Icons.psd
SharpGL.ico
SharpGLWinForms.ico
SharpGLWpfProject.ico
Models
Apple.cob
ducky.obj
Scenes
Apple.sglsx
Shaders
lambert01vert.glsl
marblelambfrag.glsl
Core
SharpGL.SceneGraph
Assets
Cameras
Core
Effects
Evaluators
Feedback
Helpers
Lighting
OpenGLAttributes
ParticleSystem
Primitives
Properties
Quadrics
Raytracing
Shaders
SharpGL.SceneGraph.csproj.vspscc
SharpGL.snk
Transformations
SharpGL.Serialization
Caligari
Discreet
Properties
SharpGL.Serialization.csproj.vspscc
SharpGL.snk
SharpGL
Wavefront
SharpGL.WinForms
Properties
SharpGL.ico
SharpGL.png
SharpGL.snk
SharpGL.WinForms.csproj.vspscc
SharpGL.WPF
Properties
Settings.settings
Resources
Folder_16x16.png
Light_16x16.png
Star_16x16.png
SceneTree
SharpGL.snk
SharpGL.WPF.csproj.vspscc
Themes
SharpGL
Enumerations
Properties
RenderContextProviders
SharpGL.csproj.vspscc
SharpGL.snk
Dependencies
Apex.dll
Apex.WinForms.dll
ICSharpCode.AvalonEdit.dll
RibbonControlsLibrary.dll
Extensions
SharpGL
Properties
SharpGL.csproj.vspscc
SharpGL.ico
SharpGL.JPG
SharpGL.snk
source.extension.vsixmanifest
WinformsTemplate
Dependencies
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.WinForms.dll
Properties
Settings.settings
WinformsTemplate.csproj.vspscc
WinformsTemplateProject
__TemplateIcon.ico
Dependencies
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.WinForms.dll
Properties
Settings.settings
WinformsTemplateProject.csproj.vspscc
WinformsTemplateProject.vstemplate
WpfTemplate
Dependencies
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.WPF.dll
Properties
Settings.settings
WpfTemplate.csproj.vspscc
WpfTemplateProject
__TemplateIcon.ico
Dependencies
SharpGL.dll
SharpGL.SceneGraph.dll
SharpGL.WPF.dll
Properties
Settings.settings
WpfTemplateProject.csproj.vspscc
WpfTemplateProject.ico
WpfTemplateProject.vstemplate
Samples
WinForms
ExtensionsExample
ExtensionsExample.csproj.vspscc
Properties
Settings.settings
ExtensionsSample
Decal.bmp
ExtensionsSample.csproj.vspscc
Normal Map.bmp
Properties
Settings.settings
SharpGL.ico
HitTestSample
HitTestSample.csproj.vspscc
Properties
Settings.settings
SceneSample.csproj.vspscc
SharpGL.ico
NativeTexturesSample
Crate.bmp
NativeTexturesSample.csproj.vspscc
Properties
Settings.settings
SharpGL.ico
ParticleSystemSample
Particle.png
ParticleSystemSample.csproj.vspscc
Properties
Settings.settings
SharpGL.ico
PolygonLoadingSample
Apple.cob
ducky.obj
PolygonLoadingSample.csproj.vspscc
Properties
Settings.settings
SharpGL.ico
RadialBlurSample
Properties
Settings.settings
RadialBlurSample.csproj.vspscc
SharpGL.ico
RenderContextsSample
Properties
Settings.settings
RenderContextsSample.csproj.vspscc
SharpGL.ico
SceneSample
Properties
Settings.settings
SceneSample.csproj.vspscc
SharpGL.ico
SharpGLTexturesSample
Crate.bmp
NeHe.bmp
Properties
Settings.settings
SharpGL.ico
SharpGLTexturesSample.csproj.vspscc
SimpleDrawingSample
Properties
Settings.settings
SharpGL.ico
SimpleDrawingSample.csproj.vspscc
WPF
CelShadingSample
CelShadingSample.csproj.vspscc
PerPixelLightingFragment.glsl
PerPixelLightingVertex.glsl
Properties
Settings.settings
SimpleShaderSample
Properties
Settings.settings
SimpleShaderSample.csproj.vspscc
TeapotSample.csproj.vspscc
TeapotSample
Properties
Settings.settings
SharpGL.ico
TeapotSample.csproj.vspscc
TextRenderingSample
Properties
Settings.settings
SharpGL.ico
TextRenderingSample.csproj.vspscc
TwoDSample
Properties
Settings.settings
TwoDSample.csproj.vspscc
Tools
DataLoader
DataLoader.csproj.vspscc
Properties
Settings.settings
OpenGLInfo
OpenGLInfo.csproj.vspscc
Properties
Settings.settings
SceneBuilder
App.ico
Images
move.gif
rotate.gif
scale.gif
Scene Tree
Tabs
Info.gif
PointsBuilder
PolygonBuilder
SceneBuilder.csproj.vspscc
Thumbs.db
ShaderBuilder
ShaderBuilder
glsl.xshd
Properties
Settings.settings
Resources
BackgroundBrush.bmp
Shader
ShaderBuilder.csproj.vspscc
SharpGL.ico
SharpGLStudio
Dependencies
Apex.dll
Images
AlignCenter_16x16.png
AlignLeft_16x16.png
AlignRight_16x16.png
Bold_16x16.png
Borders_16x16.png
BordersAndShading_16x16.png
BottomBorder_16x16.png
Bullets_16x16.png
ChooseColor_16x16.png
ClearFormatting_16x16.png
Close_16x16.png
Color_16x16.png
ColorPalette.png
ConnectionManager_48x48.png
Copy_16x16.png
Cut_16x16.png
DecreaseIndent_16x16.png
Default_16x16.png
DiagonalDownBorder_16x16.png
DiagonalUpBorder_16x16.png
Document_16x16.png
DownArrow_16x16.png
DownArrow_32x32.png
DrawTable_16x16.png
EditRedo_16x16.png
EditUndo_16x16.png
Erase_16x16.png
Find_16x16.png
Find_32x32.png
FolderClosed_48x48.png
Font_16x16.png
Font_32x32.png
FontColor_16x16.png
FontScript_16x16.png
Forecolor_16x16.png
FormatPainter_16x16.png
GoTo_16x16.png
Help_16x16.png
Highlight_16x16.png
IncreaseIndent_16x16.png
InsideBorders_16x16.png
InsideHorizontalBorder_16x16.png
InsideVerticalBorder_16x16.png
Italic_16x16.png
Justify_16x16.png
LeftArrow_32x32.png
LeftBorder_16x16.png
LineColor_16x16.png
LineSpacing_16x16.png
Minus_32x32.png
MultilevelList_16x16.png
NewDocument_16x16.png
NewPermission_32x32.png
NoBorder_16x16.png
Numbering_16x16.png
Open_16x16.png
Options_16x16.png
OuterBorders_16x16.png
Paragraph_16x16.png
Paragraph_32x32.png
ParagraphSpacing_16x16.png
Paste_16x16.png
Paste_32x32.png
Plus_32x32.png
Print_16x16.png
Printer_48x48.png
PrintPreview_16x16.png
PublishPlan_16x16.png
RefreshArrow_32x32.png
Replace_16x16.png
RightArrow_32x32.png
RightBorder_16x16.png
Save_16x16.png
Select_16x16.png
SelectionPane_16x16.png
SendLinkByEmail_32x32.png
Shading_16x16.png
ShowGridlines_16x16.png
ShowHide_16x16.png
Sort_16x16.png
Styles_32x32.png
StylesGroup.png
Table_32x32.png
ThemeFonts.png
Tick_32x32.png
TopBorder_16x16.png
UpArrow_16x16.png
UpArrow_32x32.png
Properties
Settings.settings
Resources
BackgroundBrush.bmp
SharpGLStudio.csproj.vspscc
SharpGL_2.0_Visual_Studio_Extension.zip
SharpGL 2.0 Visual Studio Extension
SharpGL.vsix
using System;
using System.ComponentModel;
using SharpGL.SceneGraph.Core;
using SharpGL.SceneGraph.Lighting;

namespace SharpGL.SceneGraph.Cameras
{
	/// <summary>
	/// The LookAt camera is a camera that does a 'look at' transformation.
	/// </summary>
	[Serializable()]
	public class LookAtCamera : PerspectiveCamera
	{
        /// <summary>
        /// Initializes a new instance of the <see cref="LookAtCamera"/> class.
        /// </summary>
        public LookAtCamera()
		{
			Name = "Camera (Look At)";
		}

        /// <summary>
        /// This is the class' main function, to override this function and perform a 
        /// perspective transformation.
        /// </summary>
        public override void TransformProjectionMatrix(OpenGL gl)
        {
            //  Perform the look at transformation.
            gl.Perspective(FieldOfView, AspectRatio, Near, Far);
            gl.LookAt((double)Position.X, (double)Position.Y, (double)Position.Z,
                (double)target.X, (double)target.Y, (double)target.Z,
                (double)upVector.X, (double)upVector.Y, (double)upVector.Z);
        }

		/// <summary>
		/// This is the point in the scene that the camera is pointed at.
		/// </summary>
		protected Vertex target = new Vertex(0, 0, 0);
        
		/// <summary>
		/// This is a vector that describes the 'up' direction (normally 0, 0, 1).
		/// Use this to tilt the camera.
		/// </summary>
		protected Vertex upVector = new Vertex(0, 0, 1);

        /// <summary>
        /// Gets or sets the target.
        /// </summary>
        /// <value>
        /// The target.
        /// </value>
		[Description("The target of the camera (the point it's looking at"), Category("Camera")]
		public Vertex Target
		{
			get {return target;}
			set {target = value;}
		}

        /// <summary>
        /// Gets or sets up vector.
        /// </summary>
        /// <value>
        /// Up vector.
        /// </value>
		[Description("The up direction, relative to camera. (Controls tilt)."), Category("Camera")]
		public Vertex UpVector
		{
			get {return upVector;}
			set {upVector = value;}
		}
    }
}

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

Dave Kerr
Software Developer
United Kingdom United Kingdom
Member
Follow my blog at www.dwmkerr.com and find out about my charity at www.childrenshomesnepal.org.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 22 Feb 2012
Article Copyright 2002 by Dave Kerr
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid