F
Freddie The Potato
Guest
I've created 2 cameras.
A cameraController object updates mainCamera's view and projection matrices every frame based on its position and rotation.
I can draw the scene onto a surface like so:
It works as expected.
However, something strange happens when I do this:
Everything is drawn upside down
I have no idea why this happens. In both instances the same view and projection matrices are being used. (Or so I think. Maybe camera_get_view_mat is giving me a modified matrix??)
Any tips would be greatly appreciated!
Code:
global.mainCamera = cameraCreate();
global.utilityCamera = cameraCreate();
I can draw the scene onto a surface like so:
Code:
surface_set_target(surf);
draw_clear_alpha(0, 0);
camera_apply(global.mainCamera);
with (objDrawable) {
event_perform(ev_draw, 0);
}
surface_reset_target();
However, something strange happens when I do this:
Code:
camera_set_view_mat(global.utilityCamera, camera_get_view_mat(global.mainCamera));
camera_set_proj_mat(global.utilityCamera, camera_get_proj_mat(global.mainCamera));
surface_set_target(surf);
draw_clear_alpha(0,0);
camera_apply(global.utilityCamera);
with (objDrawable) {
event_perform(ev_draw, 0);
}
surface_reset_target();
I have no idea why this happens. In both instances the same view and projection matrices are being used. (Or so I think. Maybe camera_get_view_mat is giving me a modified matrix??)
Any tips would be greatly appreciated!