Created
December 4, 2014 02:56
-
-
Save rikkimax/cd89a84c1ea6eaa28113 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module devisualization.scenegraph.main; | |
import devisualization.scenegraph.scenegraph; | |
import devisualization.scenegraph.elements; | |
void main() { | |
import std.stdio; | |
SceneGraph3DOverlayed2D graph = new SceneGraph3DOverlayed2D; | |
Element aType = Element(0x1CEB00DA, 0xB16B00B5); | |
Element aType2 = Element(0xB16B00B5, 0x1CEB00DA); | |
graph.add(new Element2D(aType, 50f, 50f, 100f, 100f)); | |
graph.add(new Element2D(aType, 0, 0, 50, 50, | |
[new Element2D(aType, 10, 10, 20, 20), | |
new Element2D(aType, 0, 0, 5, 5)])); | |
graph.add(new Element3D(aType2, 50, 50, 50, 100, 100, 100)); | |
graph.add(new Element3D(aType2, 0, 0, 0, 50, 50, 25, | |
[new Element3D(aType2, 10, 10, 10, 20, 20, 11), | |
new Element3D(aType2, 0, 0, 0, 5, 5, 7)])); | |
graph.updateIdHashes(); | |
writeln(graph); | |
graph.draw(); | |
//test(); | |
} |
This file contains hidden or 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
$ ./de_scenegraph_test | |
2D: [ | |
{ type = 485163226 | |
id = 3030912 | |
x = 50 | |
y = 50 | |
width = 100 | |
height = 100 }, | |
{ type = 485163226 | |
id = 3030848 | |
x = 0 | |
y = 0 | |
width = 50 | |
height = 50 }, | |
[ | |
{ type = 485163226 | |
id = 3030784 | |
x = 10 | |
y = 10 | |
width = 20 | |
height = 20 }, | |
{ type = 485163226 | |
id = 3030720 | |
x = 0 | |
y = 0 | |
width = 5 | |
height = 5 } | |
] | |
] | |
3D: [ | |
{ type = 2976579765 | |
id = 3018368 | |
x = 50 | |
y = 50 | |
z = 50 | |
width = 100 | |
height = 100 | |
depth = 100 }, | |
{ type = 2976579765 | |
id = 3018240 | |
x = 0 | |
y = 0 | |
z = 0 | |
width = 50 | |
height = 50 | |
depth = 25 }, | |
[ | |
{ type = 2976579765 | |
id = 3018112 | |
x = 10 | |
y = 10 | |
z = 10 | |
width = 20 | |
height = 20 | |
depth = 11 }, | |
{ type = 2976579765 | |
id = 3017984 | |
x = 0 | |
y = 0 | |
z = 0 | |
width = 5 | |
height = 5 | |
depth = 7 } | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment