Search This Blog

TopMeny

Showing posts with label DirectX. Show all posts
Showing posts with label DirectX. Show all posts

Thursday, December 13, 2007

DirectX as UserControl in a Windows Form

How to insert a DirectX render-window into a Windows Form application using the DirectX sample framework.
Keywords: DirectX, sample framework, windows form, UserControl.
Download source code and executable
directxasusercontrol.jpg
I found it very hard to find a good example of how to have a DirectX window inside a Windows Form application and still have standard Windows Form controls without making DirectX lock the GUI. I also wanted to use a sample framework application from the DirectX samples.
There is a very good example (CML viewer) of using a DirectX sample framework in a WinForm and I have looked at it a lot when creating this example. Anyway, I wanted to do it my way so I did my own version of it. I also wanted the rendering-loop to be optimal and it actually is in the later versions of the sample framework. It is using the ApplicationIdle-event to render, read more about optimal rendering-loops at Tom Millers blog.
Note that the sample framework is not created to be used like this so you may want to consider creating the DirectX-stuff yourself without the sample framework.
Sometimes the applications has problems at start up, maybe because of the LoaderLock turned off, does anyone have a solution? For LoaderLock problems, see this thread.
I have not put much effort in documentation and super pretty code (all my time goes to my master thesis projekt) but it is an implementation that work and I don´t think it is that hard to understand.

Level set viewer and cloth simulation

Level set viewer, cloth simulation with collision detection against a level set model and a ply-model viewer.

levelseteditor.jpg
This was a project and lab exercises in a course held by Professor Ken Museth. The result of my and my partners work is a Ply-model/Level set/Cloth simulation viewer. In other words, you can open and view ply-models and also save level sets to a ply format. The level set part also gives opportunity to modify the model a little bit (basic boolean operations) as well as viewing different levels, view different resolutions of the model and more. The cloth simulation is a piece of fabric that is created by a transmission line matrix with spring connected to the nodes in different ways. The project is written in C#, .NET 2.0 and DirectX. Please take some time to view the demo videos or download and run the executable.
Note: You must have .NET 2.0 and DirectX 9.0c installed to run the demo executable.

Download demo executable (56 MB)
Download demo video 1 - Ply model (30 MB)
Download demo video 2 - Level set (67 MB)
Download demo video 3 - Cloth simulation on level set model (34 MB)

Data Exploration

Data exploration of house prize data in the Boston region.

infoviz.jpg
This project is created using C#, DirectX and OpenViz. The program shows an information visualization tool that can help the user to explore large amount of data. Normally it can be very hard to understand and find relations in a large data set. By using an information visualization tool the user can confirm relation between variables and also discover new ones. This program uses a scatter chart in a linked combination with a parallel chart and also a 3D parallel chart to view one to one relations between the data set variables. Please view the demo movie or download the project report.
Download demo movie (160 MB)
Download project report (1.5 MB)

Project Sarpedon

A pilot for a multiplayer game using AI for real time battle field simulations of thousands of soldiers.


sarpedon.jpg

This project, called Sarpedon, was a part of a course in 3D and Virtual reality. We were five students in this project and we used C++ and DirectX as programming base.

The idea came from a game idea and the goal was to create a 3D-program that can take a script and then display a battle field scenario for the user. The troops should follow rules given in the script and the soldiers act on AI. The idea of this is to have gamers create strategy for their troops and then meet another player on the battle field. An AI-engine will then calculate the result of the battle in a game. The result will be a script that the user can play and view the battle in real-time. View the demo where two sides meet on the battle field. This simulation is running in real-time from a precompiled script and the soldiers act on real-time AI.
Download demo movie (140 MB)