glvertex2f() how the cordinates work?

Started by
9 comments, last by VildNinja 12 years, 6 months ago
Hello due to the lack of common logicalness in the apis today im having troubles working out this bloody cordinate system for glvertex i understand after 3 days of hassle and emotional pain that it works off by telling opengl where you put the point to which reperesents that area position of the vertex and then opengl takes that and puts the vertex where that point is based off the x,y cordinates that you place within glVertex2f(100,100) or whateva then you create more blah blah blah you get the idea


But more my problem is where do i put the points??? exactly i know it based of the glortho projection but whats the general idea for most common sizes basically speaking

By the way
there are no grids that iv followed or even books that tell this("that im aware of") and in "detail" its stupidity at best and i wish i didnt even have to come to a forum because i couldnt get my answer from there official irc or even the books and don't tell me i should have maths before doing OpenGL i know that but i want to do it the hard way because it works for me :) if i made a mistake somewhere tell me nicely anyways


but the real main point is i need a visual picture of a grid so i can reference it to work from Oh! and if possible could someone tell me the vertex order like when you call glvertex2f and call glvertex2f again then again what vertex angle position is selected by opengl that for a GL_QUAD i couldn't find out maybe i didn't see it prehaps

sorry to get angered but i am because im annoyed at myself for having to come to a forum to ask for help when i should be able to do it on my own mainly because its tedious for stupid reasons in my honest opinion if you do decide to help me thank you :D

please explain in a way anyone could understand rather then geek talk it helps alot for people like me :) the best way to learn is too not speak another language to someone who doesn't know :)
Advertisement
What tutorial are you following? If none, then start here: http://nehe.gamedev.net/tutorial/lessons_01__05/22004/ It's a really nice tutorial, and a lot of people in here learned to draw their first polygon from NeHes tutorials :)

Sorry that I'm not giving a direct answer to your question, but I have no idea what you know, and what you don't know. It pretty much sounds like you need a structured introduction to the language, instead of just a simple answer to your question.

And no you don't need to know math to learn most parts of OpenGL.

What tutorial are you following? If none, then start here: http://nehe.gamedev....s_01__05/22004/ It's a really nice tutorial, and a lot of people in here learned to draw their first polygon from NeHes tutorials :)

Sorry that I'm not giving a direct answer to your question, but I have no idea what you know, and what you don't know. It pretty much sounds like you need a structured introduction to the language, instead of just a simple answer to your question.

And no you don't need to know math to learn most parts of OpenGL.


thanks i feel so much better but alas thats based around Win32 and Opengl im an SDL and Opengl user :) and well i could check that linux tutorial for this specific topic but it will just end up being source code with comments and no real explainations that kinda sucks :( iv tried all this too otherwise i wouldn't be here and im trying to avoid as much tedious effort as possible if thats even a option :) but im glad you answered me great job and im following OpenGL Super Bible 5th edition and Opengl 3.1 programmers guide also tons of random tutorials i can find on the net if i have too :) i know there gunna be deperacted soon but i really dont care aslong as it gets the job done at this point its still as good as anything else just have the extra features of opengl 4.1 :) please dont bash me on that lol

Hello due to the lack of common logicalness in the apis today im having troubles working out this bloody cordinate system for glvertex i understand after 3 days of hassle and emotional pain that it works off by telling opengl where you put the point to which reperesents that area position of the vertex and then opengl takes that and puts the vertex where that point is based off the x,y cordinates that you place within glVertex2f(100,100) or whateva then you create more blah blah blah you get the idea


But more my problem is where do i put the points??? exactly i know it based of the glortho projection but whats the general idea for most common sizes basically speaking

By the way
there are no grids that iv followed or even books that tell this("that im aware of") and in "detail" its stupidity at best and i wish i didnt even have to come to a forum because i couldnt get my answer from there official irc or even the books and don't tell me i should have maths before doing OpenGL i know that but i want to do it the hard way because it works for me :) if i made a mistake somewhere tell me nicely anyways


but the real main point is i need a visual picture of a grid so i can reference it to work from Oh! and if possible could someone tell me the vertex order like when you call glvertex2f and call glvertex2f again then again what vertex angle position is selected by opengl that for a GL_QUAD i couldn't find out maybe i didn't see it prehaps

sorry to get angered but i am because im annoyed at myself for having to come to a forum to ask for help when i should be able to do it on my own mainly because its tedious for stupid reasons in my honest opinion if you do decide to help me thank you :D

please explain in a way anyone could understand rather then geek talk it helps alot for people like me :) the best way to learn is too not speak another language to someone who doesn't know :)


Its all really up to you , triangles can be drawn both clockwise and counter clockwise, (if you do backface culling you can set the order you draw triangles in using the glFrontFace function).

The same goes for the coordinate system, it all depends on how you set up the projection matrix (the glOrtho function takes the left, right, bottom, top near and far coordinates as parameters) thus if you call glOrtho(0.0f,100.0f,0.0f,100.0f,-1.0f,1.0f); you'll have 0.0f,0.0f at the bottom left and 100.0f,100.0f at the top right.

If you instead call glOrtho(0.0f,0.0f,1.0f,1.0f,-1.0f,1.0f); you get 0.0f,0.0f at the top left and 1.0f,1.0f at the bottom right.

For 2D games there really is no standard, some set it up to as glOrtho(0.0f,0.0f,width,height,-1.0f,1.0f) to get each gl unit to be equal to one pixel and 0.0,0.0 at the top left corner while others use fixed values.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
i just want the general idea thats structurely explained with some amount of detail in a common knowledge kinda way so i can understand it with as little effort as possible and with that statement it as if there is provokertive effort for me to go learn more and more that i could be taught in a few minutes of writing :) so essentially i still want to learn about how the grids actually work in a general sense with the effort but just not as much as the provoketive ways of the writing above me you shouldn't take it the wrong way however just stating my brillant perception of it

on that note
the reason i do this is to have fun with coding :) not because im truely lazy otherwise i wouldn't do it :D

i just want the general idea thats structurely explained with some amount of detail in a common knowledge kinda way so i can understand it with as little effort as possible and with that statement it as if there is provokertive effort for me to go learn more and more that i could be taught in a few minutes of writing :) so essentially i still want to learn about how the grids actually work in a general sense with the effort but just not as much as the provoketive ways of the writing above me you shouldn't take it the wrong way however just stating my brillant perception of it and yes i do understand some of what your saying speaking in a more common knowledge sense makes it easier for me to understand in turn requires alot less effort and then i can learn it easily and get on with my texture map coding for ever because ill know how to interpretate it
No matter what framework you're using, OpenGL is the same. The setup might be different, but besides from that, all the functions are the same. I've never touched OpenGL from any other language than Java (http://lwjgl.org), but I still lookup in the C programming api, whenever I need to know what a function does. So find a quick guide on how to setup OpenGL in SDL, and the rest should be the same :)

Edit: That's a lie :/ I've also used OpenGL in Python with Pyglet, but it's still the same though.
hey there i think you dont know my knowledge ratio :) i already have a window open thats resizable using SDL :) and has a vertex showing on it already just not in the positions that i wish because i dont know where to position because i cant find a reference visual picture or a get a logical idea of how it works without reading tons of papers so i was hoping someone could sum it down in a few lines of commonality just incase your not aware im talking about how the positoning of points using glvertexes 2 paramaters x and y which is part of the cordinates grid which can be specified by me but where exactly do a i point it too random numbers the x and y parameters btw not the cordinate grid :) and hope it works for everything well thats problem :D that im hoping someone will fix that annoylying tedious effort that in my opinion shouldn't be there in the first place also i would rather someone tell me then go through that major wall that i probs wont be able to get through id get too bored and never code again
going to bed now but please respond if its helpfull in a fitting way

i just want the general idea thats structurely explained with some amount of detail in a common knowledge kinda way so i can understand it with as little effort as possible and with that statement it as if there is provokertive effort for me to go learn more and more that i could be taught in a few minutes of writing :) so essentially i still want to learn about how the grids actually work in a general sense with the effort but just not as much as the provoketive ways of the writing above me you shouldn't take it the wrong way however just stating my brillant perception of it

on that note
the reason i do this is to have fun with coding :) not because im truely lazy otherwise i wouldn't do it :D


Read my post a bit further up, it explains how it works, Without seeing how you've set up your matrices and knowing what you want to achieve its impossible to say how it works in your specific case.

It would probably also help a bit if you put some more effort into your posts, it's incredibly difficult to understand what it is you're actually asking.


Edit: I have a feeling i just got trolled ....
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement