www.computer-horror.co.cc

XNA – TriangleStrip

leave a comment »

xna_logo

The idea behind TriangleStrips is that you should define each vertex only once. So for the first triangle, you have to define vertices 0,1 and 2. Now, for the next triangle, you only have to add vertex 3, XNA will always use the last 3 vertices to draw the triangle, so for the second triangle it uses vertices 1, 2 and 3, which is correct.

Untitled

Read the rest of this entry »

Written by azer89

August 9, 2009 at 4:30 pm

Posted in C#, Game Programming, Programming, XNA

Tagged with , ,

C# Preprocessor

leave a comment »

These commands never translated and included into the executable file but these are very useful for compilation process. Using preprocessors, we can stop the compiler from compiling certain potion of code. This is very helpful in the situation where you are planning to release two versions of software one basic version which has less features and one advance version which has more features. The preprocessor directives are all starts with the # symbol in the beginning of them.

C# actually has almost all the standard preprocessor directives – it just happens to be that the functionality of some of them . The one notable directive that is missing is #include – and it makes sense that C# wouldn’t have it, because C# gets the same sort of functionality from the using statements (although there is the fact that #include refers to files and using refers to assemblies – so they are definitely not equivalent).

Rules

  1. Preprocessor directives must be on separate line
  2. Must not terminate with semicolon compared to normal C# statements
  3. Starts with # character
  4. End of line comments are not allowed
  5. Delimited comments are not allowed

blog

Read the rest of this entry »

Written by azer89

August 1, 2009 at 12:08 am

Posted in C#, Programming

Tagged with , ,

XNA – Quaternion

leave a comment »

xna_logo

The XNA Framework provides the Quaternion structure to represent and calculate the efficient rotation about a vector around a specified angle. Quaternions represent a rotation. Typically, they are used for smooth interpolation between two angles, and for avoiding the gimbal lock problem that can occur with euler angles.

A Quaternion is much like a Matrix, but can only store a rotation. Don’t let the name of this thing scare you away (for first time i hear it, i thinks it is a weird planet’s name :D ), although it’s very hard to understand mathematically (it makes my head blown away) a quaternion is VERY very easy to use.

Untitled

In this tutorial, we will create a simple example program using quaternion, we will draw a spacecraft and it would be flying through 3D world.

Read the rest of this entry »

Written by azer89

July 24, 2009 at 11:27 pm

Posted in C#, Game Programming, Programming, XNA

Tagged with , ,

Linux Mint 7 Video Installation

leave a comment »

linuxmint7logo

Just a video about Linux Mint 7 Installation.

Well, Linux Mint 7 is a great Distro :)

Written by azer89

July 19, 2009 at 11:30 pm

XNA – Camera Rotation

leave a comment »

xna_logo

In this article, we will create a simple XNA program that load a 3D model, and rotating the camera around the model. In this example,  showing how to moving your camera position around the model. Camera target and camera up vector will remain same, what we need is to change camera position vector.

Untitled

Read the rest of this entry »

Written by azer89

July 19, 2009 at 9:34 pm

Posted in C#, Game Programming, Programming, XNA

Tagged with , ,

XNA – Using Effect

leave a comment »

xna_logo

The XNA Content Pipeline is pretty good. It implifies the process for importing and loading models, textures, and other content. Unfortunately, it is optimized for loading data, not code. Effect files are essentially code, so an alternative approach could provide additional benefits.

Like the XNA Content Pipeline, Effect Generator compiles your .fx files at build time, reducing game load times. Additionally, Effect Generator further simplifies run-time loading and effect parameterization.

Place your effect file in Content folder :

Untitled


We start by declaring an Effect:

Effect effect;


We’ll use the Content pipeline to load an instance of the Effect class:

effect = Content.Load<effect>("effects");


And render using the effect:

effect.CurrentTechnique = effect.Techniques["Pretransformed"];
effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
    pass.Begin();

    pass.End();
}
effect.End();

Read the rest of this entry »

Written by azer89

July 19, 2009 at 9:55 am

Posted in C#, Game Programming, Programming, XNA

Tagged with , ,

XNA – Set Up Camera

with one comment

xna_logo

Before we render 3D world, we need set up camera. We do this by specifying the View and Projection matrices. Before rendering, both matrices are needed so the graphics card can correctly transform 3D world to 2D screen in our monitor.

Setting up camera in 3D world comes down to specifying two matrices. We can save the camera position and direction in a single matrix, which is called the View matrix. To create the View matrix, XNA needs to know the Position, Targer, and Up vector of camera. We can also save the view frustum, which is the part of the 3D world that is actually seen by the camera, in another matrix, which is called the Projection matrix.

Untitled

Read the rest of this entry »

Written by azer89

July 18, 2009 at 11:44 pm

Posted in C#, Programming, XNA

Tagged with , ,

Enable Ping Replies From Win Server 2008

leave a comment »

windows2008logoas2

Windows Firewall in Windows Server 2008 has very tight security. For default, ping to Windows Server 2008 won’t get any response. Here’s the configuration to enable ping replies :

Goto Window Firewall with Advance Settings from Administrator Tools menu.

Untitled1

Look into list in the left and Click Inbound Rules

Right click File and Sharing (Echo Request – ICMPv4-In) and choose Enable Rule

Untitled2

Do same thing to Distributed Transaction Coordinator (TCP-In)

Untitled3

Okay, now you can ping your server machine :D

Written by azer89

July 17, 2009 at 5:29 pm

Posted in Computer Networking

Tagged with ,

Moonlight – Open Source Implementation for Silverlight

with 2 comments

moonlight_logo

What is Moonlight ?

Moonlight is an open source implementation of Silverlight (http://silverlight.net), primarily for Linux and other Unix/X11 based operating systems. In September of 2007, Microsoft and Novell announced a technical collaboration that includes access to Microsoft’s test suites for Silverlight and the distribution of a Media Pack for Linux users that will contain licensed media codecs for video and audio.

I tested it in Linux Mint 7 and it works fine with Silverlight 1.0 website. The bad thing, it not works in Silverlight 2.0 :/

Screenshot-The Official Microsoft Silverlight Site - Mozilla Firefox

Screenshot

Screenshot-1

Next Release ?

Moonlight 2.0 still in Preview Release, this version will be compatible with Silverlight 2.0

Minimum Requirements…

An x86 or x86-64 computer with at least 128 megs of RAM to use Moonlight, Firefox 2.0 or Firefox 3.0.

Links :
http://silverlight.net
http://mono-project.com/Moonlight
http://go-mono.com/moonlight-preview/

Written by azer89

July 15, 2009 at 10:51 pm

XNA – Load 3D Model

leave a comment »

xna_logo

here’s the screenshot (click image for larger view):

one two

three four

five six

Read the rest of this entry »

Written by azer89

July 11, 2009 at 12:24 pm

Posted in C#, Programming, XNA

Tagged with , , ,