Creating a simulation using Direct3D

Hello,

I am working on a project to create a simluation of a football (or soccer ball) flight after it has been kicked. This includes velocity, spin, etc in 2D and then 3D.

The software that this needs to intergrate with is written in VC++. Thus the sim needs to be able to access some data/variables from this software.The simulation needs to be embedded within the control software (running on XP Tablet) and automatically displayed rather than a seperate executable.

I have programming experience, but not in Directx, so I am trying to find out whether using Directx is the best option.

Does anyone have any opinions on this Or other programming options. Maybe Java

Thanks in advance.



Answer this question

Creating a simulation using Direct3D

  • koko_han

    Well you have several options of multiple viewports like that.  The two ways that come to mind are rendering each different view to a texture and then rendering the textures on the actual viewport layed out how you want.  You could also use the IDirect3DDevice9::SetViewport function to restrict drawing to a specific part of the window and then draw each view seperately.

  • Peter Stromquist

    Its certainly possible to do in DirectX, however there is an added learning curve of an API and the 3d concepts. If you only need 3 fixed viewpoints as in the example then its probably easier to do using good old GDI with a little bit of 3d knowledge espceially since 2 of the viewpoints are 2d.

    But if you want an arbitrary viewpoint then you will need to use a proper 3d environment like DirectX.

    So display multiple views as you want you can use the SetViewport as Greg mentioned but that only allows you to divide up a single DirectX Control (directx can draw to any window or rectangular control). If you want multiple controls then you need to create multiple devices (easy) or create extra swapchains (best performance - though your app is so lightweight it probably won't matter)

     



  • Jefke

    Well DirectX is certainly up to the task of displaying a football in both 2D and 3D.  As to whether it's the best option depends upon other factors.  What's the control software written in   If you need to have the DX code in the control software then you need to make sure you can access the DX API with the language you're using.  What hardware have you got available, if it's limited you may want to look into a lightweight software renderer in order to gain better performance

  • prasanf

    The control software is written in VC++. Thanks for your answer.

    The image at the link below shows the basic concept I am trying to create (Win32 app):

     http://www.bissy.org/uploaded_images/screen3%20cut.jpg

    My other concern: is it possible to create multiple directx apps like this and embed them all in a single win32 application

    Or, would a better idea be to create a full directx application and split that up into the 3 various still camera views Is that possible

    Sorry if the answers are obvious, but as I said before I have not programmed in directx before and need to find out it's capabilites if I decide to use it.

    Thanks.


  • Steven Somer

    Thanks, GDI would be a good idea for the time being, seeing as yes there are a couple of 2D views.

    Thanks for the help.


  • Creating a simulation using Direct3D