1. ▼ dafuq did I do?
Join Date
Dec 2013
Posts
204
Rep Power
0

## Flipping these coordinates.

Well, I am making a minimap for my 3D project and as expected, the minimap renders weird. It is displaying as if it was facing right. Here is a picture:

EDIT: Never mind, I fixed it. Code posted.

My mind is at a blank right now, I've had a really long day so I am going to make this post short and sweet. Code:

Java Code:
```glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1, 1, 1, 0.5f);
glVertex2i(10, 10);
glVertex2i(210, 10);
glVertex2i(210, 210);
glVertex2i(10, 210);
glEnd();

int[] pos = getChunk((int) position.x, (int) position.z);

for (int x = 0; x < 10; x++) {
for (int y = 0; y < 10; y++) {
if (chunk[pos[0]][pos[1]].isActive(x, 1, y)) {
glColor4f(0, 0, 0, 0.5f);
int x1 = 200 - (x * 20) + 10;
int x2 = 200 - ((x * 20) + 20) + 10;

int y1 = (y * 20) + 10;
int y2 = ((y * 20) + 20) + 10;

glVertex2i(y1, x2);
glVertex2i(y2, x2);
glVertex2i(y2, x1);
glVertex2i(y1, x1);
glEnd();
}
}
}
glDisable(GL_BLEND);```
Note that this is openGL, but the coordinate problem has nothing to do with that specifically.
Last edited by zFollette; 01-13-2014 at 10:29 PM.

2. Senior Member
Join Date
Jan 2013
Posts
168
Rep Power
8

## Re: Flipping these coordinates.

Where did you learn to use OpenGL? Did you also use LWJGL?

3. ▼ dafuq did I do?
Join Date
Dec 2013
Posts
204
Rep Power
0

## Re: Flipping these coordinates.

Originally Posted by pj6444
Where did you learn to use OpenGL? Did you also use LWJGL?
Yes, LWJGL. I learned by myself.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•