Why do you hate me? :(

jME’s site is unavailable again.
The intarweb is plotting against me. >:(

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

Thankfully jME has 2 forums. :smiley:
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?

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

Cas :slight_smile:

[quote]I still don’t get why the NeHe tutorials aren’t helping you :confused: What about Kev’s Space Invaders tut?

Cas :slight_smile:
[/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.

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).

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).

[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.

[b]
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?
[/b]

imgSize * 2 / screenSize

Huh?


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


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).
[/quote]
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. :-/

[quote]jME’s site is unavailable again.
The intarweb is plotting against me.
[/quote]
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?
[/quote]
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.

You have a nice OpenGL doc here

Thanks.

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

I will attempt to right my own renderer for now.

Thanks. Now that’s more like it. :slight_smile:

@ mojomonk: Do You have any hints when it’s up again ?

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. :-/

Seem to be semi working now: site up, forum down…

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… :stuck_out_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.