The Sandbox Thread

17 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

DirectX-3D Nebula generator

Back to Forum: The Sandbox
  • fredm

    Generates random nebula in 3d, with motion, using Managed DirectX. Should provide a good introduction on how to program using Managed DirectX 3D graphics.

    I recently rebuilt it using C# Express, and thus it uses version 2.0 of the Framework and CLR. 

    5/17: I updated the source to work with the April 2005 DirectX SDK, and fixed the C# beta 2.0 compiler warnings. Probably, it will *no longer build* under VS 2003, C# Express beta 1, and the old DirectX SDK.

  • Minh

    Requires CLR 2.0. Have to wait 'til later to boot to my test partition.

  • Charles

    All, it's probably a really good idea to list all software requirements when you post an application.

    Thanks Minh for the 2.0 heads up (glad your using 2.0 and the DirectX SDK fredm!). You'll probably also need the DirectX managed PIAs ("Managed DirectX") installed to play with this app.

    Looks like a cool app!

    C

  • Pango

    File's not there.  Can't download it.

  • fredm

    file and picture were there: maybe the channel 9 guys deleted it for some reason (?) I'd repost it if some moderator says it would be ok to do so

  • Charles

    Please repost! We're experiencing random strangeness with our file server. Ill have Orcsweb look into it.
    Sorry about this.

    C

  • hack.root

    cool i liked it Smiley

  • figuerres

    I'm no wiz at d3d / dx so I'll just post and ask:

    17 warnings and 2 errors when I load this with VS2005 beta2

    the warnings are ok... has to do with depricated controls.

    2 errors I am not sure how to fix:


    nebula.cs line  305:

    renderBuffer[i].SetPosition(stars[i].position);
    Error 7 'Microsoft.DirectX.Direct3D.CustomVertex.PositionColored' does not contain a definition for 'SetPosition' C:\Projects\3dNebGen\3dNebGen\Nebula.cs 305 33 3dNebGen


    and:
    SpaceShip.cs line 189:

    device.Lights[0].Commit();

    Error 8 'Microsoft.DirectX.Direct3D.Light' does not contain a definition for 'Commit' C:\Projects\3dNebGen\3dNebGen\SpaceShip.cs 189 30 3dNebGen


    also when I installed the Dx9 SDK I see 2 versions of each Dx namespace to pick from!

    perhaps this is part of the problem??


    any one know how to fix this??

  • zman

    Make sure you are using the latest DirectX SDK those functions are ones which have changed as they have upgraded.

  • figuerres

    zman wrote:
    Make sure you are using the latest DirectX SDK those functions are ones which have changed as they have upgraded.


    brand new download from the MSDN web site.

    Dx 9.0 c april 2005 SDK 155Megs before install.

    I'm starting to play with the sample code and stuff
    but while I have a *lot* of coding exp. (20 years) I mostly work on SQL databases and business apps.

    so for DX I am totaly a beginner.

    though I have played over the years with Gfx stuff like render tools, game mod tools and stuff so I do know the basics like triangles, mesh, 3d space etc...

    but the api calls are new ground.

    any ideas??

    can someone else download this and see what happens?

    perhaps the poster used an earlyer DX drop?
    or in april the managed dx chnaged in a few places??

    I'll try sending a message to Charles -- the poster does not show an email icon so I have no way to ask him.


    code has a comment with a hotmail address... I can try that later!


  • fredm

    My directX version is 9.0c (4.09.0000.0904), and I have the summer 2003 version of the SDK.  I will download the latest SDK and see what I can do to fix the problems. I note that the readme file for the SDK states:

    "The samples do not compile immediately with the Visual Studio 2005 Beta.
    For Beta 1, add the library "libcp.lib" to the ignore library project setting
    (Project Settings / Linker / Input / Ignore Specific Library). For Beta 2, you must
     set "Generate Manifest" (under Linker/Manifest File) to No and "Embed Manifest"
    (under Manifest Tool/Input & Output) to No.

    The DirectX SDK Setup will not add the include or library directories.
     These must be added manually.
    These issues will be resolved when Visual Studio 2005 is officially supported."

    I don't know if this is the cause of the current difficulties.

    I will also get rid of the warnings that popped up when the beta 2 was used for compiling.

    Thanks for the feedback!

  • figuerres

    fredm wrote:

    My directX version is 9.0c (4.09.0000.0904), and I have the summer 2003 version of the SDK.  I will download the latest SDK and see what I can do to fix the problems. I note that the readme file for the SDK states:

    "The samples do not compile immediately with the Visual Studio 2005 Beta.
    For Beta 1, add the library "libcp.lib" to the ignore library project setting
    (Project Settings / Linker / Input / Ignore Specific Library). For Beta 2, you must
     set "Generate Manifest" (under Linker/Manifest File) to No and "Embed Manifest"
    (under Manifest Tool/Input & Output) to No.

    The DirectX SDK Setup will not add the include or library directories.
     These must be added manually.
    These issues will be resolved when Visual Studio 2005 is officially supported."

    I don't know if this is the cause of the current difficulties.

    I will also get rid of the warnings that popped up when the beta 2 was used for compiling.

    Thanks for the feedback!



    hey thanks, I was doing a bunch of things and had not saw the email adress till this morning and had not yet goten to emails you!

    thanks when I get time later I'll check the things you just mentioned....

    I do database stuff all the time but Gfx is just "Hobby time" for me and only when I am done with the paying work Smiley

  • fredm

    I reposted the project zip file. The DirectX and DirectX.Direct3D references should be 1.0.2902.0, the DirectX.Direct3DX should be 1.0.2905.0, which are from the latest DirectX SDK, I believe.

    I commented out the device.Lights[0].Commit() statement. Not clear if the Commit method has been replaced with something else, or just rendered unnecessary in the latest SDK.

    The renderBuffer[i].SetPostion statement was replaced with an assignment statement.  It appears that the SetPosition method was removed and replaced by a get/set accessor in the latest SDK.

    Certain C# V2, beta 1, Forms stuff generated warnings which I have fixed by using the latest Forms tools.

    Probably the project will no longer build under the old DirectX SDK, or beta 1 of C# Express, or VS 2003. But it does seem to build with the latest versions of the above.

    If some MS person has contact with Tom Miller, and if he is working on an update to "Managed DirectX 9 Graphics and Game Programming" (a really helpful book), he should be informed of the code changes required to that book.

  • figuerres

    thanks!

    it runs now so I can start to play with it... Smiley

    I had the feeling that the two chnages you made were the right ideas but was not sure...

  • elwolv

    the code compile on vs2005 pro and current aug 2006 sdk
    a great sample to read the code
    I am new to DX and I am interested in understanding the use of DX cnavas (top) with the controls (buttom of form) on the same Form

    1- I see the click events and understood the oerview flow of the program.
    where is the C# code to build the control slider and buttons?

    2- Initializeomponents ()  is in top of nebFrom.
    where is the function located?  is that where the controls code is located?

    3- I see the render () in the World class.  you are using the FFP for the shader.
    is it possible to rewrite this code to a vertex shader/picel shader 3.0? or this requires from the start layout of the project?

    in oher words:  does the FFP commands can be replaced by equivalnet renamed function to perform shaders function equivalent tasks in shader langauge, which are more envloved,  and also,?

    it would not be 1:1 translation but will the current framework of  nebForm  will take the change to shader?

    or what is I am missing in the difference between shader and FFP

    tahnk you for your comments
    elwolv

  • antimon

    It looks like the download link is broken. Could you please upload it again?

    Thanks.

  • Charles

    antimon said:
    It looks like the download link is broken. Could you please upload it again?

    Thanks.
    http://channel9.msdn.com/Link/f8986154-81d7-4936-b0a3-bf3784f8a832
    C

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.