-
Notifications
You must be signed in to change notification settings - Fork 13
Talking about coordinates systems for 2D & 3D #33
Comments
With this, I also don't think having a |
I'd probably have to go back and updated the default origin for ZSprite frames to be at the center isntead of (0, 0) then. (And I'd have to update the sample "Blau Gesit," as well). I don't think that would be too difficult to fixup. I do want a decision on this soon. |
Sorry for not responding earlier. I went camping for the the long weekend and was too exhausted yesterday to do any coding.
Your assumptions basically nailed how they work presently. 2d mode uses a left handed coordinate system with 0, 0 is the top left of the screen. By default we are looking down negative Z, so positive Z is coming out of your screen. Now there is nothing stopping a user from using Does that make sense? To your point on the camera, I read your other suggestion about merging them and we could and then just have separate modes - Orthogonal | Perspective. I'll mark this as an issue and move it to the top along with the timer module in terms of priority. |
Yeah that sounds good. When this is done I'll write up a small doc and a drawing or to to explain the two different systems. Also, is there a |
Umm I'm not sure if there is but I'll cook up an example of drawing textures in 3d space. |
Can you formalize a doc somewhere that explains the coordinate system? It doesn't really make sense to have this ticket lying around. |
I originally asked about this in issue #13, but can we talk about this a little more and leave some documentation around?
So as of right now I see that there is a 2D & 3D mode. Signified by the
begin2d()
andbegin3d()
procs. What are their respective coordinate systems?I can understand if we want to use the flipped (x-axis) Cartesian graph (where (0, 0) is in the top left of the screen) for 2D drawing. As it is a very well known system. I think this is good for things like HUDs, GUIs, and other whatnot. Or if anyone is only comfortable making a game using that coordinate system, though I think that should be discouraged.
But when talking about sprites, static textures, and other things, I think they should be freely movable in a 3D space, where (0, 0) is at the center of the screen and we're using a standard Cartesian graph. We can toggle on/off an orthogonal camera. Are we looking down Z+ or Z- by default?
We also need to talk about origin points as well.
And since I posted this question earlier Here is that original question about sprite origins posted for reference:
Should all 3D objects obey this rule where there origin (unless otherwise noted) is at their geometric center? This includes sprites and static textures.
E.g. If I render a static texture at (0, 0). In 2D mode it's origin will be at (0, 0) and be put in the top left of the screen. But in 3D mode, it will place that texture smack dab in the center of the screen.
The text was updated successfully, but these errors were encountered: