Re: 3D coordinate system with Z=Up - rotation directions and starting axis ?
Paul <[email protected]> Sun, 26 Jan 2025 15:20:49 -0500
| Newsgroups | comp.os.ms-windows.programmer.win32,alt.comp.os.windows-xp,alt.windows7.general |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
On Sun, 1/26/2025 7:17 AM, R.Wieser wrote:
> Paul,
>
>>> What I'm looking for, for both the Y=up and Z=Up coordinate systems :
>>>
>>> rotation directions for all three axis/planes, as well as starting axis*.
> ...
>> https://www3.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html
>
> Have you noticed that that doesn't talk about even just the angle origin of
> the Up-axis, let alone the Horizontal and perpendicular-to-the-screen ones ?
> :-(
>
> I've just spend yesterday evening and the better part of this morning (upto
> now) going thru webpage-after-webpage, and have only been able to find an
> indirect reference to what the origin of the Up-axis rotation angle
> (probably) is (the +X axis).
>
>> Try it their way and see if it works ?
>
> How ? Their "3D Graphics Coordinate Systems" chapter is two short
> paragraphs with a picture of how they set up their axis, but nothing else.
> :-| (I did search the OpenGL webpage for both "angle" as well as "rotation"
> and found nothing relevant to my question)
>
> That was why I had to pick my own angle directions and origins thereof.
> Camera movement works fine with them.
>
> And yes, that Y=Up was what I implemented first and on what I based my Z=Up
> version, after which I noticed that the data I extracted from a game doesn't
> match up with it angle wise.
>
> Hence my question. Any idea ?
>
> Regards,
> Rudy Wieser
>
>
I would investigate my environment graphically.
Here, someone is experimenting with his impression of what spherical
coordinates would be. He defines a theta, a phi, a radius R. The math is
wrong, because one trip around the sphere is 2*PI and the routines do not
use degrees the way he is attempting to do it. Instead of 0..360 degrees,
his loops should investigate 0..2PI for the spherical coordinates.
We would set the r=1 for the purposes of plotting points on the unit sphere.
https://stackoverflow.com/questions/61302642/using-spherical-coordinates-in-opengl
float x = r * sin(theta) * cos(phi);
float y = r * sin(theta) * sin(phi);
float z = r * cos(theta);
Part of the fun of your first attempts at three-space, is setting the Viewpoint.
what you see in the frame won't make much sense, unless the view point is
in a good spot. You could for example, select 45 degrees, 45 degrees, radius anywhere
from 2..10 units, and then "watch" as you draw elements on the unit sphere.
Paul