Can someone help me understand what is going on with my 3D. I'm trying to use a left handed coordinate system like this :
RGB is XYZ of a Left Handed coordinate system. What I get is the purple vector instead, with left and right completely reversed.
{"name":"611851","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/d\/dd515541d9190f8ac1c7788c01a47690.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/d\/dd515541d9190f8ac1c7788c01a47690"}
You can clearly see in my program, that positive x goes left :
{"name":"611852","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/8\/686905ed95760d4d392c2b05243133cf.png","w":902,"h":633,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/8\/686905ed95760d4d392c2b05243133cf"}
I'm using al_build_camera_transform to setup my camera.
Also, I have a question, should I apply the rotation scale translation transformation before or after the camera transform? Right now I apply it before, but that seems wrong. I use al_compose_transform to add the camera to my transform before rendering.
I understand there are 8 possible combinations of axes, but how do I specify my specific XYZ configuration to OpenGL? Do I need to use gluLookAt()? What does al_build_camera_transform do? Is it inverting my coordinates?
I've tried multiple things to "fix" this, but none of them work. I've applied negative scale transforms to x and z and nothing works. Half the time my things are inside out.
Oh and one more thing, which way does al_rotate_transform rotate? Ie if the vector is pointing forward, is positive clockwise?
I also realize that left handed and right handed are essentially the same, only with axes switched. So maybe my XYZ is not left handed either? I am getting confused, and I'm tired of the left side being on the right and the right side being on the left.
EDIT
Also, bonus points if anyone can figure out why characters in my font are disappearing. I know it's something to do with OpenGL but I can't figure it out.
OpenGL uses a Right-handed coordinate system (and so does Direct3D nowadays), the camera is at (0,0,0) and points towards negative Z (positive X goes right and positive Y goes up).
y | !____x / / z
Okay, here are the fixes I got from elias on IRC on #allegro :
1. Call glGetError() before calling allegro font drawing routines, because they will skip glyphs if there is an error.
2. Flip l and r in al_perspective_transform so r is negative and l is positive, or greater than r. This flips the x axis so it does what I want.
Thank you Mr-Hide for the explanation.
My model is fixed now and ready to save as an .obj file and edit it in blender.
{"name":"611853","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/5\/85b9d6bc3377848b1157f7e8e5720066.png","w":902,"h":633,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/5\/85b9d6bc3377848b1157f7e8e5720066"}