So I'm trying to make a simple 3D game in Allegro5 and I'm stuck trying to make the camera class work.
Here's my loop:
and here are the 2 functions:
pt_width = tan(
pt_width / double((double)al_get_display_width(
pt_width, pt_width, lpg_default_near,
pt_height, pt_height, lpg_render_distance);
The camera seems tilted and the FOV very limited (I attached the program to give you an idea), so I'm clearly doing something wrong here. I can't really see what's exactly causing the problem, though.
Does anyone know what's wrong?
EDIT: I'm an idiot, I looked at the documentation and realized I was passing arguments to al_perspective_transform in the wrong order Also, al_rotate_transform_3d() calls needed to be swapped. The camera is working perfectly now. I can't reply or delete this thread AFAIK, so I'm leaving it here