I am moving around my “image” by specifying the XYZ-Coordinates of my view-point (obtained interactively) which is then used as the Eye-Coordinates in gluLookAt which has the center-coordinates always as 0,0,0 and the Vertical coordinates appropriately set via the following code (in VB):
xEye = xRot: yEye = yRot: zEye = zRot
xVer = 0: yVer = 0: zVer = 1
If xRot = 0 And yRot = 0 Then
yVer = zRot: zVer = 0
End If
So far everything works perfect.
Then I’ve added a little XYZ-Axis, each having a different color, in a corner of my window in order to know and see the where about of my view-point. In doing this, having done the gluLookAt, I TRANSFER to a corner and then draw three lines (each 10 units in length) along the X-, Y- and Z-Axis with corresponding color for each one.
Again, so far so good!
Then I decided to add the Axis-Letter at the end of each axis as UPRIGHT and FACING ME and the problem started. In doing this, obviously, I had to transfer to (10,0,0) and write “X”, transfer to (0,10,0) and write “Y” and transfer to (0,0,10) and write “Z”, after the gluLookAt and TRANSFER to the CORNER call.
The problem is that the letters are not shown as expected and I have to call another gluLookAt with another set of Eye-Coordinates and Vertical-Coordinates (the center being kept at 0,0,0!?!?) which are set up via the following code:
xEyeC = 0#: yEyeC = 1#: zEyeC = 0#
xVerC = 0#: yVerC = 0#: zVerC = Sgn(yRot)
If yRot = 0 And xRot <> 0 Then
xVerC = Sgn(xRot): zVerC = 0#: zEyeC = Sgn(zRot)
ElseIf xRot = 0 And yRot <> 0 Then
zEyeC = Sgn(zRot)
ElseIf xRot = 0 And yRot = 0 And zRot <> 0 Then
yEyeC = 0#: zEyeC = Sgn(zRot)
yVerC = Sgn(zRot): zVerC = 0#
ElseIf xRot = 0 And yRot = 0 And zRot = 0 Then
zVerC = -1#
End If
But still, out of 26 (Unit) View-Points:
-1,-1,-1
-1,-1,0
-1,-1,1
-1,0,-1
-1,0,0
-1,0,1
-1,1,-1
-1,1,0
-1,1,1
0,-1,-1
0,-1,0
0,-1,1
0,0,-1
0,0,1
0,1,-1
0,1,0
0,1,1
1,-1,-1
1,-1,0
1,-1,1
1,0,-1
1,0,0
1,0,1
1,1,-1
1,1,0
1,1,1
some like (1,1,1) show the Axis-Letters as “Skewed” (i.e. tilted and/or rotated to some extent) PLUS when I use non-unit View-Points such as (1,2,3), the problem gets worse (while the image is viewed correctly)!?!?!
Is there a simple and more effective way of “drawing text as UPRIGHT and FACED TO USER in an ‘rotaing space’ created by gluLookAt”?
My highest appreciation is attached.