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\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043b\u043e\u0436\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043c\u043d\u043e\u0433\u043e-\u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043d\u0443\u044e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c, \u043d\u0430 \u043f\u0440\u0430\u0432\u0443\u044e (\u0441\u0438\u043d\u044e\u044e) \u0441\u0442\u0440\u043e\u043d\u0443 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Phong \u0448\u0435\u0439\u0434\u0435\u0440, \u043d\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437. \u041f\u043e\u043a\u0430 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c (\u0431\u0435\u0437 \u0441\u0432\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c). \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f:<\/p>\n\n\n\n
1. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c VS, \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a997modeler<\/em>\\p_windows\\p_windows.sln<\/em>.<\/p>\n\n\n\n \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 C:\\CPP\\a997modeler\\dt\\sample_img.png<\/strong><\/em> \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0433\u043b\u0430\u0432.<\/p>\n\n\n\n \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0435 \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e 256×128 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441 11×12 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 (2 \u043b\u0435\u0432\u044b\u0445 \u0440\u044b\u0446\u0430\u0440\u044f):<\/p>\n\n\n\n <\/p>\n\n\n\n \u0422\u0430\u043a\u0436\u0435, \u0441\u043a\u0430\u0436\u0435\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0435 \u0432\u0432\u0435\u0440\u0445 \u043d\u043e\u0433\u0430\u043c\u0438.<\/p>\n\n\n\n \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u0432 GL-\u043e\u0432\u0441\u043a\u0438\u0439 “tUV” \u0444\u043e\u0440\u043c\u0430\u0442, \u043e\u0442 0 \u0434\u043e 1. \u041f\u043e\u0442\u043e\u043c \u043d\u0430\u0434\u043e \u0440\u0435\u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n\n\n\n 2. \u041f\u043e\u0434 modeler <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header file TexCoords.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 3. \u041f\u043e\u0434 modeler <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 C++ file TexCoords.cpp<\/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 TheGame.cpp<\/em> \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043c\u0435\u043d\u044b \u0446\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0437\u0430\u043c\u0435\u043d\u0438\u043c Material \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0415\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b TexCoords <\/em>\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e pMB->buildBoxFace<\/em>.<\/p>\n\n\n\n 4. \u0417\u0430\u043c\u0435\u043d\u0438\u043c TheGame.cpp<\/em> \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 ModelBuilder::buildBoxFace(\u2026)<\/em> \u0443 \u043d\u0430\u0441 \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b TexCoords*<\/em>. \u0418 \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f ModelBuilder::groupApplyTexture2(\u2026)<\/em>.<\/p>\n\n\n\n 5. \u0417\u0430\u043c\u0435\u043d\u0438\u043c ModelBuilder.h<\/em> \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 6. \u0417\u0430\u043c\u0435\u043d\u0438\u043c ModelBuilder.cpp<\/em> \u0435\u043e\u0434 \u043d\u0430: <\/p>\n\n\n <\/p>\n\n\n\n 7. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a:<\/p>\n\n\n\n <\/p>\n\n\n\n
\n\n\n\n
<\/p>\n\n\n\n
\n\n\n\n\n#pragma once\n#include <string>\n\nclass TexCoords\n{\npublic:\n\tfloat tuvTopLeft[2] = { 0.0f,0.0f };\n\tfloat tuvBottomRight[2] = { 1.0f,1.0f };\npublic:\n\tvoid set(int texN, float x, float y, float w, float h, std::string flip) { set(this, texN, x, y, w, h, flip); };\n\tstatic void set(TexCoords* pTC, int texN, float x, float y, float w, float h, std::string flipStr);\n\tstatic void set_GL(TexCoords* pTC, float x, float y, float w, float h, std::string flipStr);\n\tstatic void flip(TexCoords* pTC, std::string flipStr); \/\/possible flips: "90" (CCW), "-90" (CW), "180", "h" (horizontal), "v" (vertical) \n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "TexCoords.h"\n#include "Texture.h"\n\nvoid TexCoords::set(TexCoords* pTC, int texN, float x, float y, float w, float h, std::string flipStr) {\n\tif (texN < 0)\n\t\treturn;\n\tTexture* pTex = Texture::textures.at(texN);\n\tx = x \/ pTex->size[0];\n\ty = y \/ pTex->size[1];\n\tw = w \/ pTex->size[0];\n\th = h \/ pTex->size[1];\n\tset_GL(pTC, x, y, w, h, flipStr);\n}\nvoid TexCoords::set_GL(TexCoords* pTC, float x, float y, float w, float h, std::string flipStr) {\n\t\/\/assuming that x,y,w,h - in GL 0-to-1 format\n\tpTC->tuvTopLeft[0] = x;\n\tpTC->tuvTopLeft[1] = y;\n\tpTC->tuvBottomRight[0] = x + w;\n\tpTC->tuvBottomRight[1] = y + h;\n\tflip(pTC, flipStr);\n}\nvoid TexCoords::flip(TexCoords* pTC, std::string flipStr) {\n\t\/\/possible flips: "90" (CCW), "-90" (CW), "180", "h" (horizontal), "v" (vertical) \n\tif (flipStr.compare("") == 0)\n\t\treturn;\n\tTexCoords outTC;\n\tif (flipStr.find("90") == 0) { \/\/CCW\n\t\toutTC.tuvTopLeft[0] = pTC->tuvBottomRight[0];\n\t\toutTC.tuvTopLeft[1] = pTC->tuvTopLeft[1];\n\t\toutTC.tuvBottomRight[0] = pTC->tuvTopLeft[0];\n\t\toutTC.tuvBottomRight[1] = pTC->tuvBottomRight[1];\n\t}\n\telse if (flipStr.find("-90") == 0) { \/\/CW\n\t\toutTC.tuvTopLeft[0] = pTC->tuvTopLeft[0];\n\t\toutTC.tuvTopLeft[1] = pTC->tuvBottomRight[1];\n\t\toutTC.tuvBottomRight[0] = pTC->tuvBottomRight[0];\n\t\toutTC.tuvBottomRight[1] = pTC->tuvTopLeft[1];\n\t}\n\telse if (flipStr.find("180") == 0) {\n\t\toutTC.tuvTopLeft[0] = pTC->tuvBottomRight[0];\n\t\toutTC.tuvTopLeft[1] = pTC->tuvBottomRight[1];\n\t\toutTC.tuvBottomRight[0] = pTC->tuvTopLeft[0];\n\t\toutTC.tuvBottomRight[1] = pTC->tuvTopLeft[1];\n\t}\n\telse if (flipStr.find("h") == 0) { \/\/horizontal\n\t\toutTC.tuvTopLeft[0] = pTC->tuvBottomRight[0];\n\t\toutTC.tuvTopLeft[1] = pTC->tuvTopLeft[1];\n\t\toutTC.tuvBottomRight[0] = pTC->tuvTopLeft[0];\n\t\toutTC.tuvBottomRight[1] = pTC->tuvBottomRight[1];\n\t}\n\telse if (flipStr.find("v") == 0) { \/\/vertical\n\t\toutTC.tuvTopLeft[0] = pTC->tuvTopLeft[0];\n\t\toutTC.tuvTopLeft[1] = pTC->tuvBottomRight[1];\n\t\toutTC.tuvBottomRight[0] = pTC->tuvBottomRight[0];\n\t\toutTC.tuvBottomRight[1] = pTC->tuvTopLeft[1];\n\t}\n\tmemcpy(pTC, &outTC, sizeof(TexCoords));\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "TheGame.h"\n#include "platform.h"\n#include "utils.h"\n#include "linmath.h"\n#include "Texture.h"\n#include "Shader.h"\n#include "DrawJob.h"\n#include "ModelBuilder.h"\n#include "TexCoords.h"\n\nextern std::string filesRoot;\n\nstd::vector<GameSubj*> TheGame::gameSubjs;\n\nint TheGame::getReady() {\n bExitGame = false;\n Shader::loadShaders();\n glEnable(GL_CULL_FACE);\n\n \/\/=== create box ========================\n GameSubj* pGS = new GameSubj();\n gameSubjs.push_back(pGS);\n\n pGS->name.assign("box1");\n pGS->ownCoords.setPosition(0, 0, 0);\n pGS->ownCoords.setDegrees(0, 0, 0);\n pGS->ownSpeed.setDegrees(0,1,0);\n\n ModelBuilder* pMB = new ModelBuilder();\n pMB->useSubjN(gameSubjs.size() - 1);\n\n \/\/define VirtualShape\n VirtualShape vs;\n vs.setShapeType("box-tank");\n vs.whl[0] = 60;\n vs.whl[1] = 160;\n vs.whl[2] = 390;\n vs.setExt(20);\n vs.extD = 0;\n vs.extF = 0; \/\/to make front face "flat"\n vs.sectionsR = 2;\n\n Material mt;\n \/\/define material - flat red\n mt.shaderN = Shader::spN_phong_ucolor;\n mt.primitiveType = GL_TRIANGLES;\n mt.uColor.setRGBA(255, 0, 0,255); \/\/red\n pMB->useMaterial(&mt);\n\n pMB->buildBoxFace(pMB,"front v", &vs);\n pMB->buildBoxFace(pMB, "back v", &vs);\n pMB->buildBoxFace(pMB, "top", &vs);\n pMB->buildBoxFace(pMB, "bottom", &vs);\n pMB->buildBoxFace(pMB, "left all", &vs);\n\n mt.uColor.clear(); \/\/ set to zero;\n mt.uTex0 = Texture::loadTexture(filesRoot + "\/dt\/sample_img.png");\n mt.shaderN = Shader::spN_flat_tex;\n pMB->useMaterial(&mt);\n TexCoords tc;\n tc.set(mt.uTex0, 11, 12, 256, 128, "180");\n pMB->buildBoxFace(pMB, "right all", &vs, &tc);\n\n pMB->buildDrawJobs(gameSubjs);\n\n delete pMB;\n\n \/\/===== set up camera\n v3set(mainCamera.ownCoords.pos, 0, 200, 1000); \/\/set position\n float cameraDir[3];\n v3set(cameraDir, 0, -200, -1000); \/\/set direction vector\n float cameraYawDg = v3yawDg(cameraDir);\n float cameraPitchDg = v3pitchDg(cameraDir);\n \/\/mylog("cameraYaw=%f, cameraPitch=%f\\n", cameraYawDg, cameraPitchDg);\n\n mainCamera.ownCoords.setDegrees(cameraPitchDg, cameraYawDg, 0);\n float cameraUp[4] = { 0,1,0,0 }; \/\/y - up\n mat4x4_mul_vec4plus(cameraUp, *mainCamera.ownCoords.getRotationMatrix(), cameraUp, 0);\n\n mat4x4_look_at(mainCamera.lookAtMatrix, mainCamera.ownCoords.pos, pGS->ownCoords.pos, cameraUp);\n\n \/\/===== set up light\n v3set(dirToMainLight, -1, 1, 1);\n vec3_norm(dirToMainLight, dirToMainLight);\n\n return 1;\n}\nint TheGame::drawFrame() {\n myPollEvents();\n\n \/\/glClearColor(0.0, 0.0, 0.5, 1.0);\n glClear(GL_COLOR_BUFFER_BIT);\n\n \/\/calculate halfVector\n float dirToCamera[4] = { 0,0,-1,0 }; \/\/-z\n mat4x4_mul_vec4plus(dirToCamera, *mainCamera.ownCoords.getRotationMatrix(), dirToCamera, 0);\n\n float uHalfVector[4] = { 0,0,0,0 };\n for (int i = 0; i < 3; i++)\n uHalfVector[i] = (dirToCamera[i] + dirToMainLight[i]) \/ 2;\n vec3_norm(uHalfVector, uHalfVector);\n\n mat4x4 mProjection, mViewProjection, mMVP, mMV4x4;\n \/\/mat4x4_ortho(mProjection, -(float)screenSize[0] \/ 2, (float)screenSize[0] \/ 2, -(float)screenSize[1] \/ 2, (float)screenSize[1] \/ 2, 100.f, 500.f);\n mat4x4_perspective(mProjection, 3.14f \/ 6.0f, (float)screenSize[0] \/ screenSize[1], 700.f, 1300.f);\n mat4x4_mul(mViewProjection, mProjection, mainCamera.lookAtMatrix);\n \/\/mViewProjection[1][3] = 0; \/\/keystone effect\n\n \/\/scan subjects\n int subjsN = gameSubjs.size();\n for (int subjN = 0; subjN < subjsN; subjN++) {\n GameSubj* pGS = gameSubjs.at(subjN);\n \/\/behavior - apply rotation speed\n pGS->moveSubj();\n \/\/prepare subject for rendering\n pGS->buildModelMatrix(pGS);\n \/\/build MVP matrix for given subject\n mat4x4_mul(mMVP, mViewProjection, pGS->ownModelMatrix);\n \/\/build Model-View (rotation) matrix for normals\n mat4x4_mul(mMV4x4, mainCamera.lookAtMatrix, (vec4*)pGS->ownCoords.getRotationMatrix());\n \/\/convert to 3x3 matrix\n float mMV3x3[3][3];\n for (int y = 0; y < 3; y++)\n for (int x = 0; x < 3; x++)\n mMV3x3[y][x] = mMV4x4[y][x];\n \/\/render subject\n for (int i = 0; i < pGS->djTotalN; i++) {\n DrawJob* pDJ = DrawJob::drawJobs.at(pGS->djStartN + i);\n pDJ->execute((float*)mMVP, *mMV3x3, dirToMainLight, uHalfVector, NULL);\n }\n }\n mySwapBuffers();\n return 1;\n}\n\nint TheGame::cleanUp() {\n int itemsN = gameSubjs.size();\n \/\/delete all UISubjs\n for (int i = 0; i < itemsN; i++) {\n GameSubj* pGS = gameSubjs.at(i);\n delete pGS;\n }\n gameSubjs.clear();\n \/\/clear all other classes\n Texture::cleanUp();\n Shader::cleanUp();\n DrawJob::cleanUp();\n return 1;\n}\nint TheGame::onScreenResize(int width, int height) {\n if (screenSize[0] == width && screenSize[1] == height)\n return 0;\n screenSize[0] = width;\n screenSize[1] = height;\n screenRatio = (float)width \/ (float)height;\n glViewport(0, 0, width, height);\n mylog(" screen size %d x %d\\n", width, height);\n return 1;\n}\nint TheGame::run() {\n getReady();\n while (!bExitGame) {\n drawFrame();\n }\n cleanUp();\n return 1;\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n#include "ModelBuilder1base.h"\n#include "TexCoords.h"\n\nclass ModelBuilder : public ModelBuilder1base\n{\npublic:\n\tvirtual ~ModelBuilder();\n\tstatic int buildFace(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS, TexCoords* pTC = NULL, TexCoords* pTC2nm = NULL);\n\tstatic int buildBoxFace(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS, TexCoords* pTC = NULL, TexCoords* pTC2nm = NULL);\n\tstatic int buildBoxFacePlain(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS);\n\tstatic int buildBoxFaceTank(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS);\n\tstatic int cylinderWrap(ModelBuilder* pMB, VirtualShape* pVS, float angleFrom, float angleTo);\n\tstatic int capWrap(ModelBuilder* pMB, VirtualShape* pVS, float angleFrom, float angleTo);\n\tstatic int groupApplyTexture2(ModelBuilder* pMB, std::string applyTo, TexCoords* pTC, bool isNormakMap);\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "ModelBuilder.h"\n#include "platform.h"\n#include "utils.h"\n#include "DrawJob.h"\n#include "Shader.h"\n\nextern float degrees2radians;\n\nModelBuilder::~ModelBuilder() {\n}\n\nint ModelBuilder::buildFace(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS, TexCoords* pTC, TexCoords* pTC2nm) {\n\tif (strstr(pVS->shapeType, "box") == pVS->shapeType)\n\t\treturn buildBoxFace(pMB, applyTo, pVS, pTC, pTC2nm);\n\treturn -1;\n}\nint ModelBuilder::buildBoxFace(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS, TexCoords* pTC, TexCoords* pTC2nm) {\n\t\/\/this code is for simple box\n\tVirtualShape vs; \/\/face VS, \n\tmat4x4 transformMatrix = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };\n\tvs.sectionsR = pVS->sectionsR;\n\t\/\/rotate desirable side to face us. \n\tif (applyTo.find("front") == 0) {\n\t\t\/\/Side <front> is facing us as is.\n\t\tvs.whl[0] = pVS->whl[0];\n\t\tvs.whl[1] = pVS->whl[1];\n\t\tvs.sections[0] = pVS->sections[0];\n\t\tvs.sections[1] = pVS->sections[1];\n\t\t\/\/extensions\n\t\tvs.extF = pVS->extF;\n\t\tvs.extL = pVS->extL;\n\t\tvs.extR = pVS->extR;\n\t\tvs.extU = pVS->extU;\n\t\tvs.extD = pVS->extD;\n\t\t\/\/define how to move\/place generated face back to the VirtualShape\n\t\t\/\/just shift closer to us by length\/2\n\t\tmat4x4_translate(transformMatrix, 0, 0, pVS->whl[2] \/ 2);\n\t}\n\telse if (applyTo.find("back") == 0) {\n\t\tvs.whl[0] = pVS->whl[0];\n\t\tvs.whl[1] = pVS->whl[1];\n\t\tvs.sections[0] = pVS->sections[0];\n\t\tvs.sections[1] = pVS->sections[1];\n\t\t\/\/extensions\n\t\tvs.extF = pVS->extB;\n\t\tvs.extL = pVS->extR;\n\t\tvs.extR = pVS->extL;\n\t\tvs.extU = pVS->extU;\n\t\tvs.extD = pVS->extD;\n\t\t\/\/rotate 180 degrees around Y and shift farther from us by half-length\n\t\tmat4x4_translate(transformMatrix, 0, 0, -pVS->whl[2] \/ 2);\n\t\tmat4x4_rotate_Y(transformMatrix, transformMatrix, degrees2radians * 180);\n\t}\n\telse if (applyTo.find("left") == 0) {\n\t\tvs.whl[0] = pVS->whl[2]; \/\/width = original length\n\t\tvs.whl[1] = pVS->whl[1];\n\t\tvs.sections[0] = pVS->sections[2];\n\t\tvs.sections[1] = pVS->sections[1];\n\t\t\/\/extensions\n\t\tvs.extF = pVS->extL;\n\t\tvs.extL = pVS->extB;\n\t\tvs.extR = pVS->extF;\n\t\tvs.extU = pVS->extU;\n\t\tvs.extD = pVS->extD;\n\t\t\/\/rotate -90 degrees around Y (CW) and shift half-width to the left\n\t\tmat4x4_translate(transformMatrix, -pVS->whl[0] \/ 2, 0, 0);\n\t\tmat4x4_rotate_Y(transformMatrix, transformMatrix, -degrees2radians * 90);\n\t}\n\telse if (applyTo.find("right") == 0) {\n\t\tvs.whl[0] = pVS->whl[2]; \/\/width = original length\n\t\tvs.whl[1] = pVS->whl[1];\n\t\tvs.sections[0] = pVS->sections[2];\n\t\tvs.sections[1] = pVS->sections[1];\n\t\t\/\/extensions\n\t\tvs.extF = pVS->extR;\n\t\tvs.extL = pVS->extF;\n\t\tvs.extR = pVS->extB;\n\t\tvs.extU = pVS->extU;\n\t\tvs.extD = pVS->extD;\n\t\t\/\/rotate +90 degrees around Y (CCW) and shift half-width to the right\n\t\tmat4x4_translate(transformMatrix, pVS->whl[0] \/ 2, 0, 0);\n\t\tmat4x4_rotate_Y(transformMatrix, transformMatrix, degrees2radians * 90);\n\t}\n\telse if (applyTo.find("top") == 0) {\n\t\tvs.whl[0] = pVS->whl[0];\n\t\tvs.whl[1] = pVS->whl[2]; \/\/height = original length\n\t\tvs.sections[0] = pVS->sections[0];\n\t\tvs.sections[1] = pVS->sections[2];\n\t\t\/\/extensions\n\t\tvs.extF = pVS->extU;\n\t\tvs.extL = pVS->extR;\n\t\tvs.extR = pVS->extL;\n\t\tvs.extU = pVS->extF;\n\t\tvs.extD = pVS->extB;\n\t\t\/\/rotate -90 degrees around X (CW) and 180 around Y, and shift half-height up\n\t\tmat4x4_translate(transformMatrix, 0, pVS->whl[1] \/ 2, 0);\n\t\tmat4x4_rotate_Y(transformMatrix, transformMatrix, -degrees2radians * 180);\n\t\tmat4x4_rotate_X(transformMatrix, transformMatrix, -degrees2radians * 90);\n\t}\n\telse if (applyTo.find("bottom") == 0) {\n\t\tvs.whl[0] = pVS->whl[0];\n\t\tvs.whl[1] = pVS->whl[2]; \/\/height = original length\n\t\tvs.sections[0] = pVS->sections[0];\n\t\tvs.sections[1] = pVS->sections[2];\n\t\t\/\/extensions\n\t\tvs.extF = pVS->extD;\n\t\tvs.extL = pVS->extL;\n\t\tvs.extR = pVS->extR;\n\t\tvs.extU = pVS->extF;\n\t\tvs.extD = pVS->extB;\n\t\t\/\/rotate 90 around X (CCW) and shift half-height down\n\t\tmat4x4_translate(transformMatrix, 0, -pVS->whl[1] \/ 2, 0);\n\t\tmat4x4_rotate_X(transformMatrix, transformMatrix, degrees2radians * 90);\n\t}\n\tlockGroup(pMB);\n\t\/\/create vertices\n\tif (strstr(pVS->shapeType, "tank") != nullptr)\n\t\tbuildBoxFaceTank(pMB, applyTo, &vs);\n\telse\n\t\tbuildBoxFacePlain(pMB, applyTo, &vs);\n\n\tgroupApplyTexture2(pMB, "front", pTC, false);\n\tgroupApplyTexture2(pMB, "front", pTC2nm, true); \/\/for normal map\n\n\t\/\/move face to it's place (apply transform matrix)\n\tint vertsN = pMB->vertices.size();\n\tfor (int i = pMB->pCurrentGroup->fromVertexN; i < vertsN; i++) {\n\t\tVertex01* pVX = pMB->vertices.at(i);\n\t\tmat4x4_mul_vec4plus(pVX->aPos, transformMatrix, pVX->aPos, 1);\n\t\tmat4x4_mul_vec4plus(pVX->aNormal, transformMatrix, pVX->aNormal, 0);\n\t}\n\treleaseGroup(pMB);\n\treturn 1;\n}\nint ModelBuilder::buildBoxFacePlain(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS) {\n\tif (pVS->whl[0] == 0 || pVS->whl[1] == 0)\n\t\treturn 0;\n\t\/\/create vertices\n\tint sectionsX = pVS->sections[0];\n\tint sectionsY = pVS->sections[1];\n\tint pointsX = sectionsX + 1;\n\tint pointsY = sectionsY + 1;\n\tfloat stepX = pVS->whl[0] \/ sectionsX;\n\tfloat stepY = pVS->whl[1] \/ sectionsY;\n\tfloat kY = pVS->whl[1] \/ 2;\n\tfor (int iy = 0; iy < pointsY; iy++) {\n\t\tfloat kX = -pVS->whl[0] \/ 2;\n\t\tfor (int ix = 0; ix < pointsX; ix++) {\n\t\t\tint nSE = addVertex(pMB, kX, kY, pVS->extF, 0, 0, 1); \/\/vertex number on south-east\n\t\t\tif (iy > 0 && ix > 0) {\n\t\t\t\t\/\/add 2 triangles\n\t\t\t\tint nSW = nSE - 1; \/\/vertex number south-west\n\t\t\t\tint nNE = nSE - pointsX; \/\/north-east\n\t\t\t\tint nNW = nSW - pointsX; \/\/north-west\n\t\t\t\tadd2triangles(pMB, nNW, nNE, nSW, nSE, iy + ix);\n\t\t\t}\n\t\t\tkX += stepX;\n\t\t}\n\t\tkY -= stepY;\n\t}\n\treturn 1;\n}\nint ModelBuilder::buildBoxFaceTank(ModelBuilder* pMB, std::string applyTo, VirtualShape* pVS) {\n\t\/\/for diamond effect - sectionsRad=1, don't merge normals\n\tbool drawMiddle = true;\n\t\/\/edges\n\tbool drawTop = false;\n\tbool drawBottom = false;\n\tbool drawLeft = false;\n\tbool drawRight = false;\n\t\/\/corners\n\tbool drawTopLeft = false;\n\tbool drawTopRight = false;\n\tbool drawBottomLeft = false;\n\tbool drawBottomRight = false;\n\tif (pVS->extF == 0 || applyTo.find(" all") != std::string::npos) {\n\t\tdrawTop = true;\n\t\tdrawBottom = true;\n\t\tdrawLeft = true;\n\t\tdrawRight = true;\n\t\tdrawTopLeft = true;\n\t\tdrawTopRight = true;\n\t\tdrawBottomLeft = true;\n\t\tdrawBottomRight = true;\n\t}\n\telse if (applyTo.find(" h") != std::string::npos) {\n\t\tdrawLeft = true;\n\t\tdrawRight = true;\n\t}\n\telse if (applyTo.find(" v") != std::string::npos) {\n\t\tdrawTop = true;\n\t\tdrawBottom = true;\n\t}\n\tif (applyTo.find(" no") != std::string::npos) {\n\t\tif (applyTo.find(" noM") != std::string::npos) {\n\t\t\t\/\/middle\n\t\t\tif (applyTo.find(" noMrow") != std::string::npos) {\n\t\t\t\tdrawMiddle = false;\n\t\t\t\tdrawLeft = false;\n\t\t\t\tdrawRight = false;\n\t\t\t}\n\t\t\tif (applyTo.find(" noMcol") != std::string::npos) {\n\t\t\t\tdrawMiddle = false;\n\t\t\t\tdrawTop = false;\n\t\t\t\tdrawBottom = false;\n\t\t\t}\n\t\t\tif (applyTo.find(" noMid") != std::string::npos)\n\t\t\t\tdrawMiddle = false;\n\t\t}\n\t\tif (applyTo.find(" noN") != std::string::npos) {\n\t\t\t\/\/north\n\t\t\tif (applyTo.find(" noNrow") != std::string::npos) {\n\t\t\t\tdrawTop = false;\n\t\t\t\tdrawTopLeft = false;\n\t\t\t\tdrawTopRight = false;\n\t\t\t}\n\t\t\tif (applyTo.find(" noNedge") != std::string::npos)\n\t\t\t\tdrawTop = false;\n\t\t\tif (applyTo.find(" noNW") != std::string::npos)\n\t\t\t\tdrawTopLeft = false;\n\t\t\tif (applyTo.find(" noNE") != std::string::npos)\n\t\t\t\tdrawTopRight = false;\n\t\t}\n\t\tif (applyTo.find(" noS") != std::string::npos) {\n\t\t\t\/\/south\n\t\t\tif (applyTo.find(" noSrow") != std::string::npos) {\n\t\t\t\tdrawBottom = false;\n\t\t\t\tdrawBottomLeft = false;\n\t\t\t\tdrawBottomRight = false;\n\t\t\t}\n\t\t\tif (applyTo.find(" noSedge") != std::string::npos)\n\t\t\t\tdrawBottom = false;\n\t\t\tif (applyTo.find(" noSW") != std::string::npos)\n\t\t\t\tdrawBottomLeft = false;\n\t\t\tif (applyTo.find(" noSE") != std::string::npos)\n\t\t\t\tdrawBottomRight = false;\n\t\t}\n\t\tif (applyTo.find(" noW") != std::string::npos) {\n\t\t\t\/\/west\n\t\t\tif (applyTo.find(" noWcol") != std::string::npos) {\n\t\t\t\tdrawLeft = false;\n\t\t\t\tdrawTopLeft = false;\n\t\t\t\tdrawBottomLeft = false;\n\t\t\t}\n\t\t\tif (applyTo.find(" noWedge") != std::string::npos)\n\t\t\t\tdrawLeft = false;\n\t\t}\n\t\tif (applyTo.find(" noE") != std::string::npos) {\n\t\t\t\/\/east\n\t\t\tif (applyTo.find(" noEcol") != std::string::npos) {\n\t\t\t\tdrawRight = false;\n\t\t\t\tdrawTopRight = false;\n\t\t\t\tdrawBottomRight = false;\n\t\t\t}\n\t\t\tif (applyTo.find(" noEedge") != std::string::npos)\n\t\t\t\tdrawRight = false;\n\t\t}\n\t}\n\tlockGroup(pMB);\n\t\/\/middle\n\tif (pVS->whl[0] > 0 && pVS->whl[1] > 0 && drawMiddle) {\n\t\tbuildBoxFacePlain(pMB, applyTo, pVS);\n\t}\n\tVirtualShape vs;\n\t\/\/edges\n\t\/\/vs.type.assign("cylinder");\n\tvs.sectionsR = pVS->sectionsR;\n\tif (pVS->whl[0] > 0) {\n\t\tvs.sections[2] = pVS->sections[0]; \/\/cylinder Z sections n\n\t\tvs.whl[2] = pVS->whl[0]; \/\/cylinder length Z\n\t\tvs.whl[0] = pVS->extF * 2; \/\/cylinder diameter X\n\t\tif (pVS->extU > 0 && drawTop) {\n\t\t\tvs.whl[1] = pVS->extU * 2; \/\/cylinder diameter Y\n\t\t\tlockGroup(pMB);\n\t\t\tcylinderWrap(pMB, &vs, 0, 90);\n\t\t\t\/\/rotate -90 degrees around Y and shift up\n\t\t\tmoveGroupDg(pMB, 0, -90, 0, 0, pVS->whl[1] * 0.5f, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t\tif (pVS->extD > 0 && drawBottom) {\n\t\t\tvs.whl[1] = pVS->extD * 2; \/\/cylinder diameter Y\n\t\t\tlockGroup(pMB);\n\t\t\tcylinderWrap(pMB, &vs, -90, 0);\n\t\t\t\/\/rotate -90 degrees around Y and shift down\n\t\t\tmoveGroupDg(pMB, 0, -90, 0, 0, -pVS->whl[1] * 0.5f, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t}\n\tif (pVS->whl[1] > 0) {\n\t\tvs.sections[2] = pVS->sections[1]; \/\/cylinder Z sections n\n\t\tvs.whl[2] = pVS->whl[1]; \/\/cylinder length Z\n\t\tvs.whl[1] = pVS->extF * 2; \/\/cylinder diameter Y\n\t\tif (pVS->extL > 0 && drawLeft) {\n\t\t\tvs.whl[0] = pVS->extL * 2; \/\/cylinder diameter X\n\t\t\tlockGroup(pMB);\n\t\t\tcylinderWrap(pMB, &vs, 90, 180);\n\t\t\t\/\/rotate 90 degrees around Y and shift left\n\t\t\tmoveGroupDg(pMB, 90, 0, 0, -pVS->whl[0] * 0.5f, 0, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t\tif (pVS->extR > 0 && drawRight) {\n\t\t\tvs.whl[0] = pVS->extR * 2; \/\/cylinder diameter X\n\t\t\tlockGroup(pMB);\n\t\t\tcylinderWrap(pMB, &vs, 0, 90);\n\t\t\t\/\/rotate 90 degrees around Y and shift left\n\t\t\tmoveGroupDg(pMB, 90, 0, 0, pVS->whl[0] * 0.5f, 0, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t}\n\t\/\/corners\n\t\/\/vs.type.assign("cap");\n\tvs.sectionsR = pVS->sectionsR;\n\tvs.sections[2] = pVS->sectionsR;\n\tvs.whl[2] = pVS->extF;\n\tif (pVS->extU > 0) {\n\t\t\/\/top corners\n\t\tvs.whl[1] = pVS->extU * 2;\n\t\tif (pVS->extL > 0 && drawTopLeft) {\n\t\t\tvs.whl[0] = pVS->extL * 2;\n\t\t\tlockGroup(pMB);\n\t\t\tcapWrap(pMB, &vs, 90, 180);\n\t\t\t\/\/rotate 90 degrees around Y and shift left\n\t\t\tmoveGroupDg(pMB, 0, 0, 0, -pVS->whl[0] * 0.5f, pVS->whl[1] * 0.5f, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t\tif (pVS->extR > 0 && drawTopRight) {\n\t\t\tvs.whl[0] = pVS->extR * 2;\n\t\t\tlockGroup(pMB);\n\t\t\tcapWrap(pMB, &vs, 0, 90);\n\t\t\t\/\/rotate 90 degrees around Y and shift left\n\t\t\tmoveGroupDg(pMB, 0, 0, 0, pVS->whl[0] * 0.5f, pVS->whl[1] * 0.5f, 0);\n\t\t\treleaseGroup(pMB);\n\n\t\t}\n\t}\n\tif (pVS->extD > 0) {\n\t\t\/\/bottom corners\n\t\tvs.whl[1] = pVS->extD * 2;\n\t\tif (pVS->extL > 0 && drawBottomLeft) {\n\t\t\tvs.whl[0] = pVS->extL * 2;\n\t\t\tlockGroup(pMB);\n\t\t\tcapWrap(pMB, &vs, -180, -90);\n\t\t\t\/\/rotate 90 degrees around Y and shift left\n\t\t\tmoveGroupDg(pMB, 0, 0, 0, -pVS->whl[0] * 0.5f, -pVS->whl[1] * 0.5f, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t\tif (pVS->extR > 0 && drawBottomRight) {\n\t\t\tvs.whl[0] = pVS->extR * 2;\n\t\t\tlockGroup(pMB);\n\t\t\tcapWrap(pMB, &vs, -90, 0);\n\t\t\t\/\/rotate 90 degrees around Y and shift left\n\t\t\tmoveGroupDg(pMB, 0, 0, 0, pVS->whl[0] * 0.5f, -pVS->whl[1] * 0.5f, 0);\n\t\t\treleaseGroup(pMB);\n\t\t}\n\t}\n\tif (pVS->extF == 0) {\n\t\tint vertsN = pMB->vertices.size();\n\t\tfor (int i = pMB->pCurrentGroup->fromVertexN; i < vertsN; i++) {\n\t\t\tVertex01* pVX = pMB->vertices.at(i);\n\t\t\t\/\/normal\n\t\t\tv3set(pVX->aNormal, 0, 0, 1);\n\t\t}\n\t}\n\treleaseGroup(pMB);\n\treturn 1;\n}\n\nint ModelBuilder::cylinderWrap(ModelBuilder* pMB, VirtualShape* pVS, float angleFrom, float angleTo) {\n\t\/\/ angleFrom\/To - in degrees\n\tlockGroup(pMB);\n\tfloat stepZ = pVS->whl[2] \/ pVS->sections[2];\n\tfloat stepDg = (angleTo - angleFrom) \/ pVS->sectionsR; \/\/in degrees\n\tfor (int nz = 0; nz <= pVS->sections[2]; nz++) {\n\t\tfloat kz = stepZ * nz - pVS->whl[2] * 0.5f;\n\t\tfor (int rpn = 0; rpn <= pVS->sectionsR; rpn++) {\n\t\t\t\/\/ rpn - radial point number\n\t\t\tfloat angleRd = (angleFrom + stepDg * rpn) * degrees2radians;\n\t\t\tfloat kx = cosf(angleRd);\n\t\t\tfloat ky = sinf(angleRd);\n\t\t\tint nSE = addVertex(pMB, kx, ky, kz, kx, ky, 0);\n\t\t\tif (nz > 0 && rpn > 0) {\n\t\t\t\tint nSW = nSE - 1;\n\t\t\t\tint nNW = nSW - pVS->sectionsR - 1;\n\t\t\t\tint nNE = nSE - pVS->sectionsR - 1;\n\t\t\t\tadd2triangles(pMB, nNE, nNW, nSE, nSW, nz + rpn);\n\t\t\t}\n\t\t}\n\t}\n\t\/\/scale to desirable diameters\n\tmat4x4 transformMatrix = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };\n\tmat4x4_scale_aniso(transformMatrix, transformMatrix, pVS->whl[0] * 0.5f, pVS->whl[1] * 0.5f, 1);\n\tint vertsN = pMB->vertices.size();\n\tfor (int i = pMB->pCurrentGroup->fromVertexN; i < vertsN; i++) {\n\t\tVertex01* pVX = pMB->vertices.at(i);\n\t\tmat4x4_mul_vec4plus(pVX->aPos, transformMatrix, pVX->aPos, 1);\n\t}\n\treleaseGroup(pMB);\n\treturn 1;\n}\nint ModelBuilder::capWrap(ModelBuilder* pMB, VirtualShape* pVS, float angleFrom, float angleTo) {\n\t\/\/ angleFrom\/To - in degrees\n\tlockGroup(pMB);\n\t\/\/center point\n\tint n0 = addVertex(pMB, 0, 0, 1, 0, 0, 1);\n\tfloat stepZdg = 90.0f \/ pVS->sections[2]; \/\/in degrees\n\tfloat stepRdg = (angleTo - angleFrom) \/ pVS->sectionsR; \/\/in degrees\n\tfor (int nz = 1; nz <= pVS->sections[2]; nz++) {\n\t\tfloat angleZrd = stepZdg * nz * degrees2radians;\n\t\tfloat kz = cosf(angleZrd);\n\t\tfloat R = sinf(angleZrd);\n\t\tfor (int rpn = 0; rpn <= pVS->sectionsR; rpn++) {\n\t\t\t\/\/ rpn - radial point number\n\t\t\tfloat angleRd = (angleFrom + stepRdg * rpn) * degrees2radians;\n\t\t\tfloat kx = cosf(angleRd) * R;\n\t\t\tfloat ky = sinf(angleRd) * R;\n\t\t\tint nSE = addVertex(pMB, kx, ky, kz, kx, ky, kz);\n\t\t\tif (rpn > 0) {\n\t\t\t\tif (nz == 1) {\n\t\t\t\t\tint nSW = nSE - 1;\n\t\t\t\t\taddTriangle(pMB, n0, nSW, nSE);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint nSW = nSE - 1;\n\t\t\t\t\tint nNW = nSW - pVS->sectionsR - 1;\n\t\t\t\t\tint nNE = nSE - pVS->sectionsR - 1;\n\t\t\t\t\tadd2triangles(pMB, nNW, nNE, nSW, nSE, nz + rpn);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\/\/scale to desirable diameters\n\tmat4x4 transformMatrix = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };\n\tmat4x4_scale_aniso(transformMatrix, transformMatrix, pVS->whl[0] * 0.5f, pVS->whl[1] * 0.5f, pVS->whl[2]);\n\tint vertsN = pMB->vertices.size();\n\tfor (int i = pMB->pCurrentGroup->fromVertexN; i < vertsN; i++) {\n\t\tVertex01* pVX = pMB->vertices.at(i);\n\t\tmat4x4_mul_vec4plus(pVX->aPos, transformMatrix, pVX->aPos, 1);\n\t}\n\treleaseGroup(pMB);\n\treturn 1;\n}\nint ModelBuilder::groupApplyTexture2(ModelBuilder* pMB, std::string applyTo, TexCoords* pTC, bool isNormakMap) {\n\tif (pTC == NULL)\n\t\treturn 0;\n\tfloat posMin[3];\n\tfloat posMax[3];\n\tfloat posRange[3];\n\tfor (int i = 0; i < 3; i++) {\n\t\tposMin[i] = 1000000;\n\t\tposMax[i] = -1000000;\n\t}\n\tint vertsN = pMB->vertices.size();\n\tfor (int vN = pMB->pCurrentGroup->fromVertexN; vN < vertsN; vN++) {\n\t\tVertex01* pVX = pMB->vertices.at(vN);\n\t\tif (pVX->flag < 0) \/\/ignore\n\t\t\tcontinue;\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tif (posMin[i] > pVX->aPos[i])\n\t\t\t\tposMin[i] = pVX->aPos[i];\n\t\t\tif (posMax[i] < pVX->aPos[i])\n\t\t\t\tposMax[i] = pVX->aPos[i];\n\t\t}\n\t}\n\t\/\/here we have coordinates range\n\tfor (int i = 0; i < 3; i++)\n\t\tposRange[i] = posMax[i] - posMin[i];\n\t\/\/for "front"\n\tint xRateIndex = 0;\n\tbool xRateInverse = false;\n\tint yRateIndex = 1;\n\tbool yRateInverse = true;\n\tif (applyTo.find("front") == 0)\n\t\t; \/\/do nothing\n\telse if (applyTo.find("back") == 0)\n\t\txRateInverse = true;\n\telse if (applyTo.find("left") == 0)\n\t\txRateIndex = 2;\n\telse if (applyTo.find("right") == 0) {\n\t\txRateIndex = 2;\n\t\txRateInverse = true;\n\t}\n\telse if (applyTo.find("top") == 0) {\n\t\txRateInverse = true;\n\t\tyRateIndex = 2;\n\t}\n\telse if (applyTo.find("bottom") == 0)\n\t\tyRateIndex = 2;\n\n\tfloat xRate = 0;\n\tfloat yRate = 0;\n\tfloat tuvRange[2];\n\ttuvRange[0] = pTC->tuvBottomRight[0] - pTC->tuvTopLeft[0];\n\ttuvRange[1] = pTC->tuvBottomRight[1] - pTC->tuvTopLeft[1];\n\tfor (int vN = pMB->pCurrentGroup->fromVertexN; vN < vertsN; vN++) {\n\t\tVertex01* pVX = pMB->vertices.at(vN);\n\t\tif (pVX->flag < 0) \/\/ignore\n\t\t\tcontinue;\n\n\t\tif (posRange[xRateIndex] == 0)\n\t\t\txRate = 0;\n\t\telse {\n\t\t\txRate = (pVX->aPos[xRateIndex] - posMin[xRateIndex]) \/ posRange[xRateIndex];\n\t\t\tif (xRateInverse)\n\t\t\t\txRate = 1.0f - xRate;\n\t\t}\n\t\tif (posRange[yRateIndex] == 0)\n\t\t\tyRate = 0;\n\t\telse {\n\t\t\tyRate = (pVX->aPos[yRateIndex] - posMin[yRateIndex]) \/ posRange[yRateIndex];\n\t\t\tif (yRateInverse)\n\t\t\t\tyRate = 1.0f - yRate;\n\t\t}\n\t\tfloat* pTuv = pVX->aTuv;\n\t\tif(isNormakMap)\n\t\t\tpTuv = pVX->aTuv2;\n\t\tpTuv[0] = pTC->tuvTopLeft[0] + tuvRange[0] * xRate;\n\t\tpTuv[1] = pTC->tuvTopLeft[1] + tuvRange[1] * yRate;\n\t}\n\treturn 1;\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n
<\/p>\n\n\n\n