Posts Tagged ‘Programming’

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 [...]

C# Preprocessor

Posted: August 1, 2009 in C#, Programming
Tags: , ,

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 [...]

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, [...]

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.

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 [...]

XNA – Set Up Camera

Posted: July 18, 2009 in C#, Programming, XNA
Tags: , ,

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 [...]

XNA – Load 3D Model

Posted: July 11, 2009 in C#, Programming, XNA
Tags: , , ,

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

XNA – Draw Text

Posted: July 11, 2009 in C#, Programming, XNA
Tags: , ,

Another simple example, how to draw a text in XNA =D Demonstrates how to import a SpriteFont into a project and draw text using DrawString.

XNA – Displaying Cursor

Posted: July 8, 2009 in C#, Programming, XNA
Tags: , ,

XNA doesn’t automatically show a mouse pointer within the game window. First, you need a position for your mouse. You’ll also need a 2d texture to display as your mouse pointer It’s very simple, just load a png image, and displaying it using spriteBatch.Draw(); Of course, we always keep track the mouse position =]

Socket adalah sebuah cara untuk berkomunikasi dengan program atau node lain menggunakan file deskriptor. Di UNIX (dimana socket diciptakan) kita sering mendengar slogan: “everything is a file”, jadi untuk berkomunikasi dengan program atau node lain semudah kita membaca dan menulis file deskriptor. Antarmuka socket dan file adalah mirip, jika pada file kita membukanya dengan open() [...]