Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dauid

Member Since 15 Jan 2009
Offline Last Active Nov 03 2012 08:43 AM

Posts I've Made

In Topic: C# SDL.NET Surfaceblitting

28 July 2010 - 12:08 AM

Solved this myself with this code:

Surface imageMap = new Surface("imageMap.png");
Color[,] imageMapColors = imageMap.GetColors(new Rectangle(0,0,imageMap.Width,imageMap.Height));
Surface clipped = new Surface(width,height).Convert(imageMap,true,true);
Color[,] newColors = new Color[width,height];

//Copy the portion (width,height) from imageMapColors to newColors

clipped.SetPixels(new Point(), newColors);


Voila

In Topic: [.net] .NET Math library acting wierd

01 July 2010 - 09:53 PM

http://support.microsoft.com/kb/214118

In Topic: [.net] .NET Math library acting wierd

01 July 2010 - 12:52 PM

Quote:
Original post by bubu LV
6,1257422745431E-17 is the same as 6,1257422745431 * 10^(-17).
And 10^(-17) = 0.00000000000000001. So basically it is zero.


yes but basically zero doesnt return true on 6,1257422745431 * 10^(-17) == 0 statement.

this problem has returned and this time I'm at a loss.
The problem is probably in the trigonometric functions of the math library.

ex. code:
Console.WriteLine("{0:e}\n{0:e}\n{0:e}",x1,x2,x1+x2);

Output:
1,000000e+000
-1,000000e+000
-2,22044604925031E-16

bleh

In Topic: [.net] .NET Math library acting wierd

23 June 2010 - 03:22 AM

I solved this by defining PI myself using the Atan2-function. And use my selfdefined PI instead of the predefined in the .NET Math-class


In Topic: Winsock problem

02 February 2009 - 04:17 AM

I see,

so to solve my problem of the client getting the updated data from the server is to constrain the pace of sending the data and process it as fast as possible on the client. Ignoring any receptiondelays on the client.

Thanks again and that article you posted seems really useful!

PARTNERS