C++ & Math
Quick Question: Im 16 years old student who is bad at maths but want to learn programing and software engineering ! Can i learn C++ without math or other langueges ?
bool world_to_screen(v3 pos, v2& out)
{
v3 tmp;
float* viewMatrix = CHooking::m_viewPort->fViewMatrix;
tmp.x = (viewMatrix[0] * pos.x) + (viewMatrix[4] * pos.y) + (viewMatrix[8] * pos.z) + viewMatrix[12]; //row 2
tmp.y = (viewMatrix[1] * pos.x) + (viewMatrix[5] * pos.y) + (viewMatrix[9] * pos.z) + viewMatrix[13]; //row 3
tmp.z = (viewMatrix[2] * pos.x) + (viewMatrix[6] * pos.y) + (viewMatrix[10] * pos.z) + viewMatrix[14]; //row 4
if(tmp.z < 0.001f)
return false;
tmp.z = 1.0f / tmp.z;
tmp.x *= tmp.z;
tmp.y *= tmp.z;
int32_t w = (int32_t) CHooking::m_resolution->w,
h = (int32_t) CHooking::m_resolution->h;
out.x = ((w / 2.f) + (.5f * tmp.x * w + 1.f)) / w;
out.y = ((h / 2.f) - (.5f * tmp.y * h + 1.f)) / h;
if(out.x > 1.f || out.x < 0.f || out.y > 1.f || out.y < 0.f)
return false;
return true;
}