345 Posted Topics
I have made a python program which will create an OpenGL and render a teapot (GLUT standard teapot) with a shader that I specify. The shader is specified as follows: [LIST] [*]I have a file called "index.ini" which contains the file paths to a vertex shader and pixel shader file … | |
![]() | Re: I thought PyGoogle was dead? [url]http://pygoogle.sourceforge.net/[/url] "Unfortunately, Google no longer supports the SOAP API for search, nor do they provide new license keys. In a nutshell, PyGoogle is pretty much dead at this point." |
Re: I'm guessing you'd download the appropriate headers and libraries and dump them in your compiler/IDE folders. If you want something simpler, have a look at Allegro. What IDE/Compiler are you using anyway? | |
Re: For a start, on line 9 you call: [CODE]drawPatchwork(height, width, Colours)[/CODE] You don't have a function called "drawPatchwork" In line 45, you pass a value to variable "y" in the variables. However, you then instantly overwrite it in the next line to value "51". Line 52 can be [CODE]radius-=5[/CODE] Line … | |
Re: What is the problem that you are having? You say on line 57, "this doesn't work". What bit doesn't work? What is exactly the problem? What is it meant to do? | |
Re: One useful trick for creating sky is "sky box". Basically, this is a cube surrounding your entire map (ie everything is inside it). On the inside of the cube, you map a sky texture. Unfortunately, this presents other issues to deal with, such as removing the seams at the edges … | |
Re: Please use code tags next time (push the CODE button before you paste your code). | |
Re: Couldn't you use a switch instead of having all of those if statements? I'm sure they will be an even better method than that. Do you actually need the lower case bit? Or could 'z' and 'Z' be the same? If so, then you just need one line to capitalize … | |
Re: We won't write your code for you. It's your homework, not ours. Show us some of your code and we can help you if you have problems. But don't think that we will do your hard work. These tasks are designed for you to learn. You won't learn anything if … | |
Re: Can we see the code please? It's near impossible to help with errors unless we can see the code. | |
Re: You'll want to research fstream for reading the files as well. | |
Re: Please repost with code tags (push the code button before you paste!). Then we can read your code much easier. | |
Re: Here's a demo code: [CODE]#include <cstdlib> #include <iostream> using namespace std; int main() { //variables //length of array const int len=5; //array of numbers. Obvs. 24 is highest int arr[len]={3, -1, 24, 10, 16}; //index of current highest int HighestSoFar=0; //loop until we have tested each array value int i=0; … | |
Re: A quick google turned this out (I just added ' system("pause"); ') : [CODE]#include <fstream> #include <iostream> using namespace std; int main () { char buffer[256]; ifstream myfile ("test.txt"); while (! myfile.eof() ) { myfile.getline (buffer,100); cout << buffer << endl; } system("pause"); return 0; } [/CODE] Seemed to work … | |
Re: To be honest your best off with video tutorials. BlenderCookie is really good. The authors are all pros and they voice over the tutorial well (so you can model whilst just listening to the video) and they cover all the basics. They do everything from modeling, right up to rendering. | |
Re: If it is a compiled executable, no. You can obviously view the code of open source games, but I take it you mean commercial games. Technically you can decompile code, but it's highly illegal. | |
Re: The bartender becomes increasingly worried about the current state of the duck and cautiously asks the duck to calm down. | |
| |
Re: Hi I'm Mark and I'm a... [LIST] [*]Music Geek [*]Music Geek [*]Music Geek [/LIST] | |
Re: In your code, you have a kind of double negative here: [CODE]while not n == 0:[/CODE] This is saying that "while 'n' does not equal 0", do stuff. A simpler way of writing this is "while n != 0:". The "not" is only really used for boolean. ie: [CODE]a = … | |
Re: What are the errors? You could also reduce the amount of variables that you have by a fair way. Instead of using "int lvl1", "int lvl2" and so on, just use an array. | |
Re: That's because you are using blender 2.55 The instructions you were given are for 2.49b and earlier. If I were you, I would use 2.49b 2.55 confuses the heck out of me :/ | |
Re: Welcome the DaniWeb :) I had this problem a few days ago. I always thought that you could define a variable like this: [CODE]int a;[/CODE] but it always picks up a weird value and not zero like I would have thought. Make sure that all your variable definitions are defined … | |
Re: When you have the "return" statements, ie. [CODE]{return title;} //and {return price;}[/CODE] You shouldn't have braces. It should be: [CODE]return title; return price;[/CODE] | |
Re: If the last letter is b or d or g etc., then add "word[wordlength]" on the end, nad then add 'er'. Just use a compound if statement to test for all the letters. | |
Re: We won't do your homework for you. Without you showing a decent amount of code you have written (ie. effort), we will only link you to places that can get you on the right track, and we will NOT give you bits of code. Sorry, but it's the rules. | |
Re: Looks like a fake virus. What's even the point? Is it that fun scaring the sh*t out of someone you don't know? Do you think it's enjoyable for them? Would you like (if you though it was real)? | |
Re: [url]http://www.geekpedia.com/KB114_What-is-the-difference-between-sharpdefine-and-const.html[/url] | |
Re: Please post your code. Don't forget to push the code button before you paste each file. | |
Re: Please press the code button before you paste your code. Please explain your problem better. What does your program do to the data before it writes it into other files? | |
Re: These won't fix your issue, but they will clean up your code a bit. [B]In main.cpp:[/B] -Change lines 8-10 to: [CODE]float mypointx, mypointy, Answer;[/CODE] -After line 22 add: [CODE]system("pause");[/CODE] [B]In XYPoint.h:[/B] -Change lines 13-17 to: [CODE]float mypointx, mypointy, pointpx, pointpy, mydistance;[/CODE] [B]In XYPoint.cpp:[/B] -Remove lines 6-10 (Variables already zero. For … | |
| |
Re: Please could you post what the exercise is so that we have a better idea of what's going on. Thanks :) | |
Re: Have a look at classes. Make a class for your frigate/each type of ship. Then it should have functions such as one for movement, firing etc. You'll need to be careful about what variables you need and passing them backwards and forwards between your main program and the classes. [url]http://www.cplusplus.com/doc/tutorial/classes/[/url] … | |
Re: So you'll obvs. have your array "Board[3][3]". And values will be "0" or "1". You want a loop that will reprint the game board. Use 'system("cls");' on Windows to clear the console. Then reprint the board. Each loop, the user should be asked to press a key ("W", "A", "S" … | |
Re: If I were you I would just stick with "time.sleep()". It's probably the easiest way and it's pretty damn accurate. With regards to your opening paragraph: You wouldn't use an infinite loop, because you can't break from an infinite loop because then it would be a finite loop not an … | |
Re: It's YOUR exam. Not ours. If you show some effort, we can help you, BUT, we won't write it for you. | |
Re: Please use code tags. (Press the code button before you paste). We need to know more: What are each of the calculations? (I know we can see this in the code, but it's just to check the logic). What do you input? What is the expected output? What is the … | |
Re: [url]http://www.wxwidgets.org/docs/tutorials/hello.htm[/url] | |
Re: Sweet sprites! It looks fine on my computer. I'm guessing it would be to do with the time it takes to redraw the scene? Have a look into dirty-rectangles and dirty-sprites. These only update the parts of the screen or the sprites that need updating, without redrawing the whole scene. … | |
Re: You would want some kind of input for detecting whether the user wants to go left or right. Consider using a loop to load the images into an array. For example, if you have the following file structure. [CODE] -main.py -Pictures: -pic0.png -pic1.png -pic2.png -pic3.png[/CODE] You could load the images … | |
Re: Make sure the header is in your include directory of the compiler/IDE. If you don't have the file, don't use it. | |
Re: It is actually pointing to line 49. This is the default new-line at the end of your code. Look at the braces in your main. You have the opener for main, open and close for the while loop, BUT, you don't have the close brace for main. Add another brace … | |
Re: We won't do your homework for you. If you get started and write some code, we can point you in the right direction. | |
Re: [B]C++[/B] Allegro (easy): Keep using it until you are confident to move on. OpenGL (intermediate): Can be used for 2D. Don't get frustrated and stick with it. Direct2D (hard): Specially built 2D library, but DirectX is hard to code. [B]Python[/B] PyGame (easy): Same as allegro really. PyOpenGL (intermediate): Use it … | |
Re: Are you getting compiler errors? Runtime errors? Is it that your program logic isn't working properly (ie your not getting the expected output)? Please be more specific and we can help you. Thanks :) | |
Re: Well a simple fix would be to multiply everything by 10. Ie: [CODE]import os print float(1+1+1-3)/10 os.system("pause")[/CODE] |
The End.