First of all I would like to apologize for my poor English. It is not my native language.
I have some doubts about isometric projection that perhaps I do not know how to describe them and I would like to appeal to your knowledge to evacuate them.
I am introducing in the area of video games, doing some research, and testing some concepts.
I am following the article on wikipedia: https://en.wikipedia.org/wiki/Isometric_projection
And the help given in this question: Rendering models in isometric view
My intention is to achieve an isometric view of a 3D world. Where (x, y, z) will be (width, length, height) of it.
X axis: horizontal: -x to the left, + x to the right.
Y axis: vertical: + and up, -y down
Z axis: + z towards the screen, -z away from the screen
This world with such an arrangement of axes is projected isometrically.
Therefore following the previous links I have made a rotation/projection matrix with the angles (-35.264º, 45º) = (atan(-1/sqrt(2), PI/4) on the X and Z axis:
M = Rx(atan(-1/sqrt(2)) * Rz(PI/4)
Where Rx and Rz are the matrices of rotations on the x and z axes respectively. With this I get the following results (rounded to 5 decimal places):
$$\begin{pmatrix} 0.70711 & -0.70711 & 0.0\\ 0.57735 & 0.57735 & 0.57735\\ -0.40825 & -0.40825 & 0.81650\end{pmatrix}$$
Now suppose I have a 1x1x1 cube whose centroid is at the origin (0,0,0). When doing the multiplication: M * V
Where V is a column matrix with the coordinates of the 8 points of the cube $$\begin{pmatrix} -0.5&0.5&-0.5&-0.5&0.5&0.5&-0.5&-0.5\\ -0.5&0.5&0.5&-0.5&-0.5&0.5&0.5&-0.5\\ -0.5&-0.5&-0.5&-0.5&0.5&0.5&0.5&0.5\end{pmatrix}$$
Instead of getting an isometry, I'm getting a dimetry! I see this when I measure the angles between the axes. And they give me 130º, 100º, 130º. When the theory says that it should get 120º, 120º, 120º. The result is:
$$\begin{pmatrix} 0.70711&0.0&-0.70711&0.0&0.70711&0.0&-0.70711&0.0\\ -0.28868&0.28868&-0.28868&-0.86603&0.28868&0.86603&0.28868&-0.28868\\ -0.40825&-0.8165&-0.40825&0.0&0.40825&0.0&0.40825&0.8165\end{pmatrix}$$
As my equipment is broken and the computer I am using is borrowed, I do not have my working tools to thoroughly test this. And I have relied on Excel and graphing by hand. At the time of drawing, and measuring the angles between the axes formed with the protractor I obtain that:
Angle XY: 100º
Angle XZ: 130º
Angle YZ: 130º
So the angle between the horizontal and X, or Y is 40º instead of being 30º
What am I doing wrong? Has the rounding of decimals in M been so marked that there is this difference in the projection?
EDIT I am attaching a photo of the resulting Viso matrix. Please excuse the poor quality of the photo, but I do not have good lighting and the camera is not entirely good.
Maybe it is not my best graph, but it is quite noticeable that the angles are not 120º as the theory indicates.
EDIT 2:
Continuing with my calculations, I decided to calculate the matrix in Wolfram Alpha to check if I was doing the steps well.
The calculated rotation / projection matrix does not differ from the one I explained previously, if we consider the rounding of decimals to 5 decimals. You can see the exact matrix at this link.
And then I proceeded to calculate the angle between the unit vectors x and y, to be surprised that it is approximately 101.5º. When making my graph, I have screwed up for only 1.5º
Now, if the angle is calculated considering the 3 dimensions of the vectors x and y, it obtains as expected 90º
This makes me uneasy since, I am following exactly the angles indicated in the sources that I have already cited previously.
What am I doing wrong?
EDIT 3:
In a basic test, trying to make the angles between the axes be 120º, I found that with a rotation angle of 60º instead of 35,264º, I achieved a very good approximation. But I will have to check my calculations well. And don't trust too much what the transporter says.
Any help I will be very grateful
EDIT 4 - 2020-04-26 (and possible self-response) :
I have set out to analyze what was happening in my calculations and rotations. I have come to an answer to this, although I am not completely sure, I have a 1% doubt and that is enough for me not to answer my own question.
Everything seems to be due to a particularity of how I am facing the design of my world (which at least for me, is natural and appropriate). My 3D world is oriented so that the axes are:
x-axis: width of the world
y-axis: Long of the world
z-axis: height of the world
And the orientation is such that:
x: horizontal
y: vertical
z: perpendicular
This is the logical representation of the world.
The theoretical development indicates that the isometric projection is obtained by making two rotations (atan(1/sqrt(2), pi/4) on the axes (x,z).
But since my z axis is rotated with respect to x by 90º (pi/2) instead of applying atan(1/sqrt(2)), it must be the complementary angle of this: acos(1 /sqr(3)).
Furthermore, the angle must be negative to obtain a view from the top. Otherwise you get a view from the bottom to the top.
Therefore the angle sought is -cos(1/sqrt(3)), which is approximately -54.7356º.
With this new angle when applying the combined rotation Rx*Rz we obtain the correct matrix.
And now you can see a correct symmetrical projection instead of an "approximate" dimetry. The calculations of the angle between the unit axes can be made and they will be able to verify that the angles will indeed be 90º between them. In a similar way, it can be verified that if we take columns of this matrix as vectors the coordinates (x, y) and measure the angle between them and it will effectively be 120º.
You can use the widget in Wolfram Alpha in case you want to check the latter.
The development I made to get to this angle is much longer. What I exposed here is the short story.
I wasn't testing silly angles. Instead I went in the opposite direction, starting from what the resulting matrix should look like, and analyzing what values meet the conditions of the angles for an orthogonality, as well as the projection (x, y) being 120º.
At my first impression, it was a mere coincidence that the final angle for rotation in Rx () is the complement of atan(1/sqrt(2))
If the reasoning that I have carried out is sufficient to finish the topic, and if it turns out to be interesting for others, I can explain the analytical procedure of how this famous angle is reached. For this instead of editing, I will give a formal answer to my question.
I think a good time has passed, and to tell the truth I am a little disappointed because this has become a monologue. And my intention is that someone else could explain to me what was wrong. It must be that my question is not attractive enough, or that such an exhaustive and detailed description of my problem is boring.