aboutsummaryrefslogtreecommitdiff
path: root/cObject3D.h
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-01-12 01:00:56 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-01-12 01:00:56 +0100
commit91e4ffec239c198c9c4652dc50812165813fe79f (patch)
tree0f85ceedb3c2edac68ab34b8b5baaf903ce28935 /cObject3D.h
parentbdce9a52170f1a3535c290a379e4cb9f509614ec (diff)
downloadtermgl-91e4ffec239c198c9c4652dc50812165813fe79f.tar.gz
cObject3D should displaya wiremesh of Object composed of vectors
Diffstat (limited to 'cObject3D.h')
-rw-r--r--cObject3D.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/cObject3D.h b/cObject3D.h
new file mode 100644
index 0000000..481b9a1
--- /dev/null
+++ b/cObject3D.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#include <vector>
+
+#include "cObject.h"
+
+#define _DEPTH 50
+
+struct sCoord3d
+{
+ int x;
+ int y;
+ int z;
+};
+
+struct sVector
+{
+ sCoord3d origin;
+ sCoord3d direction;
+
+ char c;
+ WORD color;
+};
+
+class cObject3D : cObject
+{
+public:
+
+ cObject3D(unsigned int _sx, unsigned int _sy);
+
+ virtual ~cObject3D();
+
+ void addVector(sCoord3d _origin, sCoord3d _vector, char _char, WORD _color);
+
+ void rotate(sCoord3d _val);
+
+ void reset();
+
+ void write();
+
+protected:
+
+ cObject3D(){}
+
+private:
+
+ sPos translate(sCoord3d _coord);
+
+ std::vector<sVector> vectors;
+};