-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor VoxelData into VoxelDataBytes and VoxelDataColors.
Add support for .qb file animated gifs.
- Loading branch information
Showing
10 changed files
with
72 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using NUnit.Framework; | ||
using System.IO; | ||
|
||
namespace Voxels.Test { | ||
[TestFixture] | ||
public class TestQubicle { | ||
[OneTimeSetUp] | ||
public void SetUp() { | ||
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); | ||
} | ||
|
||
/// <summary> | ||
/// The Nerds.qb is the test file that comes with the Qubicle demo. | ||
/// </summary> | ||
[Test] | ||
public void TestNerds() { | ||
using (var stream = File.OpenRead("Nerds.qb")) { | ||
var qubicle = new QbFile(); | ||
qubicle.Read(stream); | ||
|
||
Assert.AreEqual(257, qubicle.Version); | ||
|
||
var voxelData = qubicle.Flatten(); | ||
|
||
Assert.AreEqual(new XYZ(48,45,44), voxelData.Size); | ||
|
||
Assert.AreEqual(15965, voxelData.Count); | ||
|
||
// Left size speaker foot | ||
Assert.AreEqual(new Color(89, 93, 96), voxelData.ColorOf(XYZ.Zero)); | ||
|
||
// Middle nerd's hair | ||
Assert.AreEqual(new Color(83, 33, 21), voxelData.ColorOf(new XYZ(24, 40, 43))); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters