Please click on the link below to go to my new pages:

http://www.riemers.net

See you there!!

Set up
Contact
  • Overview 
  • Device
  • Vertices
  • Camera
  • Rotation
  • Indices
  • Terrain
  • Landscape
  • Keyboard
  • - Website design & DirectX code : Riemer Grootjans -

    - Overview


    Welcome to the Managed DirectX 9 Tutorial. This tutorial is aimed at people who haven't done any 3D programming so far and would like to see some results in the shortest possible time. Therefore, C# was chosen as a programming language. C# looks very much like Java, so anyone having some notions of Java should be able to start right away.

    At the end of this tutorial, you will have made a fully rotatable three dimensional landscape .



    The required software to start writing your own DirectX 9 code :

  • A C# programming environment. Popular is Visual Studio .NET, but you can also download the free evaluation version of Borland C# Builder.
  • The .NET framework.
  • And of course the DirectX9 SDK.

    With all this software installed, you can start a new C# Application. Using Borland C# Builder, you will already be presented the full code to open a small form.
    Then you should add a reference to Microsoft.DirectX and to Microsoft.DirectX.Direct3D. Also add the following lines to you using-block:  

    using Microsoft.DirectX;

    using Microsoft.DirectX.Direct3D;

     

    Compiling this will already give you an empty form. Now we want to change the size and the title of it. To do this, simply find the InitializeComponent() method and change the size to (500,500) and the title (= this.Text) to "DirectX Tutorial" or whatever you like.

     

    Next we are going to change the Main() method a bit:

     

    static void Main()

             {

                  using (WinForm our_directx_form = new WinForm())

                  {                  

                       Application.Run(our_directx_form);

                  }

             }

     

    You are now ready to start programming with DirectX! Compiling this code should give you a small form.



    After each chapter I will list the whole code so far, so this is what you should have by now :

     

    using System;

    using System.Drawing;

    using System.Collections;

    using System.ComponentModel;

    using System.Windows.Forms;

    using System.Data;

    using Microsoft.DirectX;

    using Microsoft.DirectX.Direct3D;

    namespace DirectX_Tutorial

    {

         public class WinForm : System.Windows.Forms.Form

         {

             private Device device;

             private System.ComponentModel.Container components = null;

             public WinForm()

             {

                  InitializeComponent();

             }

              

             protected override void Dispose (bool disposing)

             {

                  if (disposing)

                  {

                       if (components != null)

                       {

                            components.Dispose();

                       }

                  }

                  base.Dispose(disposing);

             }

             private void InitializeComponent()

             {

                  this.components = new System.ComponentModel.Container();

                  this.Size = new System.Drawing.Size(500,500);

                  this.Text = "DirectX Tutorial";

             }

        

             static void Main()

             {

                  using (WinForm our_dx_form = new WinForm())

                  {

                       Application.Run(our_dx_form);

                  }

             }

         }

    }

    - Website design & DirectX code : Riemer Grootjans -