Here's the whole thing basically:
Code: Select all
driver->beginScene(true, true, SColor(0,48,48,48));
vector3df target = camera->getTarget(); // (0,0,100)
vector3df pos = camera->getAbsolutePosition(); // (0,0,0)
vector3df test(-1.0, -1.0, 0.0);
vector3df test2(-1.0, -1.0, 1.0);
vector3df test3(0, 0, 1.0);
vector3df test4(-1.0, -1.0, 0.5);
vector3df test5(-1.0, -1.0, 1.5);
vector2di res;
res = collision->getScreenCoordinatesFrom3DPosition(test); // (-17,913)
res = collision->getScreenCoordinatesFrom3DPosition(test2);// (-17,913) Shouldn't one of these two be (0,768)?
res = collision->getScreenCoordinatesFrom3DPosition(test3);// (512, 384) good
res = collision->getScreenCoordinatesFrom3DPosition(test4);// (-545, 1441) Uh?
res = collision->getScreenCoordinatesFrom3DPosition(test5);// (-160, 736) Close, I guess?