Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Y oh Y, or which way should the Y axis go in my new game engine  (Read 3330 times)
0 Members and 1 Guest are viewing this topic.
Offline BBjam

Junior Newbie





« Posted 2008-10-21 20:05:41 »

I am writing a 2d game engine, http://glass-flame.blogspot.com, and before I get any further I want to ask whether the +y axis should go up or down, and where the point 0,0 should go.

The view will behave as window in to a world that may be much bigger than what you can see, so I was thinking the 0,0 maybe should go in the middle, what do you think?
Offline Addictman

Senior Devvie


Medals: 3
Projects: 1


Java games rock!


« Reply #1 - Posted 2008-10-21 20:59:47 »

I personally prefer 0,0 of the "canvas" / "window" being in the top-left corner. OpenGL has it in the lower left corner, and sometimes this gets confusing (for instance when using the TextRenderer in JOGL), but top-left is Java's 0,0.

I otherwise work with 0,0 as a middle point when drawing objects in JOGL. Not because I necessarely like it, but because it makes rotation and scaling of the object so much easiar.
Offline BBjam

Junior Newbie





« Reply #2 - Posted 2008-10-31 03:49:25 »

I don't like having the Y 'upside down', but if people think that game programmers will prefer it, then that's what I will do.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #3 - Posted 2008-10-31 07:33:33 »

I find that I think that down is positive from all the games I've programmed. However, it's an easy switch to make (right now the project I'm working on is the opposite).

See my work:
OTC Software
Offline CommanderKeith
« Reply #4 - Posted 2008-10-31 09:13:27 »

Yeah it's pretty annoying the way the y-axis is inverted, it makes trigonometry pretty difficult. But since java2D has the y-axis upside down, you may as well go with that since everyone's used to it and their existing code assumes this.

By the way, I'd first make a 2d game, then pull the stuff out that you'd like to make into an engine. Doing it the other way around can stunt your productivity. By the looks of your blog you're pretty talented at pulling off nice-looking art etc so you'd be able to pretty quickly get something up and running that looks good. That's cool that you're using JBox2D, that'll make your demos look awesome.

Offline DzzD
« Reply #5 - Posted 2008-10-31 17:39:12 »

this is really up to you, personnaly I prefer y=0 and x=0 at the center of the screen with y pointing up and x pointing right, I found such axis easier to manage.

EDIT:
maybe, the only requierment is that you show the direction of your y vector in your documentation  and samples of your engine

Offline BBjam

Junior Newbie





« Reply #6 - Posted 2008-11-12 01:52:46 »

OMG someone actualy read my blog, and liked it to! Thanks.

I think I will go with Y just like Java 2d, because that should make it easer to use. What do you people think of making the coordinate system configurable when you create the game engine object?
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #7 - Posted 2008-11-12 01:53:55 »

OMG someone actualy read my blog, and liked it to! Thanks.

I think I will go with Y just like Java 2d, because that should make it easer to use. What do you people think of making the coordinate system configurable when you create the game engine object?
That's a good idea. Or at least allow translations.

See my work:
OTC Software
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (24 views)
2014-11-25 11:26:43

Gibbo3771 (22 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (74 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (41 views)
2014-11-12 21:09:33

kovacsa (69 views)
2014-11-07 19:57:14
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!