Articles about c#’

Dec 8, 2009

Book Review: Unity Game Development Essentials

Posted by Dennis in 3D 1 comment

Flash offers a lot of cool features to play with. The last few years we’ve seen an abundance of 3D engines which have all been optimised to run on a very limited platform. The results are very impressive and have spawned many ground breaking and visually stunning online experiences.
Despite all this many developers are frustrated [...]


Apr 2, 2009

Using an Alchemy generated texture on a 3D object

Posted by Dennis in 3D, ActionScript, Flash 6 comments

Here’s how a texture that is generated by Alchemy can be used by a 3D engine like Sandy.
Watch the example here.
The C code:

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include “AS3.h”

int* palette;
int* plasma;
int* newPlasma;
int width;
int height;

AS3_Val generatePlasma(void* self, AS3_Val args)
{
int x, y, r, g, b, index;

AS3_ArrayValue(args, “IntType, IntType”, &width, &height);

palette = malloc(256 * sizeof(int));
plasma = malloc(width * height [...]


Mar 12, 2008

Programmatic drawing with Silverlight 2 Part 3: Simple Animation

Posted by Dennis in Uncategorized 6 comments

This example shows you how you can make a simple line animation in Silverlight 2. There isn’t much documentation about this yet, so it took some figuring out on how to do this correctly.
Basically these are the steps to create an animation:

Create a Storyboard object
Set the Storyboard’s Duration property
Create a DoubleAnimation object
Set the DoubleAnimation object’s [...]


Mar 4, 2008

Silverlight 2 Beta 1 C# Truchet Tiling

Posted by Dennis in Uncategorized 4 comments

Truchet Tiling is an easy way of creating random patterns. See what it looks like here.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Truchet3
{
public partial class Page : UserControl
{
public Page()
[...]


Mar 3, 2008

Programmatic drawing with Silverlight Part 2: C#

Posted by Dennis in Uncategorized 6 comments

In one of my previous posts I explored how programmatic drawing with Silverlight 1.0/JavaScript worked. It was done by constructing a XAML string and inserting it into the XAML hierarchy. Not a nice way of doing things, imho.
Fortunately Silverlight 1.1 alpha offers the possibility to use C#. This way there’s no need to construct strings [...]


Feb 25, 2008

Tweening Silverlight with JSTweener

Posted by Dennis in Uncategorized 5 comments

I do most of my ActionScript tweening with the easy-to-use Tweener class. Tweener has been ported to JavaScript so that means it can be used with Silverlight 1.0. This port is called JSTweener and its syntax is identical with Tweener for ActionScript.
The most basic tweening example looks like this:

JSTweener.addTween( myObject, { x: 30, y: 30, [...]