• What are you working on? v16
    5,004 replies, posted
More learning :buddy: (are you guys annoyed by this? if so tell me and I shall stop posting.) [cpp]#include <iostream> namespace stuff { //Add stuff to a namespace named 'stuff'. int number = 10; //An integer with a value or 10. int& refToNumber = stuff::number; //A referance to said int. int* ptrToNumber = &stuff::number; //A pointer to said int. } template <typename id> void refSum(id& first, id& second, id& answer) { answer = first + second; //Changing variables outside of functions scope usig references. } template <typename var> //Just trying templates out. void ptrplusfive(var* ptr) //This is useless as I could just make an overloaded function for both an int and a double. { std::cout << "You can only add 5 to an int or a double." << std::endl; } template <> void ptrplusfive<int>(int* ptr) { *ptr = *ptr + 5; } template <> void ptrplusfive<double>(double* ptr) { *ptr = *ptr + 5; } int add(int nr1, int nr2 = 1) //Here: second int has a defauld value incase you don't specify one yourself. { return nr1+nr2; } void setTo9000(int arr[], int index) //Showing that arrays work similar to pointers/references. { arr[index] = 9000; } void multiply(int* p1, int* p2, int*pAns) { *pAns = *p1 * *p2; //Looks kinda confusing... } int main() { using std::cout; //So I don't have to use 'using namespace std;' using std::cin; //because that is a bad practice. using std::endl; stuff::refToNumber = 5; //Here: showing that changing the value of a referance or cout << stuff::number << " "; //pointer changes the original value of an int. *stuff::ptrToNumber = 2; //Also all of this is in a namespace. cout << stuff::number << endl; int arr[] = {1,2,3,4,5}; ptrplusfive(&arr[2]); //Adding 5 to one of the elements of the array. setTo9000(arr, 0); //Setting the first element of said array to 9000. multiply(&arr[1],&arr[3],&arr[4]); //Changing the last element of the array to a multiple of the 2nd and the 4th. int* ptr = 0; for(int i=0;i<5;i++) //This prints the array using pointers. { ptr = &arr[i]; cout << *ptr << " "; } cout << endl << ((double)arr[1])/((double)arr[3]) << endl; //Devides 2 by 4, after converting them from ints to doubles. int a = 5; int b = 10; int c; refSum(a, b, c); cout << c << " " << add(a) << " " << add(a,b) << endl; double ninety = 90; ptrplusfive(&ninety); cout << ninety << endl; ptrplusfive("hai"); //Testing an templated function. enum{ //Oh look, an enum :D int1 = 9001, int2 = 9, int3 }; cout << (double)int3 << endl; double arr2[][3] = {{1.2,3.4,5.6}, //Multi-dimensional array {99.66,88.77,22.22}, {951.21,159.12,357.51}}; cout << arr2[1][2] << endl; //Printing one of the elements of the array cout << arr2[0][5] << endl; //Printing the same element using memory address trickery! refSum(arr2[0][0],arr2[0][1],arr2[0][8]); //Using my old templated function I add two elements of the //array and store them in the last element using the same trickery. cout << arr2[2][2] << endl; //Showing the last element of the array to show that it is, indeed 4.6 cin.get(); return 0; }[/cpp] Today I learned about Multi-dimensional arrays, enumerations, type convertion, and more about how arrays are stored in the memory. I'm trying to learn about classes but the XOAX tutorials are trying to teach me piano instead :saddowns: ([url]http://xoax.net/comp/cpp/console/Lesson30.php[/url]) , also I'm getting sick and tired of all the ads there. Does anybody happen to have a better simple classes tutorial than this?
[QUOTE=DeadKiller987;29133084](are you guys annoyed by this? if so tell me and I shall stop posting.)[/QUOTE] Heck no, it's more content than a lot of posts have :P It's always nice watching people progress with things so keep posting I'd say!
[QUOTE=DeadKiller987;29133084]More learning :buddy: (are you guys annoyed by this? if so tell me and I shall stop posting.) [/QUOTE] Learning is good. Go nuts. We don't mind.
Starting to learn OpenGL :dance: [IMG]http://i225.photobucket.com/albums/dd159/samuka97/yayopengl.png[/IMG] Beware, Game Maker! [editline]12th April 2011[/editline] Thanks for the gaybow, Carl.
Now understanding what you actually wrote is another matter.
[QUOTE=Darwin226;29133762]Now understanding what you actually wrote is another matter.[/QUOTE] Yeah, that'll take a few months. But believe it or not, this is the first time I've successfully compiled something in Code::Blocks.
[QUOTE=Samuka97;29133824]Yeah, that'll take a few months. But believe it or not, this is the first time I've successfully compiled something in Code::Blocks.[/QUOTE] I prefer Visual Studio on windows, but Code Blocks is a pretty good IDE for windows too, I just don't like the wxWidgets look. Code Blocks doesn't actually come with a compiler, it usually just comes with the GCC compiler. Not calling you out but it's good to note that Code Blocks can use all sorts of compilers, even the Visual Studio compiler.
[QUOTE=danharibo;29134078]I prefer Visual Studio on windows, but Code Blocks is a pretty good IDE for windows too, I just don't like the wxWidgets look. Code Blocks doesn't actually come with a compiler, it usually just comes with the GCC compiler. Not calling you out but it's good to note that Code Blocks can use all sorts of compilers, even the Visual Studio compiler.[/QUOTE] I know. I choose to use Code::Blocks because it's tiny, I can make it look good and I can just slap it on my pendrive and, when I'm bored, I can just do some programming. I find Visual Studio to be too.. "clunky", if you know what I mean.
This new humble bundle has made my day. Anyone want a key?
[img]http://img13.imageshack.us/img13/7929/outyy.png[/img] There's 12 pages of maths behind this image. The three purple lines are axes. The lower green line is a target object on a trajectory with constant acceleration, but it could be on any polynomial trajectory. The above green line is an object that's accelerated to one possible collision course with the target. I need a better way to draw these graphs but my first priority is to get interception courses working. The difference between an interception and a collision is that ideally interception shouldn't result in a collision, but rather after interception the objects would continue on the same trajectory. My current plan (and the reason for most of the math) is to approximate the interception course as a collision course, and then gradually alter the course to match their velocities. More precisely, the interception course is a function that maps a real (time) to a vector (position) - preferably without being limited to any arbitrary number of dimensions: [img]http://latex.codecogs.com/gif.latex?%5Coverline{f}%20:%20%5Cmathbb{R}%20%5Crightarrow%20%5Cmathbb{R}^n[/img] The target function is similar: [img]http://latex.codecogs.com/gif.latex?%5Coverline{g}%20:%20%5Cmathbb{R}%20%5Crightarrow%20%5Cmathbb{R}^n[/img] and there exists such a moment in time, [img]http://latex.codecogs.com/gif.latex?t_1[/img], that [img]http://latex.codecogs.com/gif.latex?%5Coverline{f}(t_1)%20=%20%5Coverline{g}(t_1)[/img] and [img]http://latex.codecogs.com/gif.latex?%5Coverline{f}'(t_1)%20=%20%5Coverline{g}'(t_1)[/img] (or at least they must get very close) Other limitations on the solution are that its acceleration should never exceed the given maximum thrust the interceptor is capable of producing, and the solution should be a minimum of some (still unspecified) cost function - probably one that minimizes interception time and fuel, or the total amount of acceleration.
[QUOTE=Samuka97;29134380]I know. I choose to use Code::Blocks because it's tiny, I can make it look good and I can just slap it on my pendrive and, when I'm bored, I can just do some programming. I find Visual Studio to be too.. "clunky", if you know what I mean.[/QUOTE] Considering how it forces a load of shit onto my C:\ drive, yes Visual studio is a clunky pile of ass.
[QUOTE=neos300;29134537]This new humble bundle has made my day. Anyone want a key?[/QUOTE] I'd like one :)
[QUOTE=Samuka97;29133585]Starting to learn OpenGL :dance: [img_thumb]http://i225.photobucket.com/albums/dd159/samuka97/yayopengl.png[/img_thumb] Beware, Game Maker! [editline]12th April 2011[/editline] Thanks for the gaybow, Carl.[/QUOTE] After you understand this, I hope you'll ditch all of this deprecated nonsense as soon as possible.
[QUOTE=Overv;29135239]After you understand this, I hope you'll ditch all of this deprecated nonsense as soon as possible.[/QUOTE] Speaking of that, where can I find a place that tells me what is depreciated for OpenGL?
If it not here [url]http://www.opengl.org/sdk/docs/man3/[/url] it's deprecated.
[QUOTE=Moustach3;29126645][media]http://www.youtube.com/watch?v=QMKTdrQqpNk[/media] New theme?[/QUOTE] I can't believe nobody posted this yet: [media]http://www.youtube.com/watch?v=hWTFG3J1CP8[/media]
[img]http://i55.tinypic.com/1zd7l7r.png[/img] You know what it is :smug:
[img]http://i.cubeupload.com/su9CKO.png[/img] One step closer to world domination.
[QUOTE=Jallen;29129633]Seriously you can buy it for $0.01 and you are still asking people to buy it for you? Not that I'm saying it's a good thing to pay only that much for it.[/QUOTE] Anybody who pays less than $10 is an ass. If you can't afford that, don't buy it. They really should put a minimum amount in to cover the costs and give at least a small amount to the developers and charities. It really annoys me seeing people pay such a low amount. Instead of being a greedy shit go put that cent into a charity collection box at your local Tesco or whatever. [QUOTE=Staneh;29129687]I'll still be giving it away here: [url]http://www.facepunch.com/threads/1078139-Humble-Frozenbyte-Bundle-key-giveaway[/url]! When this contest is over, I will have 5 cents remaining on my paypal account, so I will have 5 more Bundles to give out. I'm such a greedy bastard, buying the game for 0.01$...[/QUOTE] Yeah, please don't do that. That won't even cover the paypal cost. Do you like making people lose money? Think of the children. [QUOTE=polkm;29135329]Speaking of that, where can I find a place that tells me what is depreciated for OpenGL?[/QUOTE] Basically, don't read ANY of the free OpenGL tutorials. I haven't found one that's not horrible and deprecated. (Such a thing would be much appreciated if anyone knows of one. I should probably buy a book)
[QUOTE=Xera;29136139]Anybody who pays less than $10 is an ass. If you can't afford that, don't buy it. They really should put a minimum amount in to cover the costs and give at least a small amount to the developers and charities. It really annoys me seeing people pay such a low amount. Instead of being a greedy shit go put that cent into a charity collection box at your local Tesco or whatever. [/QUOTE] I'm not an expert, but I'm sure that the Sum of the money given by the people who pay < $10, is still contributing, since if it was capped at > $10, they wouldn't have bought it anyway. Also, they cannot incur charges from paypal, and under no circumstances can they 'lose money' just because some idiot paid $0.01
[QUOTE=Darwin226;29135385]You know what it is :smug:[/QUOTE] I really don't. Please, do explain. :allears:
[QUOTE=danharibo;29136442]I'm not an expert, but I'm sure that the Sum of the money given by the people who pay < $10, is still contributing, since if it was capped at > $10, they wouldn't have bought it anyway. Also, they cannot incur charges from paypal, and under no circumstances can they 'lose money' just because some idiot paid $0.01[/QUOTE] Do you understand how PayPal get their money? If you send money you have the option to incur the charge yourself or deduct it from the money the other person receives. If you're buying something like this the seller incurs the charge. "Do you guys incur charges for payments? i.e if someone decides to be a horrible person and pay $0.01 via paypal do you actually get that money? Lauri/Frozenbyte: heh Lauri/Frozenbyte: no we lose money with that &#8594;Yeah, I thought so Lauri/Frozenbyte: the payment processor and the download/server costs make like 30-50 cents of loss to us" Straight from the bundle support thing at the bottom of the page. [editline]13th April 2011[/editline] &#8594;It annoys me seeing people buying it for $0.01 Lauri/Frozenbyte: yeah but it's their right as thats lowest one .. of course, we try to ask people to pay what they feel is right to &#8594;Do you know how many people pay that much? Lauri/Frozenbyte: some people just want to spend 1 cent to justify piracy or whatnot, or simply don't care :) Lauri/Frozenbyte: afaik it can be as high as 40%
Just broke a load of my code... Hey, that rhymes :v: But in all seriousness, don't even attempt looking at FFT. It's not very friendly :saddowns: [editline]13th April 2011[/editline] Fixed...
[QUOTE=Xera;29137140]-[/QUOTE]I had seen several people claim it caused no overhead. I will be sure to mutilate anyone I see purchasing for $5~ >
I had 40 bucks in my PayPal account, so they got that. Split $10 each way. [editline]13th April 2011[/editline] I'm seriously thinking of going commercial with this game...
[QUOTE=Xera;29137140]Do you understand how PayPal get their money? If you send money you have the option to incur the charge yourself or deduct it from the money the other person receives. If you're buying something like this the seller incurs the charge. "Do you guys incur charges for payments? i.e if someone decides to be a horrible person and pay $0.01 via paypal do you actually get that money? Lauri/Frozenbyte: heh Lauri/Frozenbyte: no we lose money with that &#8594;Yeah, I thought so Lauri/Frozenbyte: the payment processor and the download/server costs make like 30-50 cents of loss to us" Straight from the bundle support thing at the bottom of the page. [editline]13th April 2011[/editline] &#8594;It annoys me seeing people buying it for $0.01 Lauri/Frozenbyte: yeah but it's their right as thats lowest one .. of course, we try to ask people to pay what they feel is right to &#8594;Do you know how many people pay that much? Lauri/Frozenbyte: some people just want to spend 1 cent to justify piracy or whatnot, or simply don't care :) Lauri/Frozenbyte: afaik it can be as high as 40%[/QUOTE] Paypal does not charge you for payments under 0.31$. You simply get nothing. [img]http://i53.tinypic.com/j63m76.png[/img] Although I agree that anyone who buys it for under 1$ is an asshole. Because while they aren't charged for your 0.01$ payment they are still paying for your bandwidth, bringing you the great deal, etc.
[QUOTE=Loli;29138540]I had 40 bucks in my PayPal account, so they got that. Split $10 each way. [editline]13th April 2011[/editline] I'm seriously thinking of going commercial with this game...[/QUOTE] Mind if we get a peek?
[QUOTE=high;29140030]Paypal does not charge you for payments under 0.31$. You simply get nothing. [img_thumb]http://i53.tinypic.com/j63m76.png[/img_thumb] Although I agree that anyone who buys it for under 1$ is an asshole. Because while they aren't charged for your 0.01$ payment they are still paying for your bandwidth, bringing you the great deal, etc.[/QUOTE] So they don't charge you under $0.31 they just take it all (i.e. charge you?) I'm sure for businesses receiving thousands of payments it's different. I doubt they'd lie about this, they don't even put it on the website. Or maybe they're only talking about bandwidth and organisational costs. Or maybe the other two transaction handlers charge you.
[QUOTE=Xera;29140633]So they don't charge you under $0.31 they just take it all (i.e. charge you?) I'm sure for businesses receiving thousands of payments it's different. I doubt they'd lie about this, they don't even put it on the website. Or maybe they're only talking about bandwidth and organisational costs. Or maybe the other two transaction handlers charge you.[/QUOTE] They don't charge you in the sense that if you are paid 0.01$ they don't charge you 0.30$ in transaction fees. Also I have a business account, the fees aren't different. Ya, I think they are talking about bandwidth costs, etc.
Updated my shattering Maya plugin: [img]http://img832.imageshack.us/img832/1000/teapot3.png[/img] [img]http://img687.imageshack.us/img687/9853/gold3m.png[/img] [img]http://img215.imageshack.us/img215/3834/hito.png[/img]
Sorry, you need to Log In to post a reply to this thread.