K.I.L.E.R
Senior Devvie   
Java games rock!
|
 |
«
Reply #30 - Posted
2005-01-21 12: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.htm1 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. 
|
|
|
tom
|
 |
«
Reply #31 - Posted
2005-01-21 12: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.
|
|
|
|
jbanes
|
 |
«
Reply #32 - Posted
2005-01-21 12:31:23 » |
|
If it only was that easy  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. ;-)
|
|
|
|
Games published by our own members! Check 'em out!
|
|
kevglass
|
 |
«
Reply #33 - Posted
2005-01-21 12:32:21 » |
|
Maybe, thats only really because you're trying to directly port it rather than migrate it to GL tho?
Kev
|
|
|
|
tom
|
 |
«
Reply #34 - Posted
2005-01-21 14:22:07 » |
|
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?
|
|
|
|
TheAnalogKid
|
 |
«
Reply #35 - Posted
2005-01-21 14:25:44 » |
|
Do you need significant OpenGL training to use LWJGL when your game processes 2D only?
|
|
|
|
kevglass
|
 |
«
Reply #36 - Posted
2005-01-21 14:35:00 » |
|
Btw, how do you interprite the differance between migrate versus porting a game?
Now thats a question worth of a post (finally!)  Kev
|
|
|
|
TheAnalogKid
|
 |
«
Reply #37 - Posted
2005-01-21 15:05:40 » |
|
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.
|
|
|
|
K.I.L.E.R
Senior Devvie   
Java games rock!
|
 |
«
Reply #38 - Posted
2005-01-21 16:25:10 » |
|
Now thats a question worth of a post (finally!)  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. 
|
|
|
princec
|
 |
«
Reply #39 - Posted
2005-01-21 17:37:16 » |
|
er, K.I.L.E.R., when did you suddenly morph into a "woman"? Cas 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
jbanes
|
 |
«
Reply #40 - Posted
2005-01-21 17:46:15 » |
|
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? :-)
|
|
|
|
princec
|
 |
«
Reply #41 - Posted
2005-01-21 23: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 
|
|
|
|
K.I.L.E.R
Senior Devvie   
Java games rock!
|
 |
«
Reply #42 - Posted
2005-01-22 02:25:21 » |
|
My nick stands for Kinetic Intelligent Lifeform Engineered for Repair. You should ask Java Cool Dude about me. He knows everything. 
|
Vorax: Is there a name for a "redneck" programmer? Jeff: Unemployed. 
|
|
|
kevglass
|
 |
«
Reply #43 - Posted
2005-01-22 11:05:47 » |
|
You should ask Java Cool Dude about me. He knows everything.
Ah ha, suddenly it all falls into place! Kev
|
|
|
|
SpuTTer
|
 |
«
Reply #44 - Posted
2005-02-23 19:22:54 » |
|
So I noticed today K.I.L.E.R is male 'again?'....
|
|
|
|
Malohkan
|
 |
«
Reply #45 - Posted
2005-02-23 19:36:23 » |
|
Ahh yes and I think I better note again that I never said we were dating. That was something someone simply misread.
|
|
|
|
|