Entries:
Posts:

Something went wrong getting user information from Channel 9

Latest Achievement:

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Something went wrong getting the Visual Studio Achievements

# Discussions

• Once I can use it for WPF 4.5 I will start to look into Blend.

• I bought Call Of Duty MW3 from steam recently, the multiplayer is full of cheaters and hackers. That just kills PC gaming for me. I don't want to have to deal with that, on consoles that is almost not existent.

•

(b^2 * t * P1):

b^2 = (3*(1-t))^2 = 9(1-t)^2 instead of 3(1-t)^2

so it should be (3 * a^2 * t * P1) imho

• , Minh wrote

Tokter,

Looking more into it, your routine isn't a direct reflection of this formula:

Can you point me to how you worked that out?

First you get the extended form of your formula http://www.wolframalpha.com/input/?i=%281-t%29%5E3*P0%2B3*%281-t%29%5E2*t*P1%2B3*%281-t%29*t%5E2*P2%2Bt%5E3*P3:

-P0*t^3 + 3*P0*t^2 - 3*P0*t + P0 + 3*P1*t^3 - 6*P1*t^2 + 3*P1*t - 3*P2*t^3 + 3*P2*t^2 + P3*t^3

Then you factorize for t^3, t^2 and t

t^3(-P0 + 3*P1 - 3*P2 + P3) + t^2(3*P0 - 6*P1 + 3*P2) + t(3*P1 - 3* P0) + P0

then you substitute:

c = 3*(P1 - P0)
b = 3*(P2 - P1) - c
a = P3 - P0 - c -b

And you get:

`B(t) = (a * t^3) + (b * t^2) + (c * t) + P0`

• ```        public PointF CubicBezier(float t, PointF p0, PointF p1, PointF p2, PointF p3)
{
float cx = 3 * (p1.X - p0.X);
float bx = 3 * (p2.X - p1.X) - cx;
float ax = p3.X - p0.X - cx - bx;
float cy = 3 * (p1.Y - p0.Y);
float by = 3 * (p2.Y - p1.Y) - cy;
float ay = p3.Y - p0.Y - cy - by;
float tCubed = t * t * t;
float tSquared = t * t;
float resultX = (ax * tCubed) + (bx * tSquared) + (cx * t) + p0.X;
float resultY = (ay * tCubed) + (by * tSquared) + (cy * t) + p0.Y;
return new PointF(resultX, resultY);
}```

• That's how I would do it:

```        private Color ColorLerp(Color a, Color b, float l)
{
return Color.FromArgb(
(int)((float)a.A + ((float)b.A - (float)a.A) * l),
(int)((float)a.R + ((float)b.R - (float)a.R) * l),
(int)((float)a.G + ((float)b.G - (float)a.G) * l),
(int)((float)a.B + ((float)b.B - (float)a.B) * l)
);
}```

• There is nothing new about that riddle

The hotel has \$25 + the mailman has \$2 = \$27 that the friends payed.

• The video is well made, but the iA app looks completely useless to me.

• @spivonious:Nothing has been announced regarding the future of XNA.

• That was really cool, I hope we get that for XNA too!