diff --git a/Release/Skeleton.log b/Release/Skeleton.log index 77e76fe891391892d7a06ede7c5f508fc94b0565..d95954e1ad51b86c40e2df28a24f83066478f1c0 100644 --- a/Release/Skeleton.log +++ b/Release/Skeleton.log @@ -1,14 +1,18 @@ Skeleton.cpp D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\framework.h(167,17): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. -D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(156,1): warning C4305: 'initializing': truncation from 'double' to 'float' -D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(162,83): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data -D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(162,30): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data -D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(165,85): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data -D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(165,30): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data -D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(254,21): warning C4018: '<': signed/unsigned mismatch +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(130,39): warning C4244: 'return': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(158,29): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(163,1): warning C4305: 'initializing': truncation from 'double' to 'float' +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(180,19): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(179,19): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(191,19): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(190,19): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(234,30): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(235,30): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data +D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\Skeleton\Skeleton.cpp(279,21): warning C4018: '<': signed/unsigned mismatch Generating code - 5 of 297 functions ( 1.7%) were compiled, the rest were copied from previous compilation. - 0 functions were new in current compilation - 0 functions had inline decision re-evaluated but remain unchanged + 13 of 295 functions ( 4.4%) were compiled, the rest were copied from previous compilation. + 1 functions were new in current compilation + 23 functions had inline decision re-evaluated but remain unchanged Finished generating code Skeleton.vcxproj -> D:\Grafika\GrafikaHaziCsomag\Programs\Skeleton\bin\Skeleton.exe diff --git a/Release/Skeleton.obj b/Release/Skeleton.obj index be341efcd7d0cf10b5f4d2baf54de03683c9d372..5ef88e1e4eb2a3bfc0efede24bd4f3920cf05823 100644 Binary files a/Release/Skeleton.obj and b/Release/Skeleton.obj differ diff --git a/Release/Skeleton.tlog/Skeleton.write.1u.tlog b/Release/Skeleton.tlog/Skeleton.write.1u.tlog index 115230f67d569a307ea76b2411f6de8606579c4a..185475f4b45d0409a05a9e517a188788419099a0 100644 Binary files a/Release/Skeleton.tlog/Skeleton.write.1u.tlog and b/Release/Skeleton.tlog/Skeleton.write.1u.tlog differ diff --git a/Release/vc142.pdb b/Release/vc142.pdb index 1b400551259cdfa906974de46bf80e1991a2af9e..92328d9bb668c1ee3f76bea048f95fd2eb26e949 100644 Binary files a/Release/vc142.pdb and b/Release/vc142.pdb differ diff --git a/Skeleton.cpp b/Skeleton.cpp index ff6c09c9c05964eca73f9274f6f1d2c417b2719e..781a5516644abb45571ba8af0a2d7eae875625c7 100644 --- a/Skeleton.cpp +++ b/Skeleton.cpp @@ -126,17 +126,20 @@ public: } }; +float degToRad(float courrentTriangleAngle){ + return (courrentTriangleAngle * M_PI / 180.0); +} + class GraphPoint : drawableBase { - //vec3 c; //center of the point in hyperbolic splace + vec3 p3D; //center of the point in hyperbolic splace vec2 p; // center on the base disk public: - GraphPoint() { p = vec2((((float)rand() / (float)(RAND_MAX))*2)-1, (((float)rand() / (float)(RAND_MAX)) * 2) - 1); - + p3D = Vec2ToVec3(p); placeCircleToNewCoordinates(); setColor(Color(244, 164, 96)); } @@ -147,9 +150,13 @@ public: void setCoordinates(vec2 _p) { p = _p; + p3D = Vec2ToVec3(p); placeCircleToNewCoordinates(); } + vec3 Vec2ToVec3(vec2 p) { + return vec3(p.x, p.y, sqrt(p.x * p.x + p.y * p.y + 1)); + } void placeCircleToNewCoordinates() { points.clear(); @@ -157,16 +164,35 @@ public: float courrentTriangleAngle = 0; for (int i = 0; i < BASECIRCLESEG; i++) { - points.push_back(vec2(p.x, p.y)); + points.push_back(vec2(p.x / p3D.z, p.y / p3D.z)); + + + //points.push_back(vec2( + // p3D.x + (cos(degToRad(courrentTriangleAngle)) / 30) * (cos((abs(p3D.x) * abs(p3D.x) * abs(p3D.x)) / 3 + (abs(p3D.x) * abs(p3D.y) * abs(p3D.y)) + abs(p3D.x) * abs(p3D.z) * abs(p3D.z) + abs(p3D.x)) /30 ), + // p3D.y + (sin(degToRad(courrentTriangleAngle)) / 30) * (sin((abs(p3D.y) * abs(p3D.y) * abs(p3D.y)) / 3 + (abs(p3D.y) * abs(p3D.x) * abs(p3D.x)) + abs(p3D.y) * abs(p3D.z) * abs(p3D.z) + abs(p3D.y)) /30 ))); + + //points.push_back(vec2( + // p3D.x + (cos(degToRad(courrentTriangleAngle)) / 20) * (cos(degToRad(90 - abs(1/tan(8 * p3D.x + 8 * p3D.y - 8 * p3D.z))))), + // p3D.y + (sin(degToRad(courrentTriangleAngle)) / 20) * (sin(degToRad(90 - abs(1/tan(8 * p3D.x + 8 * p3D.y - 8 * p3D.z))))))); + + points.push_back(vec2( + p3D.x / p3D.z + (cos(degToRad(courrentTriangleAngle)) / 20) / p3D.z, + p3D.y / p3D.z + (sin(degToRad(courrentTriangleAngle)) / 20) / p3D.z)); + + + //printf("%f \n", abs(1 / tan(2 * p3D.x + 2 * p3D.y - 2 * p3D.z))); + // points.push_back(vec2(p.x +(cos(courrentTriangleAngle * M_PI / 180.0) /30),p.y + (sin(courrentTriangleAngle * M_PI / 180.0) /30))); alap volt ami kort rajzolt a pontokba - points.push_back(vec2(p.x +(cos(courrentTriangleAngle * M_PI / 180.0) /30),p.y + (sin(courrentTriangleAngle * M_PI / 180.0) /30))); courrentTriangleAngle += piece; - points.push_back(vec2(p.x + (cos(courrentTriangleAngle * M_PI / 180.0) /30), p.y + (sin(courrentTriangleAngle * M_PI / 180.0)/30))); + + points.push_back(vec2( + p3D.x / p3D.z + (cos(degToRad(courrentTriangleAngle)) / 20) / p3D.z, + p3D.y / p3D.z + (sin(degToRad(courrentTriangleAngle)) / 20) / p3D.z)); + } } - vec2 vec3tovec2(vec3 c) { vec2 temp; temp.x = c.x; @@ -183,7 +209,6 @@ public: color = newColor; } - void draw() override { init(); @@ -206,8 +231,8 @@ class Line : drawableBase { public: Line(vec2 _p1, vec2 _p2) { setColor(Color(254, 254, 0)); - points.push_back(_p1); - points.push_back(_p2); + points.push_back(_p1 / sqrt(_p1.x * _p1.x + _p1.y * _p1.y + 1)); + points.push_back(_p2 / sqrt(_p2.x * _p2.x + _p2.y * _p2.y + 1)); } void reColor() const {