antispam-bee domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/ruwritingagame/public_html/wp-includes/functions.php on line 6131\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043f\u043e\u0440\u0430 \u0443\u0436\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0433\u0434\u0435 \u0436\u0435 \u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 3D \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u041f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0442\u0430\u043a\u0438\u0435:<\/p>\n\n\n\n
\u0412\u043e\u0431\u0449\u0435\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 – \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e<\/em>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433.<\/p>\n\n\n\n 1. \u0412 Windows File Explorer<\/strong>-\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 C:\\CPP\\engine<\/em> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u0434-\u043a\u0430\u0442\u0430\u043b\u043e\u0433 modeler<\/strong>.<\/p>\n\n\n\n 2. \u041f\u0440\u043e\u0439\u0434\u0435\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 C:\\CPP<\/em> . \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 a998engine <\/em>\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u0435\u0435 \u0432 a997modeler<\/strong>.<\/p>\n\n\n\n 3. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c VS. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a997modeler<\/strong>\\p_windows\\p_windows.sln<\/em>.<\/p>\n\n\n\n \u041f\u043e\u0434 xEngine <\/em>(right-click \u043d\u0430 xEngine <\/em>) \u0434\u043e\u0431\u0430\u0432\u0438\u043c New Filter<\/strong>, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e modeler<\/strong>.<\/p>\n\n\n\n 4. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433: <\/p>\n\n\n\n \u041e\u0442\u043a\u0440\u043e\u0435\u043c p_windows<\/em> project Properties. All Configurations \/ Active(Win32), <\/p>\n\n\n\n C\/C++ -> General -> Additional Include Directories -> Edit<\/em>, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, <\/p>\n\n\n\n \u0438\u0434\u0435\u043c \u0432 C:\\CPP\\engine\\modeler<\/em>, <\/p>\n\n\n\n Select Folder, Ok, Apply, Ok.<\/p>\n\n\n\n \u0418\u0434\u0435\u044f “modeler-\u0430” – \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043e\u0432 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0438\u0445 \u0432 VBO, EBO, VAO, \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 – \u0432 DrawJobs.<\/p>\n\n\n\n 5. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, Vertex01<\/strong>. \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043e-\u0444\u0430\u0439\u043b\u043e\u0432\u043e:<\/p>\n\n\n\n \u041f\u043e\u0434 modeler <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header \u0444\u0430\u0439\u043b Vertex01.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine\\modeler<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n \u041d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 “\u043b\u0438\u0448\u043d\u0438\u0435” \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u0438\u0445 \u043f\u043e\u043f\u043e\u0437\u0436\u0435, \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0424\u0430\u0439\u043b cpp <\/em>\u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d.<\/p>\n\n\n\n \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b (EBO) \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432, \u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0434\u043b\u044f \u043d\u0438\u0445.<\/p>\n\n\n\n 6. \u041f\u043e\u0434 modeler <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header \u0444\u0430\u0439\u043b Triangle01.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine\\modeler<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 “\u043b\u0438\u0448\u043d\u0438\u0435” \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0431\u044d\u044f\u0441\u043d\u044e \u0438\u0445 \u043f\u043e\u043f\u043e\u0437\u0436\u0435, \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0424\u0430\u0439\u043b cpp <\/em>\u0442\u043e\u0436\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. <\/p>\n\n\n\n \u0415\u0449\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u0433\u0440\u0443\u043f\u043f <\/strong>\u0432\u0435\u0440\u0448\u0438\u043d\/\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439.<\/p>\n\n\n\n 7, \u041f\u043e\u0434 modeler <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header \u0444\u0430\u0439\u043b Group01.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine\\modeler<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u0433\u0434\u0435 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f<\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 “to” \u0442\u0443\u0442 \u043d\u0435\u0442.<\/p>\n\n\n\n \u0415\u0449\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c (descriptor), \u0447\u0442\u043e (\u043a\u0430\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443\/shape) \u043c\u044b \u0440\u0438\u0441\u0443\u0435\u043c\/\u0441\u0442\u0440\u043e\u0438\u043c. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e VirtualShape<\/strong>. “Virtual” \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0430\u043c-\u043f\u043e-\u0441\u0435\u0431\u0435 \u0432\u0435\u0440\u0448\u0438\u043d \u043e\u043d \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n\n\n\n 8. \u041f\u043e\u0434 modeler <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header \u0444\u0430\u0439\u043b VirtualShape.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine\\modeler<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\/\u043a\u043e\u043c\u0430\u043d\u0434\u0430 modeler<\/em>-\u0430 \u0431\u0443\u0434\u0435\u0442 buildFace()<\/em> – \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0430\u0436\u0435\u043c, “\u043d\u0430 \u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 VirtualShape<\/em>“. \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 4 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u0430 \u043d\u0430 \u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b (\u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 – \u043a\u0443\u0431\u0438\u043a\u0430 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 whl<\/em>) \u0438 2 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 (6 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432).<\/p>\n\n\n\n \u0412\u044b\u043d\u0435\u0441\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0431\u043e\u0440 utils<\/strong>.<\/p>\n\n\n\n 9. \u041e\u0442\u043a\u0440\u043e\u0435\u043c utils.h<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 10. \u041e\u0442\u043a\u0440\u043e\u0435\u043c utils.cpp \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n \u042d\u0442\u0430 \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f mat4x4_mul_vec4plus()<\/em> – \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443. \u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 linmath <\/em>\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0432 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440, \u043f\u043b\u044e\u0441 \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 4-\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u0435. \u0415\u0441\u043b\u0438 \u0432 \u043d\u043e\u043b\u044c, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442, \u0431\u0435\u0437 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u0435\u0439<\/em> \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440).<\/p>\n\n\n\n \u0412 DrawJob<\/strong> \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/p>\n\n\n\n 11. \u041e\u0442\u043a\u0440\u043e\u0435\u043c DrawJob.h<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n \u041d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f setDesirableOffsets(..<\/em>)<\/em> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 DrawJob<\/em> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 (AttribRef<\/em> \u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f aPos<\/em> \u0438 aTuv<\/em>, \u043f\u043e\u0437\u0436\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435).<\/p>\n\n\n\n 12. \u041e\u0442\u043a\u0440\u043e\u0435\u043c DrawJob.cpp<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430: <\/p>\n\n\n <\/p>\n\n\n\n \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442…<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043f\u043e\u0440\u0430 \u0443\u0436\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0433\u0434\u0435 \u0436\u0435 \u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 3D \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u041f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0442\u0430\u043a\u0438\u0435: Web. \u0428\u0438\u0440\u043e\u043a\u0438\u0439 \u0432\u044b\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u043e\u0442 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 3D \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u043e\u0432 \u0438 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439. \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 – \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435. \u0421\u0430\u043c\u0438\u043c \u043e\u0441\u0432\u043e\u0438\u0442\u044c Blender, Maya, 3Ds Max \u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e 3D \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u041e\u0413\u0420\u041e\u041c\u041d\u0410\u042f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0430\u043c\u0430-\u043f\u043e-\u0441\u0435\u0431\u0435. \u041a\u0430\u043a-\u0442\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0449\u0443\u0449\u0430\u044e \u0441\u0435\u0431\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e. \u041d\u0430\u0439\u0442\u0438 3\u0414 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-cross-platform-3d"],"_links":{"self":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/comments?post=546"}],"version-history":[{"count":16,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":1658,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/546\/revisions\/1658"}],"wp:attachment":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/media?parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/categories?post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/tags?post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\n\n\n
\n\n\n\n
\n\n\n\n
\n\n\n\n\n#pragma once\n\nclass Vertex01\n{\npublic:\n\tint subjN = -1; \/\/game subject number\n\tint materialN = -1; \/\/material number\n\tint flag = 0;\n\tint endOfSequence = 0; \/\/for sequentional (unindexed) primitives (like GL_LINE_STRIP for example)\n\tint altN = -1; \/\/vertex' position in alternative array\n\t\/\/atributes\n\tfloat aPos[4] = { 0,0,0,0 }; \/\/position x,y,z + 4-th float for matrix operations\n\tfloat aNormal[4] = { 0,0,0,0 }; \/\/normal (surface reflection vector) x,y,z + 4-th float for matrix operations\n\tfloat aTuv[2] = { 0,0 }; \/\/2D texture coordinates\n\tfloat aTuv2[2] = { 0,0 }; \/\/for normal maps\n\t\/\/tangent space (for normal maps)\n\tfloat aTangent[3] = { 0,0,0 };\n\tfloat aBinormal[3] = { 0,0,0 };\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n\nclass Triangle01\n{\npublic:\n\tint subjN = -1; \/\/game subject number\n\tint materialN = -1; \/\/material number\n\tint flag = 0;\n\tint idx[3] = { 0,0,0 }; \/\/3 vertex indices\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n\nclass Group01\n{\npublic:\n\tint fromVertexN = 0;\n\tint fromTriangleN = 0;\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n#include <string>\n\nclass VirtualShape\n{\npublic:\n\tstd::string type = "box";\n\tfloat whl[3] = { 0 }; \/\/width\/height\/length (x,y,z sizes\/dimensions)\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n#include <string>\n#include "linmath.h"\n\nint checkGLerrors(std::string ref);\nvoid mat4x4_mul_vec4plus(vec4 vOut, mat4x4 M, vec4 vIn, int v3);\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "utils.h"\n#include "platform.h"\n\nint checkGLerrors(std::string ref) {\n \/\/can be used after any GL call\n int res = glGetError();\n if (res == 0)\n return 0;\n std::string errCode;\n switch (res) {\n \/\/case GL_NO_ERROR: errCode = "GL_NO_ERROR"; break;\n case GL_INVALID_ENUM: errCode = "GL_INVALID_ENUM"; break;\n case GL_INVALID_VALUE: errCode = "GL_INVALID_VALUE"; break;\n case GL_INVALID_OPERATION: errCode = "GL_INVALID_OPERATION"; break;\n case GL_INVALID_FRAMEBUFFER_OPERATION: errCode = "GL_INVALID_FRAMEBUFFER_OPERATION"; break;\n case GL_OUT_OF_MEMORY: errCode = "GL_OUT_OF_MEMORY"; break;\n default: errCode = "??"; break;\n }\n mylog("GL ERROR %d-%s in %s\\n", res, errCode.c_str(), ref.c_str());\n return -1;\n}\nvoid mat4x4_mul_vec4plus(vec4 vOut, mat4x4 M, vec4 vIn, int v3) {\n vec4 v2;\n if (vOut == vIn) {\n memcpy(&v2, vIn, sizeof(vec4));\n vIn = v2;\n }\n vIn[3] = (float)v3;\n mat4x4_mul_vec4(vOut, M, vIn);\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n#include "Material.h"\n#include <vector>\n\nstruct AttribRef \/\/attribute reference\/description\n{\n\tunsigned int glVBOid = 0; \/\/buffer object id\n\tint offset = 0; \/\/variable's offset inside of VBO's element\n\tint stride = 0; \/\/Buffer's element size in bytes\n};\n\nclass DrawJob\n{\npublic:\n\tMaterial mt;\n\tint pointsN = 0; \/\/N of points to draw\n\tunsigned int glVAOid = 0; \/\/will hold data stream attributes mapping\/positions\n\tunsigned int glEBOid = 0; \/\/Element Buffer Object (vertex indices)\n\n\t\/\/common attributes\n\tAttribRef aPos;\n\tAttribRef aTuv;\n\n\t\/\/static arrays (vectors) of all loaded DrawJobs, VBO ids\n\tstatic std::vector<DrawJob*> drawJobs;\n\tstatic std::vector<unsigned int> buffersIds;\npublic:\n\tDrawJob();\n\tvirtual ~DrawJob(); \/\/destructor\n\tstatic int cleanUp();\n\tstatic int newBufferId();\n\tint buildVAO() { return buildVAOforShader(this, mt.shaderN); };\n\tstatic int buildVAOforShader(DrawJob* pDJ, int shaderN);\n\tstatic int attachAttribute(int varLocationInShader, int attributeSizeInFloats, AttribRef* pAttribRef);\n\n\tvirtual int setDesirableOffsets(int* pStride, int shaderN, int VBOid) { return setDesirableOffsetsForSingleVBO(this, pStride, shaderN, VBOid); };\n\tstatic int setDesirableOffsetsForSingleVBO(DrawJob* pDJ, int* pStride, int shaderN, int VBOid);\n\n\tint execute(float* uMVP, Material* pMt) { return executeDrawJob(this, uMVP, pMt); };\n\tstatic int executeDrawJob(DrawJob* pDJ, float* uMVP, Material* pMt);\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "DrawJob.h"\n#include "platform.h"\n#include "utils.h"\n#include "Shader.h"\n#include "Texture.h"\n\n\/\/static arrays (vectors) of all loaded DrawJobs, VBO ids\nstd::vector<DrawJob*> DrawJob::drawJobs;\nstd::vector<unsigned int> DrawJob::buffersIds;\n\nDrawJob::DrawJob() {\n\tdrawJobs.push_back(this);\n}\nDrawJob::~DrawJob() {\n\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\tif (glVAOid > 0)\n\t\tglDeleteVertexArrays(1, &glVAOid);\n}\nint DrawJob::newBufferId() {\n\tunsigned int bufferId;\n\tglGenBuffers(1, &bufferId);\n\tbuffersIds.push_back(bufferId);\n\treturn (int)bufferId;\n}\nunsigned int activeVBOid;\nint DrawJob::buildVAOforShader(DrawJob* pDJ, int shaderN) {\n\t\/\/delete VAO if exists already\n\tif (pDJ->glVAOid > 0) {\n\t\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\t\tglDeleteVertexArrays(1, &(pDJ->glVAOid));\n\t}\n\tglGenVertexArrays(1, &pDJ->glVAOid);\n\tglBindVertexArray(pDJ->glVAOid);\n\n\t\/\/open shader descriptor to access variables locations\n\tShader* pShader = Shader::shaders.at(pDJ->mt.shaderN);\n\n\tactiveVBOid = 0;\n\tattachAttribute(pShader->l_aPos, 3, &pDJ->aPos);\n\tattachAttribute(pShader->l_aTuv, 2, &pDJ->aTuv);\n\n\tif (pDJ->glEBOid > 0)\n\t\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pDJ->glEBOid);\n\n\tglBindVertexArray(0);\n\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\treturn 1;\n}\n\nint DrawJob::attachAttribute(int varLocationInShader, int attributeSizeInFloats, AttribRef* pAR) {\n\tif (varLocationInShader < 0)\n\t\treturn 0; \/\/not used in this shader\n\tif (pAR->glVBOid == 0) {\n\t\tmylog("ERROR in DrawJob::attachAttribute, nk such attribute\/VBO\\n");\n\t\treturn -1;\n\t}\n\tglEnableVertexAttribArray(varLocationInShader);\n\tif (activeVBOid != pAR->glVBOid) {\n\t\tactiveVBOid = pAR->glVBOid;\n\t\t\/\/attach input stream data\n\t\tglBindBuffer(GL_ARRAY_BUFFER, activeVBOid);\n\t}\n\tglVertexAttribPointer(varLocationInShader, attributeSizeInFloats, GL_FLOAT, GL_FALSE, pAR->stride, (void*)(long)pAR->offset);\n\treturn 1;\n}\nint DrawJob::executeDrawJob(DrawJob* pDJ, float* uMVP, Material* pMt) {\n\tif (pMt == NULL)\n\t\tpMt = &(pDJ->mt);\n\tglBindVertexArray(pDJ->glVAOid);\n\tShader* pShader = Shader::shaders.at(pMt->shaderN);\n\tglUseProgram(pShader->GLid);\n\tglUniformMatrix4fv(pShader->l_uMVP, 1, GL_FALSE, (const GLfloat*)uMVP);\n\n\t\/\/attach textures\n\tif (pShader->l_uTex0 >= 0) {\n\t\tint textureId = Texture::getGLid(pMt->uTex0);\n\t\t\/\/pass textureId to shader program\n\t\tglActiveTexture(GL_TEXTURE0); \/\/ activate the texture unit first before binding texture\n\t\tglBindTexture(GL_TEXTURE_2D, textureId);\n\t\t\/\/ Tell the texture uniform sampler to use this texture in the shader by binding to texture unit 0. \n\t\tglUniform1i(pShader->l_uTex0, 0);\n\t}\n\t\/\/other uniforms\n\tif (pShader->l_uColor >= 0) {\n\t\t\/\/float uColor[4] = { 1.f, 0.f, 1.f, 1.f }; \/\/R,G,B, alpha\n\t\tglUniform4fv(pShader->l_uColor, 1, pMt->uColor.forGL());\n\t}\n\tif (pDJ->glEBOid == 0) {\n\t\tglDrawArrays(pMt->primitiveType, 0, pDJ->pointsN);\n\t}\n\telse { \/\/use EBO\n\t\tglDrawElements(pMt->primitiveType, pDJ->pointsN, GL_UNSIGNED_SHORT, 0);\n\t}\n\tglBindVertexArray(0);\n\treturn 1;\n}\nint DrawJob::cleanUp() {\n\tint itemsN = drawJobs.size();\n\t\/\/delete all drawJobs\n\tfor (int i = 0; i < itemsN; i++) {\n\t\tDrawJob* pDJ = drawJobs.at(i);\n\t\tdelete pDJ;\n\t}\n\tdrawJobs.clear();\n\t\/\/delete Buffers\n\titemsN = buffersIds.size();\n\t\/\/delete all buffers\n\tfor (int i = 0; i < itemsN; i++) {\n\t\tunsigned int id = buffersIds.at(i);\n\t\tglDeleteBuffers(1, &id);\n\t}\n\tbuffersIds.clear();\n\n\treturn 1;\n}\nint DrawJob::setDesirableOffsetsForSingleVBO(DrawJob* pDJ, int* pStride, int shaderN, int VBOid) {\n\t\/\/sets desirable offsets and stride according to given shader needs\n\t\/\/assuming that we have 1 single VBO\n\tShader* pSh = Shader::shaders.at(shaderN);\n\tint stride = 0;\n\tpDJ->aPos.offset = 0; \/\/attribute o_aPos, always 0\n\tstride += sizeof(float) * 3; \/\/aPos size - 3 floats (x,y,z)\n\tif (pSh->l_aTuv >= 0) { \/\/attribute TUV (texture coordinates)\n\t\tpDJ->aTuv.offset = stride; \/\/attribute TUV (texture coordinates)\n\t\tstride += sizeof(float) * 2;\n\t}\n\t*pStride = stride;\n\t\/\/add stride and VBOid to all attributes\n\tAttribRef* pAR = NULL;\n\tpAR = &pDJ->aPos; pAR->glVBOid = VBOid; pAR->stride = stride;\n\tpAR = &pDJ->aTuv; pAR->glVBOid = VBOid; pAR->stride = stride;\n\n\treturn 1;\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n