3D model generation and rendering with XNA

The third program I have just finished on my C# study is a little XNA program, which renders a given 3D-model with a texture. You can define the camera position and you can rotate the world. I also developped four models with can be switched via shortcut, so you can only see one model a time. There are some more shortcuts available:

  • F1: Show 1. model
  • F2: Show 2. model
  • F3: Show 3. model
  • F4: Show 4. model
  • F5: Delete one horizontal division
  • F6: Add one horizontal division
  • F7: Delete one vertical division
  • F8: Add one horizontal division
  • F12: Reset the configuration
  • Arrow-Keys: Move the camera position (X/Y)
  • NUM+ and NUM-: Move the camera position (Z)
  • SHIFT-Keys: Accelerate the movement and divisions by 10
  • Left-Mouse-Down: Rotation the view
  • Right-Mouse-Key: Change the fill mode

The models I implemented are:

  1. Rectangle with TriangleList
  2. Rectangle with TriangleStrip
  3. Tube
  4. Torus

Okay, the first two are not really 3D-models, but it was the starting point that I had to start with and they are really cool, aren’t they? ;-) All models must be dividable, that means, you can dynamically change the number of subdivision in X/Y direction. After the rectangles I started to build a tube and after the tube I finally worked out on a torus. To implement the torus I worked with the formular given on Wikipedia and iterated over two times PI.

I cannot give you too much details here, because other student may work on their programs for that and I don’t want them to simple copy my results. But if you are interested on these implementations just let me know and I will give more detail later on. :-)

If you would like to test the application, feel free to download the BasicModels installer right here.

Have fun!

Tagged with:  

3D-Matrix-Transformations

Stepping deeper into C#, my second task was to build a little program to visualize matrix transformations in 3D domains.

There were several difficulties like how to set up the properties of the matrices to show up the 3D object within the viewarea. Finally I added a demo button that shows up some examples.

Transformationsmatrizen

If you like to test it, feel free to download the Transformationsmatrizen Setup.

Enjoy! :-)

Tagged with:  

First Steps in C#

After all that years of Java coding I need to do some little graphics programming with Visual Studio 2008 Express with C#. I must said that C# has been pretty copied from Java with some influence of other languages. But more or less I would said it is Microsoft’s Clone of the Java Programming language. Maybe that’s why I somehow like it. ;-)

Well I need to do some things for university studies. Our first task was to build a little vector calculator that can do some easy vector stuff and visualize them. After some lines of codes, some more lines of codes and some lines that have been deleted… here it is:

Vector Calculator

If you have Windows running you can also run the calculator yourself. Just download the vector calculator ZIP archive and have fun with it. :-)

Tagged with:  
Page 4 of 41234

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

© 2009-2010 Stefan Bechtold