• Create Account

# opengl question

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

13 replies to this topic

### #1phil67rpg  Members   -  Reputation: 767

Like
0Likes
Like

Posted 10 May 2014 - 06:12 PM

well it has been almost 2 months since I posted to this forum. is it still ok if I ask a very simple question?

### #2JTippetts  Moderators   -  Reputation: 8161

Like
3Likes
Like

Posted 10 May 2014 - 06:39 PM

Is it one you've already asked before? If so, the response is likely to be predictable. Are you prepared to take the advice of the responders, and make an honest effort to understand it and use it to solve your problem? If not, then again the response is likely to be unpleasant.

Unfortunately, you have made a name for yourself among many of the members of this community, and I believe it is going to take extraordinary effort on your part to overcome that. You are free to post, as none of your posts technically violate any hard rules, but just understand that if you expect anything good to come of it, you are going to have to work very hard.

### #3Lactose!  GDNet+   -  Reputation: 2534

Like
2Likes
Like

Posted 10 May 2014 - 06:40 PM

I have to admit I'm interested in seeing where this goes...

As far as I can tell, the forums are (still!) open for people asking questions. Keep in mind that, as L. Spiro (and probably others) has mentioned before, there are good/effective ways to ask questions, and there are bad/ineffective ways. This has all been said before, so I won't repeat it here.

If you have a simple question I would encourage you to ask it. If it's something which can be answered in a sensible manner, I'm sure people will answer.

Regardless, good luck with whatever you're trying to accomplish, even though I don't personally really see the point in making a thread to ask whether you can ask something.

Project journal, check it out!

### #4TheChubu  Crossbones+   -  Reputation: 3760

Like
1Likes
Like

Posted 10 May 2014 - 06:53 PM

well it has been almost 2 months since I posted to this forum. is it still ok if I ask a very simple question?
If you don't know the answer, how do you know it is simple?

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

### #5phil67rpg  Members   -  Reputation: 767

Like
0Likes
Like

Posted 10 May 2014 - 07:00 PM

well I have done a lot of reading about opengl, in fact I am reading the "red book" which is the opengl programming guide. however I have a very simple question to ask. I have searched the internet for answers but I am still a little confused. All I want to do is shoot a bullet sprite from a space ship sprite. I want to shoot bullets like in asteroids, in a machine gun fashion. I am using the space bar to shoot bullets. here is the code I working on.

void

bullet()
{
up += 0.5f;

if (up >= 18.0f)
{
up = 0.0f;
}
}
void

handleKeypress(unsigned char key, int x, int y) {

switch (key) {

case 27: //Escape key
exit(0);

break;

case 32: //Space Bar
bullet();

break;
}
glutPostRedisplay();
}


I know this is a very simple question but I need a new set of eyes to look at this problem.

thank you in advance for your patience. I am doing the best that I can do.

### #6JTippetts  Moderators   -  Reputation: 8161

Like
8Likes
Like

Posted 10 May 2014 - 07:57 PM

Nope, phil, unacceptable. You never even asked a question, you just posted a snippet of code that looks a whole lot like any number of other snippets of code you have posted in the past decade or so, demonstrating that you have not even attempted to follow the advice you have been given before. Do you have an actual question, and one that you have not asked before? Because this looks very, very much like just about every other post you have made since 2004. Do you honestly expect other people to waste their time trying to help you when you have not heeded advice and learned how to ask proper questions?

People have been very patient with you, phil. For a very long time. But you need to understand that you have to change your approach to all of this. It is just not acceptable for you to continue wasting the time of others. Before you come back to this thread, or any other new thread, I want you to re-read the advice given to you in past threads. I want you to really study it, because I promise you there are answers to your problems there. When you do come back, you really need to ask an actual question, and it better not be something vague like "how do I shoot bullets?"

I have been reluctant to employ actual moderation against you, but understand that my own patience (as well as the patience of others) is growing thin.

### #7phil67rpg  Members   -  Reputation: 767

Like
0Likes
Like

Posted 10 May 2014 - 08:11 PM

then how do I ask a relevant question?

### #8phil67rpg  Members   -  Reputation: 767

Like
0Likes
Like

Posted 10 May 2014 - 08:19 PM

how does everyone else get so good at game programming and I have such a hard time, am I just stupid?

### #9diventurer  Members   -  Reputation: 777

Like
3Likes
Like

Posted 10 May 2014 - 08:47 PM

I'm sorry, but have you been trolling for a whole decade now?

Downvote me all you want, but I can not stop laughing.

Phil, have you really been programming for 10 years? I looked at your first posts, and I'm amazed at how you're still trying to grasp the basics.

If you haven't managed to understand the basics by now, you will probably never do so.

I have a feeling I'm not the first one to tell you this.

I'm honestly feeling really, really weird writing this post. I just can't comprehend the fact that you've been trying to learn programming for 10 years. It feels like I'm daydreaming and that my post doesn't make sense. It is just that weird.

Edit:

Also, you say: "Am I just stupid?"

Sure, that might be the case. However, it's maybe the fact that you do not have a talent related to programming.

People like to say that as long as you work hard enough, you will accomplish things. The reality of it is that you have to work hard and be talented.

Let's face it; you have no talent within the realm of programming. Try something different.

Edited by diventurer, 10 May 2014 - 09:00 PM.

### #10phil67rpg  Members   -  Reputation: 767

Like
0Likes
Like

Posted 10 May 2014 - 08:51 PM

well then am I just stupid?

### #11diventurer  Members   -  Reputation: 777

Like
1Likes
Like

Posted 10 May 2014 - 09:11 PM

well then am I just stupid?

Way to miss the point.

Edit:

To clarify. Yes. I now see you as a stupid person.

Edited by diventurer, 10 May 2014 - 09:12 PM.

### #12phil67rpg  Members   -  Reputation: 767

Like
0Likes
Like

Posted 10 May 2014 - 09:21 PM

thanks I really appreciate that.

### #13frob  Moderators   -  Reputation: 19023

Like
7Likes
Like

Posted 10 May 2014 - 10:34 PM

* Before you post, make sure you have tried every option you can with respect to figuring out the problem yourself.
* Be prepared to answer the question (as part of your question, ideally) "what have you tried to solve the problem yourself?"
* Be as descriptive as you can; state the language, platform, compiler, et cetera that you are using, as relevant.
* When posting code (which you should do if the problem is at all code-related), post it verbatim without transcribing or omitted code you believe is relevant as you can easily hide the problem that way. If your problem exists in a very large code base, try writing a smaller test application that reproduces the problem so that you can post a smaller amount of code for others to search through.
* Make your question as understandable as possible -- go easy on abbreviation and Internet slang. If you ask a clear, concise question, you are most likely to get a clear, concise answer.
* Make your subject title as relevant as possible.

Programmers are normally a very self-sufficient bunch. We will try things out on our own and experiment. We are generally curious to why things work or don't work, and will solve the puzzle with our own reasoning skills. When we get stuck of have an issue, first we normally try some experiments, then we will search online to see what others have done, and try to apply that knowledge with even more experiments. We will also dig through the source code of other programs that have succeeded, and use the knowledge to experiment some more.

It is fairly rare for an experienced programmer to ask online for questions, usually we will discover the answers ourselves through a combination of research and experimentation.

If you want to ask good questions in a programming environment, demonstrate that you have experimented a great deal, and researched a great deal, and that despite all your efforts you are still unable to resolve the issue. When you finally get to the point of asking, you should have enough experiments and research to know exactly the error message or problem, and know approximately where the problem lies.

In the past many of your posts have not shown that you have put in any effort, simply asking and expect the community to answer. This time seems to be similar, announcing "I have a problem, this source code doesn't work", with no real evidence that you have experimented and researched on your own.
Check out my personal indie blog at bryanwagstaff.com.

### #14jbadams  Senior Staff   -  Reputation: 17320

Like
8Likes
Like

Posted 11 May 2014 - 06:15 AM

To add one final remark to this topic, I'm going to quote some advice JWalsh gave you in the second topic you ever posted here on November 19th 2004, where funnily (or perhaps sadly) you were apparently trying to make the same game you're still trying to make now -- an Asteroids style game using OpenGL:

Phil,

No offense, but that seems less like a simple question and more like a "how do I write a game". Its going to be very tough to get anyone to answer such a broad question.

"How to shoot bullets from a space-ship" is a fairly simple task, but it's not something that can be quickly and easily explained to you.  As JWalsh said to you in the above quote, instead of asking a simple question you're basically asking how to create a major feature of a game.  There are literally thousands (or more!) of possible correct answers to that question, and you might expect to go through a whole chapter (or likely more) of a book to learn this; it's not the kind of thing that can be quickly explained in a short forum post.

frob's post contains some excellent advice from the faq on asking better questions.

You're probably not stupid, but you give up too easily and you don't seem to really listen to the advice you're given.  You should not still be stuck on exactly the same type of problem as you were working on 10 years ago; if you stuck with it until the problem were actually solved rather than giving up for 3 months and then coming back with an almost identical question (which you then also end up giving up on) you would progress to bigger and better things.

Forget OpenGL and start from scratch (as I suggested 3 months ago) with something simpler.  No offence, but you're just not getting anywhere with OpenGL -- you might be able to in future, but you need to try something simpler first.  Here's a simple list of steps for you:

1. Download SFML and follow the getting started tutorial for your development environment (from here) to install it and get set up.  Get help if you have problems, and do not give up until you have it set up properly.
2. Follow the tutorial to open a window. Get help if you have problems, and do not give up until you have a window open.
3. Follow the tutorials on "drawing 2d stuff" and "sprites and textures" to draw a single sprite (make it a space ship if you like!) in your window.  Get help if you have problems, and do not give up until you have a sprite drawn in your window.
4. Follow the tutorial on "keyboard, mouse and joysticks" to make your sprite move in response to the arrow keys on your keyboard.  Get help if you have problems, and do not give up until your sprite is moving around the screen in response to input.
5. Referring back to the drawing tutorials (from step #3) and the input tutorial (from step #4), make a second sprite (make it a bullet if you like!) appear in your window when the space-bar is pressed.  Don't worry about putting it in the right place yet (just put in in the middle of the window), and don't worry about making it move.  Get help if you have problems, and do not give up until your second sprite appears in response to pressing the space-bar.
6. Make it so that your second sprite (bullet) moves constantly until it goes off the screen.  Don't worry about making it go the correct way, just make it go up for now.  Get help if you have problems, and do not give up until it moves up and disappears off the top of the screen after you press the space bar.
7. Make it so that if your bullet moves off of the screen it will be removed.  Get help if you have problems, and do not give up until it's working.
8. Make it so that instead of appearing in the middle of the screen your bullet appears in front of the space-ship.  Get help if you have problems, and do not give up until it's working.
9. If it doesn't already, make sure that you can spawn additional bullets by pressing the space bar again.  Get help if you have problems, and do not give up until it's working.
10. Continue to make very small additions to your program, and at each stage get help if you're stuck and do not give up till it works.  Continue until you have a complete asteroids game including a simple menu, scores, and a proper "game over", with no obvious bugs.
11. Make a slightly more complicated game using the same technique of breaking it down into small steps.  Each time you finish a game you can make something more complicated next.
For all of the above steps (except the test program from step #1) actually type out the code, don't just copy and paste from the tutorials.

If you get stuck and need help you'll be asking a simple question: rather than making a post like

"how do I make a space ship shoot bullets"

you might be making a post more along the lines of

"I can make a bullet appear in my window when I press the space bar (see the included code), but I'm having trouble making it appear in front of my space ship instead of in the centre of the window.  This is the specific part of my code where I'm making the bullet appear, what am I doing wrong."

You would of course also follow the advice from frob's post and include all of the relevant details and code samples, but do you see how that's actually a simple question that can be quickly and easily answered ("just change those couple of numbers in your code on <whichever line needs to be changed>!"), as opposed to the broad questions you have been asking?

• You need to ask smaller, simple questions, and you need to actually listen to the answers properly.  Look back through your posting history, and when you're going to ask a question you've asked before use the previous answers rather than asking again.
• You need to stick with your problems rather than giving up when you run into problems.  Do not give up.
• You need to do your own coding (relying on help and tutorials as needed) rather than copying and modifying larger pieces of "base-code" from God-knows-where.

Hope that helps Phil.  Good luck.