Hello, I'm using the getScreenCoordinatesFrom3DPosition() for a camera and each time I use the printf function to display the 2d coordinates, it always returns 0.00000. Any ideas why this happening?
Are you positive that those world coordinates are on the screen at any time, it's possible that you miss them...
Maybe you should test it with a static camera (non FPS) and set the target to the same position that you're passing to that function and then i guess you should get something like 0.5,0.5 returned.
Thanks for your reply. I used a static camera and had it point to the coordinates of a node. Then I used the getScreenCoordinatesFrom3DPosition(node->getPosition()) to read the node's coordinates and translate them to 2d Screen Coordinates. Alas, it again returned 0.000 when doing a printf("%f",coord.X);
Note, I dont know if this could be a problem, but I'm using a windowed mode. Any help is appreciated. Thanks.
THe coordinates are being read, I'm able to move a node based on the mouse position, however, I just can't display it using printf(). But the get2d position function does work.
Both getScreenCoordinatesFrom3DPosition() and cursor->getPosition() return a position2d<s32>. That means that the type of b.X is s32, not f32, so you need to use the correct printf() format specifier [use %d or %i instead of %f].