Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
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  
  Why do you hate me? :(  (Read 3814 times)
0 Members and 1 Guest are viewing this topic.
Offline K.I.L.E.R

Senior Member




Java games rock!


« Posted 2005-01-16 06:50:39 »

jME's site is unavailable again.
The intarweb is plotting against me. Angry

Damn! I was also about to ask a question on the forums there.

Thankfully jME has 2 forums. Cheesy
I'll ask here.

How good is jME at pure 2D rendering?

I REALLY HATE using OpenGL as the explanations on anything are so raw that it's simply useless to look at documentation.

There is NOT a single document that had told me that glOrtho transforms the 2D space coordinates to 0,0 being on the top left corner of the screen rather than bottom left.

I had to search rigorously for anything remotely helpful to get an explanation.

I don't just want to *use* OpenGL, I want to understand it too.
Too bad there are no tutorials on the web that explain OpenGL.

I've searched sites like NeHe and they don't offer any real explanations on how this and that works, all they offer are "this is how you use this" and that's it.

Just recently I figured out how to get a texture to display in it's original state and no one would help me with it.

For those who want to know: imgSize * 2 / screenSize

imgWidth * 2 / scrnWidth
imgHeight * 2 / scrnHeight

You see here is a fundamental problem with tutorials, they don't explain how to get an image to display in GL as in Windows.

Why do I have to multiply the original image size by 2?
Why do I have to divide twice the image size by the screen size?

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

Jeff:
Unemployed. Wink
Online princec

JGO Kernel


Medals: 362
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2005-01-16 07:16:33 »

I still don't get why the NeHe tutorials aren't helping you :/ What about Kev's Space Invaders tut?

Cas Smiley

Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #2 - Posted 2005-01-16 07:21:15 »

Quote
I still don't get why the NeHe tutorials aren't helping you :/ What about Kev's Space Invaders tut?

Cas Smiley


That helped a little.

NeHe's tutorials doesn't explain what I want to know.

For instance, NeHe explains that to do sprite masking you would use glBlendFunc(source, destination).
Though it doesn't explain anything beyond that.

I look through GL docs and I see a table.
(1, 1, 1, 1) - (s, s, s, s) in the format of integers (R, G, B, A).

Fair enough BUT if I have a colour white (255, 255, 255, 0) and I take 1 bit from each value my final pic would be 1 minus every bit value, (254, 254, 254, 0).

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

Jeff:
Unemployed. Wink
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #3 - Posted 2005-01-16 07:23:53 »

>There is NOT a single document that had told me that
>glOrtho transforms the 2D space coordinates to 0,0 being
>on the top left corner of the screen rather than bottom left.

Yea, there isn't a single document like that... because you can set it up how you want to. I like having my 0/0 in the upper left... and Cas (iirc) prefers the bottom left. It's just a matter of -1 or 1.

>imgSize * 2 / screenSize

Huh?

> (1, 1, 1, 1)

That's actually 1.0, 1.0, 1.0, 1.0... normalized values (range from 0.0 to 1.0... so 1.0 would be 255 as int representation).

弾幕 ☆ @mahonnaiseblog
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #4 - Posted 2005-01-16 08:03:01 »

Quote
>There is NOT a single document that had told me that
>glOrtho transforms the 2D space coordinates to 0,0 being
>on the top left corner of the screen rather than bottom left.

Yea, there isn't a single document like that... because you can set it up how you want to. I like having my 0/0 in the upper left... and Cas (iirc) prefers the bottom left. It's just a matter of -1 or 1.


So basically the first 4 values I pass into glOrtho are the current coordinate system and it will turn them into the new set of coords?

What about the last 2 variables, "near" and "far" as GL documentation calls them?


>imgSize * 2 / screenSize

Huh?


That's the formula to set the opengl to use original width and height of the texture inside your program.


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
GL11.glPushMatrix();
            GL11.glBindTexture(GL11.GL_TEXTURE_2D, memoryAddress);
           
            GL11.glTranslatef(x, y, 0);
           
            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();


imgWidth = 64 pixels
imgHeight = 64 pixels

width = (imgWidth * 2) / ScreenRes.getWidth()
height = (imgHeight * 2) / ScreenRes.getHeight();

> (1, 1, 1, 1)

That's actually 1.0, 1.0, 1.0, 1.0... normalized values (range from 0.0 to 1.0... so 1.0 would be 255 as int representation).


Oh okay, I thought that would be the case. I still have no freaking clue how to just get rid of the colour white.

I use this:
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_ZERO);
It gets rid of the white and mask's my image but at the same time my image is darker. :-/

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

Jeff:
Unemployed. Wink
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #5 - Posted 2005-01-16 16:10:15 »

Quote
jME's site is unavailable again.  
The intarweb is plotting against me.


Tell me about it. This time last year I would have strongly recommended ipowerweb.com for hosting services... no longer.

Quote
How good is jME at pure 2D rendering?


to do this in jME you'd just create a number of quads with alpha states attached to them. Set them to render in the ortho queue, and you're good to go. DarkProphet has done something similar to his Galaga style game.

Don't send a man to do a monkey's work.
Offline cyberyoyo

Junior Member




Java games funk


« Reply #6 - Posted 2005-01-16 16:15:10 »

Quote


That helped a little.

NeHe's tutorials doesn't explain what I want to know.

For instance, NeHe explains that to do sprite masking you would use glBlendFunc(source, destination).
Though it doesn't explain anything beyond that.

You have a nice OpenGL doc here
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #7 - Posted 2005-01-16 20:47:52 »

Thanks.

If I screw up bigtime at least I know where I can fall back to. Smiley

I will attempt to right my own renderer for now.

Quote


Tell me about it. This time last year I would have strongly recommended ipowerweb.com for hosting services... no longer.


to do this in jME you'd just create a number of quads with alpha states attached to them. Set them to render in the ortho queue, and you're good to go. DarkProphet has done something similar to his Galaga style game.


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

Jeff:
Unemployed. Wink
Offline K.I.L.E.R

Senior Member




Java games rock!


« Reply #8 - Posted 2005-01-16 20:52:31 »

Thanks. Now that's more like it. Smiley

Quote

You have a nice OpenGL doc here


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

Jeff:
Unemployed. Wink
Offline winkman

Senior Newbie




Java games !


« Reply #9 - Posted 2005-01-17 06:30:07 »

@ mojomonk:  Do You have any hints when it's up again ?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #10 - Posted 2005-01-17 12:34:11 »

I've contacted them twice now, and am getting the "Our System Administrators know of the problem and are working on fixing it. Thank you for your patience."

That was 2 days ago... it should be any time.  :-/

Don't send a man to do a monkey's work.
Offline Per_T

Senior Newbie





« Reply #11 - Posted 2005-01-17 19:31:49 »

Seem to be semi working now: site up, forum down...
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #12 - Posted 2005-01-17 19:37:44 »

They totally jacked up bringing up the mysql tables. Forum is completely corrupted and missing all posts (users, message count, etc is fine). They also used a backup that was apparently a few hours older than when the site went down. Which, guess what, was when I was doing major changes. Two LARGE blog entries about 0.9 progress, and a major site change (organizing the demo section) are now lost.

I made the decision to run the site off of three sql databases, one for the forum, one for the main page, and one for the journal. I'm wondering if that was a mistake, IPowerweb can't seem to keep MySQL running for more than a week at a time.

At least my mail is back up...  Tongue

Anyways, I've contacted them AGAIN regarding the forums database, and hopefully they will resolve it. I won't be suprised if we lose a few posts.

My contract with IPowerweb ends in March... there may be some major changes then.

Don't send a man to do a monkey's work.
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.

atombrot (27 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!