Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (467)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Migrating from Java2D to LWJGL  (Read 6236 times)
0 Members and 1 Guest are viewing this topic.
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #30 - Posted 2005-01-21 13:09:55 »

I'm an idiot.

"To give the appearance of moving the camera, your OpenGL application must move the scene with the inverse of the camera transformation"

You guys are right. Reading a few lines of text instead of pages of text can help me learn.

http://www.opengl.org/resources/faq/technical/viewing.htm

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
GL11.glPushMatrix();
            GL11.glBindTexture(GL11.GL_TEXTURE_2D, SpriteLoader.getInstance().getSprite(0));
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glTranslatef(-x, -y, 0);
           
            GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_ZERO);
           
            GL11.glBegin(GL11.GL_QUADS);
            {
                  GL11.glTexCoord2f(0, 0);
                  GL11.glVertex2f(x, y);
                 
                  GL11.glTexCoord2f(1, 0);
                  GL11.glVertex2f(x - width, y);
                 
                  GL11.glTexCoord2f(1, 1);
                  GL11.glVertex2f(x - width, y - height);
                 
                  GL11.glTexCoord2f(0, 1);
                  GL11.glVertex2f(x, y - height);
            }
            GL11.glEnd();
           
            GL11.glPopMatrix();


This moves my player and moves the camera.

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline tom
« Reply #31 - Posted 2005-01-21 13:21:41 »

I've started porting Rimscape to LWJGL and I have to say that it can difficult. First you have to make the game single threaded. Or atleast making sure you only call GL from one thread. Fonts are a pain in the ass. Not only do you need to generate a bitmap font, you need to emulate the FontMetrics stuff. Then there might be Java2D functions like rounded rectangles and stuff. It all adds up.

Although I've taken some shortcuts with Rimscape. Alot of stuff are still rendered using Java2D and uploaded to OpenGL using textures.

Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #32 - Posted 2005-01-21 13:31:23 »

Quote
If it only was that easy Tongue Remember OpenGL does a full conversion from world coords into eye space, then into screen space (probably with a normalised view volume in there somewhere internally). World->eye is performed differently based on the projection matrix, but still uses (and retains) all axies. Only eye->screen drops the z axis, but will do so regardless of the projection mode.


This is true enough, but I was trying not to confuse her with 3D rotations and camera movement. Especially since the question was more or less focused on the projection itself. Unfortunately, it seems she ended up getting confused about it anyway. :-)

K.I.L.E.R.: The way I like to think about 3D space is that you don't so much as move the camera, as you move the world around you. Remember, every vertex in the universe is rotated and transformed until point 0,0,0 with +z look at, is the location of the player. It kind of boggled my mind the first time I figured that out. I just sat there and thought: "But that's a LOT of vertexes to transform!" Guess that's why they invented 3D cards. ;-)

Java Game Console Project
Last Journal Entry: 12/17/04
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

JGO Kernel


Medals: 85
Projects: 22


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #33 - Posted 2005-01-21 13:32:21 »

Maybe, thats only really because you're trying to directly port it rather than migrate it to GL tho?

Kev

Offline tom
« Reply #34 - Posted 2005-01-21 15:22:07 »

Quote
Maybe, thats only really because you're trying to directly port it rather than migrate it to GL tho?

Kev

True. If you start off with LWJGL from the starts, you don't have to jump threw Java2D hoops.

Btw, how do you interprite the differance between migrate versus porting a game?

Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #35 - Posted 2005-01-21 15:25:44 »

Do you need significant OpenGL training to use LWJGL when your game processes 2D only?

Offline kevglass

JGO Kernel


Medals: 85
Projects: 22


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #36 - Posted 2005-01-21 15:35:00 »

Quote

Btw, how do you interprite the differance between migrate versus porting a game?


Now thats a question worth of a post (finally!) Smiley

Kev

Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #37 - Posted 2005-01-21 16:05:40 »

Quote

True. If you start off with LWJGL from the starts, you don't have to jump threw Java2D hoops.

Btw, how do you interprite the differance between migrate versus porting a game?

I think porting means that you want to adapt the code of your game to the new APIs/platform with minimal efforts. This solution might be worth for money for the short term but not very good for code maintenance.

Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #38 - Posted 2005-01-21 17:25:10 »

Quote



Now thats a question worth of a post (finally!) Smiley

Kev


Even though you don't answer it. :lol:

Migrate: Change your work to fit LWJGL (IE: modify your one and only rendering path to use LWJGL).

Port: Add LWJGL as a code path into your work without actually changing your current code. You're just adding to it.

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #39 - Posted 2005-01-21 18:37:16 »

er, K.I.L.E.R., when did you suddenly morph into a "woman"?

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #40 - Posted 2005-01-21 18:46:15 »

Quote
er, K.I.L.E.R., when did you suddenly morph into a "woman"?


Cas! Shame on you! Asking a lady about her age, how could you? ;-)

Actually, she's had the female symbol on there this whole time. I'm surprised you haven't noticed it. I've referred to her in the female tense, and Malokhan even mentioned they were dating.

I'm thinking it's just the unconscious shock of seeing females in game programming. There are a rather disproportionate number of males in game programming. :-( Pay attention, though. There are a few other women hanging around here.

K.I.L.E.R., while we're talking about you, what does your nick stand for? I've never seen the acronym before and it's killing me trying to figure it out! The only thing I know is that Kiler is a Polish name that sounds a lot like "killer" in English. Any enlightenment? :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #41 - Posted 2005-01-22 00:41:13 »

It's, er, her style of writing... rather, hm, more like a bloke... and a bloody loony! Mind you that would explain it...

Cas Smiley

Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #42 - Posted 2005-01-22 03:25:21 »

My nick stands for Kinetic Intelligent Lifeform Engineered for Repair.

You should ask Java Cool Dude about me. He knows everything. Wink

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline kevglass

JGO Kernel


Medals: 85
Projects: 22


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #43 - Posted 2005-01-22 12:05:47 »

Quote

You should ask Java Cool Dude about me. He knows everything.  


Ah ha, suddenly it all falls into place!

Kev

Offline SpuTTer

Senior Member


Medals: 1


Lazy Middle Class Intellectual


« Reply #44 - Posted 2005-02-23 20:22:54 »

So I noticed today K.I.L.E.R is male 'again?'....


Sacramento Volleyball
"Whitty phrase goes here."
Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #45 - Posted 2005-02-23 20:36:23 »

Ahh yes and I think I better note again that I never said we were dating.  That was something someone simply misread.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Pages: 1 [2]
  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.

xsi3rr4x (81 views)
2014-04-15 18:08:23

BurntPizza (73 views)
2014-04-15 03:46:01

UprightPath (84 views)
2014-04-14 17:39:50

UprightPath (67 views)
2014-04-14 17:35:47

Porlus (84 views)
2014-04-14 15:48:38

tom_mai78101 (107 views)
2014-04-10 04:04:31

BurntPizza (167 views)
2014-04-08 23:06:04

tom_mai78101 (263 views)
2014-04-05 13:34:39

trollwarrior1 (214 views)
2014-04-04 12:06:45

CJLetsGame (223 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!