Bug in Spatial-wireframe example code

Supporting Visual Studio on Windows
frodegill
Phidget Mastermind
Posts: 114
Joined: Thu Mar 04, 2010 2:51 am
Contact:

Bug in Spatial-wireframe example code

Postby frodegill » Fri Jun 03, 2011 4:28 pm

Spatial-wireframe will not work out of the box for me. It tries to read objects from a file. In the files, '.' is used as decimal separator, but the code uses Double.Parse(string) (that is, using system default cultureinfo, and for my system, that means ',' is expected decimal separator)
I had to change ObjLoader.cs, replacing Double.Parse(a[1]) with Double.Parse(a[1], CultureInfo.InvariantCulture) for all Double.Parse, and add using System.Globalization.

User avatar
Patrick
Lead Developer
Posts: 3158
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Bug in Spatial-wireframe example code

Postby Patrick » Mon Jun 06, 2011 9:27 am

I have to admit that I was ignorant of the comma being used as a decimal mark! I'll apply the fixes you mentioned to the program, and thanks for bringing this up.

-Patrick


Return to “C#.NET”

Who is online

Users browsing this forum: No registered users and 3 guests