ASP.NET
  Home arrow ASP.NET arrow Page 7 - Managed DirectX First Steps: Direct 3D Bas...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Managed DirectX First Steps: Direct 3D Basics and DirectX vs. GDI+
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 64
    2005-01-26

    Table of Contents:
  • Managed DirectX First Steps: Direct 3D Basics and DirectX vs. GDI+
  • DirectX Overview
  • Referencing DirectX Libraries
  • Put That in Your Pipeline and Shade It
  • 3-D Coordinate Systems and Projections
  • Drawing Primitives and Texture
  • The Application Proposal
  • The Coding Phase
  • Second Step: Coding Your First Windowed Test
  • Code the Render Procedure
  • Fourth Step: Using Transparent Textures
  • Fifth Step: Changing Diffuse Colors
  • Sixth Step: Testing Matrix Transformations
  • Adding the Final Touches

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Managed DirectX First Steps: Direct 3D Basics and DirectX vs. GDI+ - The Application Proposal


    (Page 7 of 14 )

    Our proposal for this chapter sample is to create a simple application that will help you to understand the basics of DirectX, so you can apply this knowledge to creating games in coming chapters.

    To accomplish this, you’ll create an application that will test your machines and return the capabilities of the installed hardware and software, and also run some tests that will give you the necessary information on how to:

    • Create an application that runs in windowed mode.

    • Create an application that runs in full-screen mode.

    • Create an application that shows a transparent sprite using texture capabilities.

    • Create an application that deals with lighting, using different light colors. Although we won’t explore this feature extensively in this book, it’s quite useful to learn the basics of lighting, so you can create interesting effects in your games.

    • Create an application that deals with basic matrix transformations, which will be very useful in your games because they provide a built-in capability to translate (move around the screen), rotate around an axis, and scale any preloaded images to different sizes.

    You’ll create a separate window for each of the tests listed previously, and all the tests will execute the same drawing procedure—one that will present the walking man textures at full speed on screen in order to give you an idea of how fast your 3-D acceleration board really is.

    In the next section, we’ll discuss some extra details about this sample application.

    The Application Project

    This application project will be very straightforward; you can’t add too much detail to it for now, because you’ll be focusing on what you can do with Direct3D in this chapter.

    The coding phase will be divided into six steps, as described in the following list, each one exploring additional features involved in the Direct3D application:

    1. Create a main window with four list boxes that will show you the machine adapters, the devices for each adapter, the display modes for each device, and the device capabilities. From the main window, present the other windows that will do each of the tests defined in the project proposal. The main window is shown in the Figure 3-19.


    Figure 3-19.  The main window interface

       2.  Create a DirectX windowed test that will use a set of textures 
            to produce the illusion of a walking man.

       3.  Adjust the code from the previous step to create a DirectX 
            application that runs in full-screen mode.

       4.  Create a new DirectX windowed test, from the test created in
           step 2, to test the use of transparent textures. For this test,
           you’ll create an image with transparent parts that can be moved
           with the mouse, so you can see that it’s really transparent.

       5.  From the test created in step 2, create a new test that will
           exemplify the use of lighting. For this test you’ll create a control
           window that will allow you to change each of the RGB
           components of the diffuse light colors in each of the figure
           vertices. Figure 3-20 presents the interface that you’ll use to
           control the light colors.

                                                    


                 
                       Figure 3-20.  The Light Control window

     

       6.  Your last test will demonstrate the use of matrix transformations
            on 3-D shapes. For this you’ll create a cube and a window that
            will control the matrix transformations on it. You’ll also add an
            option to make the figure move automatically while the shape
            rotates. The matrix transformations control window is shown in
            Figure 3-21. 


    Figure 3-21.  The MatrixControl window

    In the next section, you’ll start coding your application, starting from the main window code.

    This chapter is from Beginning .NET Game Programming in C# by David Weller et. al.(Apress, 2004, ISBN: 1590593197). Check it out at your favorite bookstore today. Buy this book now.

    More ASP.NET Articles
    More By Apress Publishing


     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT