Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 79,119 times

Contents

Related Categories

OpenGL and C# - Part 1 - Introduction

Trialution

Introduction

I’m glad to be the first one writing about OpenGL at this site. What I want to show you in this article is that it is fairly easy to setup a form that is capable of showing 3D. We will accomplish this with the OpenGLControl. So before we can start we (that means you) have to download CsGL here, or if it isn’t there anymore, from its project page. For this article I used the CsGL version 1.4.0 I think it will run on later versions though.

Ok let we start. First thing to do is make a new Windows Application. Which I called SimpelOpenGL but its not important. Ok when that done popup the “Solution explorer” and “add reference” the reference for CsGL must be in "D:\WINDOWS\system32\" which are called csgl.dll and csgl-base.dllnotice that there is .dll called csgl-native.dll but you don’t need it.

Ok import the following namespaces

  • System.Threading
  • CsGL.OpenGL

I'm doing first year Informatica at academy of Amsterdam

Comments

  • Re: [3930] OpenGL and C# - Part 1

    Posted by mpuma on 01 Feb 2008

    I also get this error.  One way of circunventing is by setting the boolean


    CheckForIllegalCrossThreadCalls = false...

  • Re: [3930] OpenGL and C# - Part 1

    Posted by James2432 on 10 Feb 2007

    I get the fallowing exception:  Cross-Thread operation not valid: Control "accessed from a thread other than it was created on.

    in this:

    for (; ; ) // infinity loop for rendering

  • Re: [3930] OpenGL and C# - Part 1

    Posted by dreamlabs on 02 Jun 2006

    when i download the zip file for Csgl one of the files is missing, what should I do? I have looked over the web for other places that have the file, no luck.   

  • Cube doesn't appear...

    Posted by specode on 24 Nov 2005

    I am not sure but I think there is a misstyped variable name "Position", I wonder if its "fPlusPostion".

    Cube.cs Line 76
    ----
    this.ViewPort = 0;
    this.fMinusPosition = 0f...

  • Posted by echoSwe on 10 Jul 2005

    I have the same problem, but I do actually have that line in place in the constructor of OurView.

    I tried this:

    [code]
       Cube cb = new Cube();
       cb.CubeColorBlue = 0.7f;
       cb.CubeColorGreen = 0....