diff options
author | jonas <himself@jonasgunz.de> | 2019-01-14 17:30:06 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2019-01-14 17:30:06 +0100 |
commit | 60ea1ae7257d60d3ee05f1b9d412a1bd441db7cb (patch) | |
tree | 819063addd6b1abf972adea2e49a83299280c9b2 /cWiremesh.cpp | |
parent | 5d0b6dd79722707afb15642cc8523b36a6391e0d (diff) | |
download | termgl-60ea1ae7257d60d3ee05f1b9d412a1bd441db7cb.tar.gz |
RTFM!! Error resulted in illegal coordiante pair for drawLine (x2 > x1)
Diffstat (limited to 'cWiremesh.cpp')
-rw-r--r-- | cWiremesh.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/cWiremesh.cpp b/cWiremesh.cpp index f21b1d0..f15c0d8 100644 --- a/cWiremesh.cpp +++ b/cWiremesh.cpp @@ -17,7 +17,7 @@ void cWiremesh::addVector(sCoord3d _origin, sCoord3d _vector, char _char, WORD _ void cWiremesh::rotate(sCoord3d _val) { - + //Implement rotate } void cWiremesh::reset() @@ -39,6 +39,9 @@ void cWiremesh::write(cRender *_render) translate(vectors[i].origin + position, origin), translate(vectors[i].origin + vectors[i].direction + position, origin), true, vectors[i].color); + + /*_render->drawPoint(vectors[i].c, translate(vectors[i].origin + position, origin), true, vectors[i].color); + _render->drawPoint(vectors[i].c, translate(vectors[i].origin + vectors[i].direction + position, origin), true, vectors[i].color);*/ } } @@ -46,8 +49,16 @@ sPos cWiremesh::translate(sCoord3d _coord, sCoord3d _origin) { sPos ret; - ret.x = (int)((float)_coord.x - ((float)_coord.z / (float)_DEPTH * (float)(_coord.x - _origin.x))); - ret.y = (int)((float)_coord.y - ((float)_coord.z / (float)_DEPTH * (float)(_coord.y - _origin.y))); + sCoord3d coord; + coord.x = _coord.x - _origin.x; + coord.y = _coord.y - _origin.y; + coord.z = _coord.z - _origin.z; + + ret.x = (int)((float)coord.x - ((float)coord.z / (float)_DEPTH * (float)(coord.x))); + ret.y = (int)((float)coord.y - ((float)coord.z / (float)_DEPTH * (float)(coord.y))); + + ret.x += _origin.x; + ret.y += _origin.y; return ret; } @@ -66,3 +77,8 @@ void cWiremesh::setPosition(sCoord3d _pos) { position = _pos; } + +void cWiremesh::scale(int _scalar) +{ + //Implement Scale +} |